🤖 Pick PR #53599 (Ignore allowImportingTsExtensions...) into release-5.0 (#53600)

Co-authored-by: Andrew Branch <andrew@wheream.io>
This commit is contained in:
TypeScript Bot
2023-04-05 13:39:54 -07:00
committed by GitHub
co-authored by Andrew Branch
parent 233b4b0540
commit dc7e5a738a
10 changed files with 31 additions and 0 deletions
+1
View File
@@ -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",
@@ -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
}
);
});
@@ -0,0 +1,2 @@
import { foo } from "./foo.ts";
//# sourceMappingURL=file.js.map
@@ -0,0 +1,2 @@
import { foo } from "./foo.ts";
//# sourceMappingURL=file.js.map
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=file.js.map
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=file.js.map
@@ -0,0 +1,2 @@
import { foo } from "./foo.ts";
//# sourceMappingURL=file.js.map
@@ -0,0 +1,2 @@
import { foo } from "./foo.ts";
//# sourceMappingURL=file.js.map
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=file.js.map
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=file.js.map