Skip to content

Commit dc7e5a7

Browse files
TypeScript Botandrewbranch
TypeScript Bot
andauthored
🤖 Pick PR #53599 (Ignore allowImportingTsExtensions...) into release-5.0 (#53600)
Co-authored-by: Andrew Branch <[email protected]>
1 parent 233b4b0 commit dc7e5a7

10 files changed

+31
-0
lines changed

‎src/compiler/commandLineParser.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
11041104
category: Diagnostics.Modules,
11051105
description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
11061106
defaultValueDescription: false,
1107+
transpileOptionValue: undefined,
11071108
},
11081109
{
11091110
name: "resolvePackageJsonExports",

‎src/testRunner/unittests/services/transpile.ts

+14
Original file line numberDiff line numberDiff line change
@@ -606,4 +606,18 @@ export * as alias from './file';`, {
606606
testVerbatimModuleSyntax: "only"
607607
}
608608
);
609+
610+
transpilesCorrectly("Can transpile .ts extensions without error",
611+
`import { foo } from "./foo.ts";`, {
612+
options: { compilerOptions: { module: ts.ModuleKind.ESNext, target: ts.ScriptTarget.ESNext } },
613+
testVerbatimModuleSyntax: true
614+
}
615+
);
616+
617+
transpilesCorrectly("Ignores `allowImportingTsExtensions` without `noEmit` error",
618+
`import { foo } from "./foo.ts";`, {
619+
options: { compilerOptions: { module: ts.ModuleKind.ESNext, allowImportingTsExtensions: true, target: ts.ScriptTarget.ESNext } },
620+
testVerbatimModuleSyntax: true
621+
}
622+
);
609623
});

‎tests/baselines/reference/transpile/Can transpile .ts extensions without error (verbatimModuleSyntax=true).js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/baselines/reference/transpile/Can transpile .ts extensions without error (verbatimModuleSyntax=true).oldTranspile.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/baselines/reference/transpile/Can transpile .ts extensions without error.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/baselines/reference/transpile/Can transpile .ts extensions without error.oldTranspile.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error (verbatimModuleSyntax=true).js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error (verbatimModuleSyntax=true).oldTranspile.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/baselines/reference/transpile/Ignores allowImportingTsExtensions without noEmit error.oldTranspile.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)