Skip to content

Commit

Permalink
Ignore allowImportingTsExtensions in transpileModule to suppress op…
Browse files Browse the repository at this point in the history
…tion validation error with `noEmit` (#53599)
  • Loading branch information
andrewbranch committed Mar 31, 2023
1 parent 13c374a commit b29ed18
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
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,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
Original file line number Diff line number Diff line change
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 b29ed18

Please sign in to comment.