mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-24 20:44:53 -05:00
Ignore allowImportingTsExtensions in transpileModule to suppress option validation error with noEmit (#53599)
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user