Skip to content

Commit

Permalink
Cherry-pick PR microsoft#53599 into release-5.0
Browse files Browse the repository at this point in the history
Component commits:
2823dd0 Ignore `allowImportingTsExtensions` in transpileModule to suppress option validation error with `noEmit`
  • Loading branch information
andrewbranch authored and typescript-bot committed Mar 31, 2023
1 parent 0e198c2 commit eda4e7f
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/compiler/commandLineParser.ts
Expand Up @@ -1104,6 +1104,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
category: Diagnostics.Modules,
description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
defaultValueDescription: false,
transpileOptionValue: undefined,
},
{
name: "resolvePackageJsonExports",
Expand Down
14 changes: 14 additions & 0 deletions src/testRunner/unittests/services/transpile.ts
Expand Up @@ -606,4 +606,18 @@ export * as alias from './file';`, {
testVerbatimModuleSyntax: "only"
}
);

transpilesCorrectly("Can transpile .ts extensions without error",
`import { foo } from "./foo.ts";`, {
options: { compilerOptions: { module: ts.ModuleKind.ESNext, target: ts.ScriptTarget.ESNext } },
testVerbatimModuleSyntax: true
}
);

transpilesCorrectly("Ignores `allowImportingTsExtensions` without `noEmit` error",
`import { foo } from "./foo.ts";`, {
options: { compilerOptions: { module: ts.ModuleKind.ESNext, allowImportingTsExtensions: true, target: ts.ScriptTarget.ESNext } },
testVerbatimModuleSyntax: true
}
);
});

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eda4e7f

Please sign in to comment.