From 88119032f1f3516bc0b45f7928e25de931833e18 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Thu, 21 Oct 2021 17:35:42 -0700 Subject: [PATCH 01/10] add new error + suggestions --- src/compiler/checker.ts | 29 ++++++++++++++++++- src/compiler/diagnosticMessages.json | 8 +++++ src/compiler/types.ts | 2 +- ...duleResolutionWithoutExtensions.errors.txt | 20 +++++++++++++ .../moduleResolutionWithoutExtensions.js | 25 ++++++++++++++++ .../moduleResolutionWithoutExtensions.symbols | 21 ++++++++++++++ .../moduleResolutionWithoutExtensions.types | 22 ++++++++++++++ .../moduleResolutionWithoutExtensions.ts | 14 +++++++++ 8 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions.errors.txt create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions.js create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions.symbols create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions.types create mode 100644 tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index bcf3a78f052c5..1568b4aa16348 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1015,6 +1015,18 @@ namespace ts { const builtinGlobals = createSymbolTable(); builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol); + // Extensions suggested for path imports when module resolution is node12 or higher. + // The first element of each tuple is the extension a file has. + // The second element of each tuple is the extension that should be used in a path import. + // e.g. if we want to import file `foo.mts`, we should write `import {} from "./foo.mjs". + const suggestedExtensions: [string, string][] = [ + [".mts", ".mjs"], + [".ts", ".js"], + [".cts", ".cjs"], + [".mjs", ".mjs"], + [".js", ".js"], + [".cjs", ".cjs"]]; + initializeTypeChecker(); return checker; @@ -3417,7 +3429,7 @@ namespace ts { (isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : undefined)?.name || (isLiteralImportTypeNode(location) ? location : undefined)?.argument.literal; const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat; - const resolvedModule = getResolvedModule(currentSourceFile, moduleReference, mode)!; // TODO: GH#18217 + const resolvedModule = getResolvedModule(currentSourceFile, moduleReference, mode)!; // TODO: GH#18217 >> Why is that assert defined? const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule); const sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { @@ -3484,6 +3496,9 @@ namespace ts { } else { const tsExtension = tryExtractTSExtension(moduleReference); + const isESMFile = currentSourceFile.impliedNodeFormat === ModuleKind.ESNext; + const isExtensionlessRelativePathImport = pathIsRelative(moduleReference) && !hasExtension(moduleReference); + const resolutionIsNode12OrHigher = getEmitModuleResolutionKind(compilerOptions) >= ModuleResolutionKind.Node12; if (tsExtension) { const diag = Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead; const importSourceWithoutExtension = removeExtension(moduleReference, tsExtension); @@ -3503,6 +3518,18 @@ namespace ts { hasJsonModuleEmitEnabled(compilerOptions)) { error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference); } + else if (isESMFile && resolutionIsNode12OrHigher && isExtensionlessRelativePathImport) { + const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path)); + const suggestedExt = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))?.[1]; + if (suggestedExt) { + error(errorNode, + Diagnostics.Cannot_use_a_relative_import_path_without_an_extension_in_an_ES_module_when_moduleResolution_is_node12_or_higher_Did_you_mean_0, + moduleReference + suggestedExt); + } + else { + error(errorNode, Diagnostics.Cannot_use_a_relative_import_path_without_an_extension_in_an_ES_module_when_moduleResolution_is_node12_or_higher); + } + } else { error(errorNode, moduleNotFoundError, moduleReference); } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index a40439d012afd..e47c66b4e2a89 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3341,6 +3341,14 @@ "category": "Error", "code": 2833 }, + "Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher.": { + "category": "Error", + "code": 2834 + }, + "Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean '{0}'?": { + "category": "Error", + "code": 2835 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/src/compiler/types.ts b/src/compiler/types.ts index a5b143e06f3bd..4c339b18fc495 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -5983,7 +5983,7 @@ namespace ts { export enum ModuleResolutionKind { Classic = 1, NodeJs = 2, - // Starting with node12, node's module resolver has significant departures from tranditional cjs resolution + // Starting with node12, node's module resolver has significant departures from traditional cjs resolution // to better support ecmascript modules and their use within node - more features are still being added, so // we can expect it to change over time, and as such, offer both a `NodeNext` moving resolution target, and a `Node12` // version-anchored resolution target diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtensions.errors.txt new file mode 100644 index 0000000000000..99c92c1d69502 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtensions.errors.txt @@ -0,0 +1,20 @@ +/src/bar.mts(1,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './foo.mjs'? +/src/bar.mts(2,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. + + +==== /src/foo.mts (0 errors) ==== + export function foo() { + return ""; + } + + // Extensionless relative import in an ES module +==== /src/bar.mts (2 errors) ==== + import { foo } from "./foo"; + ~~~~~~~ +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './foo.mjs'? + import { baz } from "./baz"; + ~~~~~~~ +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. + foo; + baz; + \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions.js b/tests/baselines/reference/moduleResolutionWithoutExtensions.js new file mode 100644 index 0000000000000..2b1af0acb0590 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtensions.js @@ -0,0 +1,25 @@ +//// [tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions.ts] //// + +//// [foo.mts] +export function foo() { + return ""; +} + +// Extensionless relative import in an ES module +//// [bar.mts] +import { foo } from "./foo"; +import { baz } from "./baz"; +foo; +baz; + + +//// [foo.mjs] +export function foo() { + return ""; +} +// Extensionless relative import in an ES module +//// [bar.mjs] +import { foo } from "./foo"; +import { baz } from "./baz"; +foo; +baz; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions.symbols b/tests/baselines/reference/moduleResolutionWithoutExtensions.symbols new file mode 100644 index 0000000000000..cc8484faac4b5 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtensions.symbols @@ -0,0 +1,21 @@ +=== /src/foo.mts === +export function foo() { +>foo : Symbol(foo, Decl(foo.mts, 0, 0)) + + return ""; +} + +// Extensionless relative import in an ES module +=== /src/bar.mts === +import { foo } from "./foo"; +>foo : Symbol(foo, Decl(bar.mts, 0, 8)) + +import { baz } from "./baz"; +>baz : Symbol(baz, Decl(bar.mts, 1, 8)) + +foo; +>foo : Symbol(foo, Decl(bar.mts, 0, 8)) + +baz; +>baz : Symbol(baz, Decl(bar.mts, 1, 8)) + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions.types b/tests/baselines/reference/moduleResolutionWithoutExtensions.types new file mode 100644 index 0000000000000..b556029f8dc67 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtensions.types @@ -0,0 +1,22 @@ +=== /src/foo.mts === +export function foo() { +>foo : () => string + + return ""; +>"" : "" +} + +// Extensionless relative import in an ES module +=== /src/bar.mts === +import { foo } from "./foo"; +>foo : any + +import { baz } from "./baz"; +>baz : any + +foo; +>foo : any + +baz; +>baz : any + diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions.ts new file mode 100644 index 0000000000000..ca94365da24ca --- /dev/null +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions.ts @@ -0,0 +1,14 @@ +// @moduleResolution: node12 +// @module: node12 + +// @filename: /src/foo.mts +export function foo() { + return ""; +} + +// Extensionless relative import in an ES module +// @Filename: /src/bar.mts +import { foo } from "./foo"; +import { baz } from "./baz"; +foo; +baz; From ffcaf6610cddfff128655002b26d3d4b75143d42 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Fri, 22 Oct 2021 12:53:14 -0700 Subject: [PATCH 02/10] push down assert defined --- src/compiler/checker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1568b4aa16348..5dfd4734146c3 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3429,7 +3429,7 @@ namespace ts { (isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : undefined)?.name || (isLiteralImportTypeNode(location) ? location : undefined)?.argument.literal; const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat; - const resolvedModule = getResolvedModule(currentSourceFile, moduleReference, mode)!; // TODO: GH#18217 >> Why is that assert defined? + const resolvedModule = getResolvedModule(currentSourceFile, moduleReference, mode); // TODO: GH#18217 const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule); const sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { @@ -3472,10 +3472,10 @@ namespace ts { if (resolvedModule && !resolutionExtensionIsTSOrJson(resolvedModule.extension) && resolutionDiagnostic === undefined || resolutionDiagnostic === Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type) { if (isForAugmentation) { const diag = Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; - error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); + error(errorNode, diag, moduleReference, resolvedModule!.resolvedFileName); // TODO: GH#18217 } else { - errorOnImplicitAnyModule(/*isError*/ noImplicitAny && !!moduleNotFoundError, errorNode, resolvedModule, moduleReference); + errorOnImplicitAnyModule(/*isError*/ noImplicitAny && !!moduleNotFoundError, errorNode, resolvedModule!, moduleReference); // TODO: GH#18217 } // Failed imports and untyped modules are both treated in an untyped manner; only difference is whether we give a diagnostic first. return undefined; From 9c9899ceb516dc65d91813c97431597e5d529462 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Fri, 22 Oct 2021 12:54:02 -0700 Subject: [PATCH 03/10] remove comment --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5dfd4734146c3..08193740ff941 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3429,7 +3429,7 @@ namespace ts { (isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : undefined)?.name || (isLiteralImportTypeNode(location) ? location : undefined)?.argument.literal; const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat; - const resolvedModule = getResolvedModule(currentSourceFile, moduleReference, mode); // TODO: GH#18217 + const resolvedModule = getResolvedModule(currentSourceFile, moduleReference, mode); const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule); const sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { From 7166cbee23e5abd8b1203ea7698a9082e15142d3 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Fri, 22 Oct 2021 14:58:47 -0700 Subject: [PATCH 04/10] fix esm module import detection, update baselines --- src/compiler/checker.ts | 3 +- ...eModulesAllowJs1(module=node12).errors.txt | 200 +++++++++--------- ...odulesAllowJs1(module=nodenext).errors.txt | 200 +++++++++--------- 3 files changed, 201 insertions(+), 202 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 08193740ff941..ee2f5f6095662 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3496,7 +3496,6 @@ namespace ts { } else { const tsExtension = tryExtractTSExtension(moduleReference); - const isESMFile = currentSourceFile.impliedNodeFormat === ModuleKind.ESNext; const isExtensionlessRelativePathImport = pathIsRelative(moduleReference) && !hasExtension(moduleReference); const resolutionIsNode12OrHigher = getEmitModuleResolutionKind(compilerOptions) >= ModuleResolutionKind.Node12; if (tsExtension) { @@ -3518,7 +3517,7 @@ namespace ts { hasJsonModuleEmitEnabled(compilerOptions)) { error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference); } - else if (isESMFile && resolutionIsNode12OrHigher && isExtensionlessRelativePathImport) { + else if (mode === ModuleKind.ESNext && resolutionIsNode12OrHigher && isExtensionlessRelativePathImport) { const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path)); const suggestedExt = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))?.[1]; if (suggestedExt) { diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt index 099485a317c49..a7d49dcd73691 100644 --- a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt @@ -26,27 +26,27 @@ tests/cases/conformance/node/allowJs/index.cjs(60,22): error TS1471: Module './s tests/cases/conformance/node/allowJs/index.cjs(61,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.cjs(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.js(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(15,22): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(16,22): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(17,22): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(18,22): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(19,22): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(20,22): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(21,22): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(22,22): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(23,22): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(24,22): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/allowJs/index.js(15,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(16,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(17,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(18,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(19,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(20,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(21,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(22,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(23,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(24,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.js(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -64,27 +64,27 @@ tests/cases/conformance/node/allowJs/index.js(59,22): error TS1471: Module './su tests/cases/conformance/node/allowJs/index.js(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(75,21): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(76,21): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(77,21): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(78,21): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(79,21): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(80,21): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(81,21): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(82,21): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(83,21): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(84,21): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/allowJs/index.js(75,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(76,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(77,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(78,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(79,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(80,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(81,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(82,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(83,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(84,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.mjs(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.mjs(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.mjs(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.mjs(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -102,16 +102,16 @@ tests/cases/conformance/node/allowJs/index.mjs(59,22): error TS1471: Module './s tests/cases/conformance/node/allowJs/index.mjs(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.mjs(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.mjs(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? ==== tests/cases/conformance/node/allowJs/subfolder/index.js (0 errors) ==== @@ -169,34 +169,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2307: Cannot find !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -283,34 +283,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2307: Cannot find !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; export {x}; @@ -448,34 +448,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2307: Cannot find !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? // cjs format file const x = 1; export {x}; @@ -498,34 +498,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2307: Cannot find !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -612,34 +612,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2307: Cannot find !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt index 099485a317c49..a7d49dcd73691 100644 --- a/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt @@ -26,27 +26,27 @@ tests/cases/conformance/node/allowJs/index.cjs(60,22): error TS1471: Module './s tests/cases/conformance/node/allowJs/index.cjs(61,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.cjs(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.js(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(15,22): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(16,22): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(17,22): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(18,22): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(19,22): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(20,22): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(21,22): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(22,22): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(23,22): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(24,22): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/allowJs/index.js(15,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(16,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(17,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(18,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(19,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(20,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(21,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(22,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(23,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(24,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.js(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -64,27 +64,27 @@ tests/cases/conformance/node/allowJs/index.js(59,22): error TS1471: Module './su tests/cases/conformance/node/allowJs/index.js(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(75,21): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(76,21): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(77,21): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(78,21): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(79,21): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(80,21): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(81,21): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(82,21): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(83,21): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(84,21): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/allowJs/index.js(75,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(76,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(77,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(78,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(79,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(80,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(81,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(82,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(83,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.js(84,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.mjs(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.mjs(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.mjs(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.mjs(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -102,16 +102,16 @@ tests/cases/conformance/node/allowJs/index.mjs(59,22): error TS1471: Module './s tests/cases/conformance/node/allowJs/index.mjs(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.mjs(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.mjs(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? ==== tests/cases/conformance/node/allowJs/subfolder/index.js (0 errors) ==== @@ -169,34 +169,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2307: Cannot find !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -283,34 +283,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2307: Cannot find !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; export {x}; @@ -448,34 +448,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2307: Cannot find !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? // cjs format file const x = 1; export {x}; @@ -498,34 +498,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2307: Cannot find !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -612,34 +612,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2307: Cannot find !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; From 998dbb1f7314a1eab37a848ce6aeb91c0eba2ebf Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Fri, 22 Oct 2021 15:10:53 -0700 Subject: [PATCH 05/10] add and update new tests --- .../moduleResolutionWithoutExtensions.errors.txt | 10 +++++----- .../reference/moduleResolutionWithoutExtensions.js | 14 +++++++------- .../moduleResolutionWithoutExtensions.symbols | 14 +++++++------- .../moduleResolutionWithoutExtensions.types | 6 +++--- .../moduleResolutionWithoutExtensions2.errors.txt | 9 +++++++++ .../moduleResolutionWithoutExtensions2.js | 11 +++++++++++ .../moduleResolutionWithoutExtensions2.symbols | 8 ++++++++ .../moduleResolutionWithoutExtensions2.types | 8 ++++++++ .../moduleResolutionWithoutExtensions.ts | 8 ++++---- .../moduleResolutionWithoutExtensions2.ts | 7 +++++++ 10 files changed, 69 insertions(+), 26 deletions(-) create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions2.errors.txt create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions2.js create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions2.symbols create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions2.types create mode 100644 tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions2.ts diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtensions.errors.txt index 99c92c1d69502..2e82dd16dabee 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtensions.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtensions.errors.txt @@ -1,5 +1,5 @@ -/src/bar.mts(1,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './foo.mjs'? -/src/bar.mts(2,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +/src/bar.mts(2,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './foo.mjs'? +/src/bar.mts(3,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. ==== /src/foo.mts (0 errors) ==== @@ -7,12 +7,12 @@ return ""; } - // Extensionless relative import in an ES module ==== /src/bar.mts (2 errors) ==== - import { foo } from "./foo"; + // Extensionless relative path ES import in an ES module + import { foo } from "./foo"; // should error ~~~~~~~ !!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './foo.mjs'? - import { baz } from "./baz"; + import { baz } from "./baz"; // should also error ~~~~~~~ !!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. foo; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions.js b/tests/baselines/reference/moduleResolutionWithoutExtensions.js index 2b1af0acb0590..79989b49e2998 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtensions.js +++ b/tests/baselines/reference/moduleResolutionWithoutExtensions.js @@ -4,11 +4,11 @@ export function foo() { return ""; } - -// Extensionless relative import in an ES module + //// [bar.mts] -import { foo } from "./foo"; -import { baz } from "./baz"; +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error +import { baz } from "./baz"; // should also error foo; baz; @@ -17,9 +17,9 @@ baz; export function foo() { return ""; } -// Extensionless relative import in an ES module //// [bar.mjs] -import { foo } from "./foo"; -import { baz } from "./baz"; +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error +import { baz } from "./baz"; // should also error foo; baz; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions.symbols b/tests/baselines/reference/moduleResolutionWithoutExtensions.symbols index cc8484faac4b5..09798d9f6fa84 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtensions.symbols +++ b/tests/baselines/reference/moduleResolutionWithoutExtensions.symbols @@ -5,17 +5,17 @@ export function foo() { return ""; } -// Extensionless relative import in an ES module === /src/bar.mts === -import { foo } from "./foo"; ->foo : Symbol(foo, Decl(bar.mts, 0, 8)) +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error +>foo : Symbol(foo, Decl(bar.mts, 1, 8)) -import { baz } from "./baz"; ->baz : Symbol(baz, Decl(bar.mts, 1, 8)) +import { baz } from "./baz"; // should also error +>baz : Symbol(baz, Decl(bar.mts, 2, 8)) foo; ->foo : Symbol(foo, Decl(bar.mts, 0, 8)) +>foo : Symbol(foo, Decl(bar.mts, 1, 8)) baz; ->baz : Symbol(baz, Decl(bar.mts, 1, 8)) +>baz : Symbol(baz, Decl(bar.mts, 2, 8)) diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions.types b/tests/baselines/reference/moduleResolutionWithoutExtensions.types index b556029f8dc67..a9ae2ed558ee8 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtensions.types +++ b/tests/baselines/reference/moduleResolutionWithoutExtensions.types @@ -6,12 +6,12 @@ export function foo() { >"" : "" } -// Extensionless relative import in an ES module === /src/bar.mts === -import { foo } from "./foo"; +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error >foo : any -import { baz } from "./baz"; +import { baz } from "./baz"; // should also error >baz : any foo; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions2.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtensions2.errors.txt new file mode 100644 index 0000000000000..107994ce0c321 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtensions2.errors.txt @@ -0,0 +1,9 @@ +/src/buzz.mts(2,22): error TS2307: Cannot find module './foo' or its corresponding type declarations. + + +==== /src/buzz.mts (1 errors) ==== + // Extensionless relative path cjs import in an ES module + import foo = require("./foo"); + ~~~~~~~ +!!! error TS2307: Cannot find module './foo' or its corresponding type declarations. + foo; \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions2.js b/tests/baselines/reference/moduleResolutionWithoutExtensions2.js new file mode 100644 index 0000000000000..dac7ab5f23660 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtensions2.js @@ -0,0 +1,11 @@ +//// [buzz.mts] +// Extensionless relative path cjs import in an ES module +import foo = require("./foo"); +foo; + +//// [buzz.mjs] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +// Extensionless relative path cjs import in an ES module +const foo = __require("./foo"); +foo; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions2.symbols b/tests/baselines/reference/moduleResolutionWithoutExtensions2.symbols new file mode 100644 index 0000000000000..e1effe939154b --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtensions2.symbols @@ -0,0 +1,8 @@ +=== /src/buzz.mts === +// Extensionless relative path cjs import in an ES module +import foo = require("./foo"); +>foo : Symbol(foo, Decl(buzz.mts, 0, 0)) + +foo; +>foo : Symbol(foo, Decl(buzz.mts, 0, 0)) + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions2.types b/tests/baselines/reference/moduleResolutionWithoutExtensions2.types new file mode 100644 index 0000000000000..2d39a2128a2bf --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtensions2.types @@ -0,0 +1,8 @@ +=== /src/buzz.mts === +// Extensionless relative path cjs import in an ES module +import foo = require("./foo"); +>foo : any + +foo; +>foo : any + diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions.ts index ca94365da24ca..172d6460c735e 100644 --- a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions.ts +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions.ts @@ -6,9 +6,9 @@ export function foo() { return ""; } -// Extensionless relative import in an ES module -// @Filename: /src/bar.mts -import { foo } from "./foo"; -import { baz } from "./baz"; +// @filename: /src/bar.mts +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error +import { baz } from "./baz"; // should also error foo; baz; diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions2.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions2.ts new file mode 100644 index 0000000000000..c9425839baea3 --- /dev/null +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions2.ts @@ -0,0 +1,7 @@ +// @moduleResolution: node12 +// @module: node12 + +// @filename: /src/buzz.mts +// Extensionless relative path cjs import in an ES module +import foo = require("./foo"); +foo; \ No newline at end of file From e8a1b7f3a57aeb8dffdc82cb71331590444bdea3 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Mon, 25 Oct 2021 12:31:05 -0700 Subject: [PATCH 06/10] fix review comments --- src/compiler/checker.ts | 22 +- src/compiler/diagnosticMessages.json | 4 +- ...duleResolutionWithoutExtension1.errors.txt | 20 ++ .../moduleResolutionWithoutExtension1.js | 25 +++ .../moduleResolutionWithoutExtension1.symbols | 21 ++ .../moduleResolutionWithoutExtension1.types | 22 ++ ...duleResolutionWithoutExtension2.errors.txt | 9 + .../moduleResolutionWithoutExtension2.js | 11 + .../moduleResolutionWithoutExtension2.symbols | 8 + .../moduleResolutionWithoutExtension2.types | 8 + ...duleResolutionWithoutExtension3.errors.txt | 15 ++ .../moduleResolutionWithoutExtension3.js | 25 +++ .../moduleResolutionWithoutExtension3.symbols | 15 ++ .../moduleResolutionWithoutExtension3.types | 16 ++ ...duleResolutionWithoutExtension4.errors.txt | 15 ++ .../moduleResolutionWithoutExtension4.js | 25 +++ .../moduleResolutionWithoutExtension4.symbols | 15 ++ .../moduleResolutionWithoutExtension4.types | 16 ++ ...eModulesAllowJs1(module=node12).errors.txt | 200 +++++++++--------- ...odulesAllowJs1(module=nodenext).errors.txt | 200 +++++++++--------- ...s => moduleResolutionWithoutExtension1.ts} | 4 +- ...s => moduleResolutionWithoutExtension2.ts} | 2 +- .../moduleResolutionWithoutExtension3.ts | 13 ++ .../moduleResolutionWithoutExtension4.ts | 13 ++ 24 files changed, 511 insertions(+), 213 deletions(-) create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension1.js create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension1.symbols create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension1.types create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension2.errors.txt create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension2.js create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension2.symbols create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension2.types create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension3.js create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension3.symbols create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension3.types create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension4.js create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension4.symbols create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension4.types rename tests/cases/conformance/externalModules/{moduleResolutionWithoutExtensions.ts => moduleResolutionWithoutExtension1.ts} (57%) rename tests/cases/conformance/externalModules/{moduleResolutionWithoutExtensions2.ts => moduleResolutionWithoutExtension2.ts} (72%) create mode 100644 tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts create mode 100644 tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ee2f5f6095662..a98c3d44f5f2e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1025,7 +1025,11 @@ namespace ts { [".cts", ".cjs"], [".mjs", ".mjs"], [".js", ".js"], - [".cjs", ".cjs"]]; + [".cjs", ".cjs"], + [".tsx", compilerOptions.jsx === JsxEmit.Preserve ? ".jsx" : ".js"], + [".jsx", ".jsx"], + [".json", ".json"], + ]; initializeTypeChecker(); @@ -3472,10 +3476,10 @@ namespace ts { if (resolvedModule && !resolutionExtensionIsTSOrJson(resolvedModule.extension) && resolutionDiagnostic === undefined || resolutionDiagnostic === Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type) { if (isForAugmentation) { const diag = Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; - error(errorNode, diag, moduleReference, resolvedModule!.resolvedFileName); // TODO: GH#18217 + error(errorNode, diag, moduleReference, resolvedModule!.resolvedFileName); } else { - errorOnImplicitAnyModule(/*isError*/ noImplicitAny && !!moduleNotFoundError, errorNode, resolvedModule!, moduleReference); // TODO: GH#18217 + errorOnImplicitAnyModule(/*isError*/ noImplicitAny && !!moduleNotFoundError, errorNode, resolvedModule!, moduleReference); } // Failed imports and untyped modules are both treated in an untyped manner; only difference is whether we give a diagnostic first. return undefined; @@ -3497,7 +3501,9 @@ namespace ts { else { const tsExtension = tryExtractTSExtension(moduleReference); const isExtensionlessRelativePathImport = pathIsRelative(moduleReference) && !hasExtension(moduleReference); - const resolutionIsNode12OrHigher = getEmitModuleResolutionKind(compilerOptions) >= ModuleResolutionKind.Node12; + const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions); + const resolutionIsNode12OrNext = moduleResolutionKind === ModuleResolutionKind.Node12 || + moduleResolutionKind === ModuleResolutionKind.NodeNext; if (tsExtension) { const diag = Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead; const importSourceWithoutExtension = removeExtension(moduleReference, tsExtension); @@ -3517,16 +3523,16 @@ namespace ts { hasJsonModuleEmitEnabled(compilerOptions)) { error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference); } - else if (mode === ModuleKind.ESNext && resolutionIsNode12OrHigher && isExtensionlessRelativePathImport) { - const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path)); + else if (mode === ModuleKind.ESNext && resolutionIsNode12OrNext && isExtensionlessRelativePathImport) { + const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path)); const suggestedExt = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))?.[1]; if (suggestedExt) { error(errorNode, - Diagnostics.Cannot_use_a_relative_import_path_without_an_extension_in_an_ES_module_when_moduleResolution_is_node12_or_higher_Did_you_mean_0, + Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ES_modules_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt); } else { - error(errorNode, Diagnostics.Cannot_use_a_relative_import_path_without_an_extension_in_an_ES_module_when_moduleResolution_is_node12_or_higher); + error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ES_modules_when_moduleResolution_is_node12_or_nodenext); } } else { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e47c66b4e2a89..b8d436bf5bdd3 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3341,11 +3341,11 @@ "category": "Error", "code": 2833 }, - "Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher.": { + "Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'.": { "category": "Error", "code": 2834 }, - "Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean '{0}'?": { + "Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean '{0}'?": { "category": "Error", "code": 2835 }, diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt new file mode 100644 index 0000000000000..1c7001370a8b5 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt @@ -0,0 +1,20 @@ +/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.mjs'? +/src/bar.mts(3,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. + + +==== /src/foo.mts (0 errors) ==== + export function foo() { + return ""; + } + +==== /src/bar.mts (2 errors) ==== + // Extensionless relative path ES import in an ES module + import { foo } from "./foo"; // should error, suggest adding ".mjs" + ~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.mjs'? + import { baz } from "./baz"; // should also error, no extension suggestion + ~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. + foo; + baz; + \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension1.js b/tests/baselines/reference/moduleResolutionWithoutExtension1.js new file mode 100644 index 0000000000000..0b1eaf08de8f5 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension1.js @@ -0,0 +1,25 @@ +//// [tests/cases/conformance/externalModules/moduleResolutionWithoutExtension1.ts] //// + +//// [foo.mts] +export function foo() { + return ""; +} + +//// [bar.mts] +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error, suggest adding ".mjs" +import { baz } from "./baz"; // should also error, no extension suggestion +foo; +baz; + + +//// [foo.mjs] +export function foo() { + return ""; +} +//// [bar.mjs] +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error, suggest adding ".mjs" +import { baz } from "./baz"; // should also error, no extension suggestion +foo; +baz; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension1.symbols b/tests/baselines/reference/moduleResolutionWithoutExtension1.symbols new file mode 100644 index 0000000000000..267cbbfd4ab7a --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension1.symbols @@ -0,0 +1,21 @@ +=== /src/foo.mts === +export function foo() { +>foo : Symbol(foo, Decl(foo.mts, 0, 0)) + + return ""; +} + +=== /src/bar.mts === +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error, suggest adding ".mjs" +>foo : Symbol(foo, Decl(bar.mts, 1, 8)) + +import { baz } from "./baz"; // should also error, no extension suggestion +>baz : Symbol(baz, Decl(bar.mts, 2, 8)) + +foo; +>foo : Symbol(foo, Decl(bar.mts, 1, 8)) + +baz; +>baz : Symbol(baz, Decl(bar.mts, 2, 8)) + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension1.types b/tests/baselines/reference/moduleResolutionWithoutExtension1.types new file mode 100644 index 0000000000000..31768d495a66f --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension1.types @@ -0,0 +1,22 @@ +=== /src/foo.mts === +export function foo() { +>foo : () => string + + return ""; +>"" : "" +} + +=== /src/bar.mts === +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error, suggest adding ".mjs" +>foo : any + +import { baz } from "./baz"; // should also error, no extension suggestion +>baz : any + +foo; +>foo : any + +baz; +>baz : any + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension2.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension2.errors.txt new file mode 100644 index 0000000000000..04dbb159f4408 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension2.errors.txt @@ -0,0 +1,9 @@ +/src/buzz.mts(2,22): error TS2307: Cannot find module './foo' or its corresponding type declarations. + + +==== /src/buzz.mts (1 errors) ==== + // Extensionless relative path cjs import in an ES module + import foo = require("./foo"); // should error + ~~~~~~~ +!!! error TS2307: Cannot find module './foo' or its corresponding type declarations. + foo; \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension2.js b/tests/baselines/reference/moduleResolutionWithoutExtension2.js new file mode 100644 index 0000000000000..054a4c7d3c4a2 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension2.js @@ -0,0 +1,11 @@ +//// [buzz.mts] +// Extensionless relative path cjs import in an ES module +import foo = require("./foo"); // should error +foo; + +//// [buzz.mjs] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +// Extensionless relative path cjs import in an ES module +const foo = __require("./foo"); // should error +foo; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension2.symbols b/tests/baselines/reference/moduleResolutionWithoutExtension2.symbols new file mode 100644 index 0000000000000..6116acfe066dd --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension2.symbols @@ -0,0 +1,8 @@ +=== /src/buzz.mts === +// Extensionless relative path cjs import in an ES module +import foo = require("./foo"); // should error +>foo : Symbol(foo, Decl(buzz.mts, 0, 0)) + +foo; +>foo : Symbol(foo, Decl(buzz.mts, 0, 0)) + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension2.types b/tests/baselines/reference/moduleResolutionWithoutExtension2.types new file mode 100644 index 0000000000000..eba8d6aacf1f6 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension2.types @@ -0,0 +1,8 @@ +=== /src/buzz.mts === +// Extensionless relative path cjs import in an ES module +import foo = require("./foo"); // should error +>foo : any + +foo; +>foo : any + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt new file mode 100644 index 0000000000000..09a1053d5aa9c --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt @@ -0,0 +1,15 @@ +/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.jsx'? + + +==== /src/foo.tsx (0 errors) ==== + export function foo() { + return ""; + } + +==== /src/bar.mts (1 errors) ==== + // Extensionless relative path ES import in an ES module + import { foo } from "./foo"; // should error, suggest adding ".jsx" + ~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.jsx'? + foo; + \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension3.js b/tests/baselines/reference/moduleResolutionWithoutExtension3.js new file mode 100644 index 0000000000000..4f495b9e50409 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension3.js @@ -0,0 +1,25 @@ +//// [tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts] //// + +//// [foo.tsx] +export function foo() { + return ""; +} + +//// [bar.mts] +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error, suggest adding ".jsx" +foo; + + +//// [foo.jsx] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = void 0; +function foo() { + return ""; +} +exports.foo = foo; +//// [bar.mjs] +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error, suggest adding ".jsx" +foo; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension3.symbols b/tests/baselines/reference/moduleResolutionWithoutExtension3.symbols new file mode 100644 index 0000000000000..731a3a799fb6b --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension3.symbols @@ -0,0 +1,15 @@ +=== /src/foo.tsx === +export function foo() { +>foo : Symbol(foo, Decl(foo.tsx, 0, 0)) + + return ""; +} + +=== /src/bar.mts === +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error, suggest adding ".jsx" +>foo : Symbol(foo, Decl(bar.mts, 1, 8)) + +foo; +>foo : Symbol(foo, Decl(bar.mts, 1, 8)) + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension3.types b/tests/baselines/reference/moduleResolutionWithoutExtension3.types new file mode 100644 index 0000000000000..1ec9b3754e818 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension3.types @@ -0,0 +1,16 @@ +=== /src/foo.tsx === +export function foo() { +>foo : () => string + + return ""; +>"" : "" +} + +=== /src/bar.mts === +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error, suggest adding ".jsx" +>foo : any + +foo; +>foo : any + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt new file mode 100644 index 0000000000000..05e14cd528253 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt @@ -0,0 +1,15 @@ +/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.js'? + + +==== /src/foo.tsx (0 errors) ==== + export function foo() { + return ""; + } + +==== /src/bar.mts (1 errors) ==== + // Extensionless relative path ES import in an ES module + import { foo } from "./foo"; // should error, suggest adding ".js" + ~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.js'? + foo; + \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension4.js b/tests/baselines/reference/moduleResolutionWithoutExtension4.js new file mode 100644 index 0000000000000..cce16de68a0f6 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension4.js @@ -0,0 +1,25 @@ +//// [tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts] //// + +//// [foo.tsx] +export function foo() { + return ""; +} + +//// [bar.mts] +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error, suggest adding ".js" +foo; + + +//// [foo.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = void 0; +function foo() { + return ""; +} +exports.foo = foo; +//// [bar.mjs] +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error, suggest adding ".js" +foo; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension4.symbols b/tests/baselines/reference/moduleResolutionWithoutExtension4.symbols new file mode 100644 index 0000000000000..f04216ec6120b --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension4.symbols @@ -0,0 +1,15 @@ +=== /src/foo.tsx === +export function foo() { +>foo : Symbol(foo, Decl(foo.tsx, 0, 0)) + + return ""; +} + +=== /src/bar.mts === +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error, suggest adding ".js" +>foo : Symbol(foo, Decl(bar.mts, 1, 8)) + +foo; +>foo : Symbol(foo, Decl(bar.mts, 1, 8)) + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension4.types b/tests/baselines/reference/moduleResolutionWithoutExtension4.types new file mode 100644 index 0000000000000..be9eed2321bb1 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension4.types @@ -0,0 +1,16 @@ +=== /src/foo.tsx === +export function foo() { +>foo : () => string + + return ""; +>"" : "" +} + +=== /src/bar.mts === +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error, suggest adding ".js" +>foo : any + +foo; +>foo : any + diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt index a7d49dcd73691..90cdb44b00031 100644 --- a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt @@ -26,27 +26,27 @@ tests/cases/conformance/node/allowJs/index.cjs(60,22): error TS1471: Module './s tests/cases/conformance/node/allowJs/index.cjs(61,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.cjs(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.js(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(15,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.js(16,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(17,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(18,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(19,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(20,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(21,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(22,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(23,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(24,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.js(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -64,27 +64,27 @@ tests/cases/conformance/node/allowJs/index.js(59,22): error TS1471: Module './su tests/cases/conformance/node/allowJs/index.js(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(75,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.js(76,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(77,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(78,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(79,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(80,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(81,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(82,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(83,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(84,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.mjs(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.mjs(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.mjs(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.mjs(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -102,16 +102,16 @@ tests/cases/conformance/node/allowJs/index.mjs(59,22): error TS1471: Module './s tests/cases/conformance/node/allowJs/index.mjs(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.mjs(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.mjs(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? ==== tests/cases/conformance/node/allowJs/subfolder/index.js (0 errors) ==== @@ -169,34 +169,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Cannot use !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -283,34 +283,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Cannot use !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; export {x}; @@ -448,34 +448,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Cannot use !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // cjs format file const x = 1; export {x}; @@ -498,34 +498,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Cannot use !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -612,34 +612,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Cannot use !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt index a7d49dcd73691..90cdb44b00031 100644 --- a/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt @@ -26,27 +26,27 @@ tests/cases/conformance/node/allowJs/index.cjs(60,22): error TS1471: Module './s tests/cases/conformance/node/allowJs/index.cjs(61,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.cjs(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.js(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(15,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.js(16,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(17,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(18,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(19,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(20,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(21,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(22,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(23,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(24,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.js(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -64,27 +64,27 @@ tests/cases/conformance/node/allowJs/index.js(59,22): error TS1471: Module './su tests/cases/conformance/node/allowJs/index.js(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(75,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.js(76,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(77,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(78,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(79,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(80,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(81,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(82,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(83,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.js(84,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.js(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.mjs(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.mjs(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.mjs(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.mjs(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -102,16 +102,16 @@ tests/cases/conformance/node/allowJs/index.mjs(59,22): error TS1471: Module './s tests/cases/conformance/node/allowJs/index.mjs(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.mjs(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.mjs(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. -tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? ==== tests/cases/conformance/node/allowJs/subfolder/index.js (0 errors) ==== @@ -169,34 +169,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Cannot use !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -283,34 +283,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Cannot use !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; export {x}; @@ -448,34 +448,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Cannot use !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // cjs format file const x = 1; export {x}; @@ -498,34 +498,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Cannot use !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -612,34 +612,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Cannot use !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension1.ts similarity index 57% rename from tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions.ts rename to tests/cases/conformance/externalModules/moduleResolutionWithoutExtension1.ts index 172d6460c735e..d75ec2f6b0cfe 100644 --- a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions.ts +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension1.ts @@ -8,7 +8,7 @@ export function foo() { // @filename: /src/bar.mts // Extensionless relative path ES import in an ES module -import { foo } from "./foo"; // should error -import { baz } from "./baz"; // should also error +import { foo } from "./foo"; // should error, suggest adding ".mjs" +import { baz } from "./baz"; // should also error, no extension suggestion foo; baz; diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions2.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension2.ts similarity index 72% rename from tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions2.ts rename to tests/cases/conformance/externalModules/moduleResolutionWithoutExtension2.ts index c9425839baea3..171053ce6b25f 100644 --- a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions2.ts +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension2.ts @@ -3,5 +3,5 @@ // @filename: /src/buzz.mts // Extensionless relative path cjs import in an ES module -import foo = require("./foo"); +import foo = require("./foo"); // should error foo; \ No newline at end of file diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts new file mode 100644 index 0000000000000..70ced17af50c4 --- /dev/null +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts @@ -0,0 +1,13 @@ +// @moduleResolution: nodenext +// @module: nodenext +// @jsx: preserve + +// @filename: /src/foo.tsx +export function foo() { + return ""; +} + +// @filename: /src/bar.mts +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error, suggest adding ".jsx" +foo; diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts new file mode 100644 index 0000000000000..8f8482ed0d47f --- /dev/null +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts @@ -0,0 +1,13 @@ +// @moduleResolution: nodenext +// @module: nodenext +// @jsx: react + +// @filename: /src/foo.tsx +export function foo() { + return ""; +} + +// @filename: /src/bar.mts +// Extensionless relative path ES import in an ES module +import { foo } from "./foo"; // should error, suggest adding ".js" +foo; From 4e4a168d7e9aec5c8a57240426e1875856729128 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Mon, 25 Oct 2021 12:36:50 -0700 Subject: [PATCH 07/10] remove renamed baseline references --- ...duleResolutionWithoutExtensions.errors.txt | 20 --------------- .../moduleResolutionWithoutExtensions.js | 25 ------------------- .../moduleResolutionWithoutExtensions.symbols | 21 ---------------- .../moduleResolutionWithoutExtensions.types | 22 ---------------- ...uleResolutionWithoutExtensions2.errors.txt | 9 ------- .../moduleResolutionWithoutExtensions2.js | 11 -------- ...moduleResolutionWithoutExtensions2.symbols | 8 ------ .../moduleResolutionWithoutExtensions2.types | 8 ------ 8 files changed, 124 deletions(-) delete mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions.errors.txt delete mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions.js delete mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions.symbols delete mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions.types delete mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions2.errors.txt delete mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions2.js delete mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions2.symbols delete mode 100644 tests/baselines/reference/moduleResolutionWithoutExtensions2.types diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtensions.errors.txt deleted file mode 100644 index 2e82dd16dabee..0000000000000 --- a/tests/baselines/reference/moduleResolutionWithoutExtensions.errors.txt +++ /dev/null @@ -1,20 +0,0 @@ -/src/bar.mts(2,21): error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './foo.mjs'? -/src/bar.mts(3,21): error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. - - -==== /src/foo.mts (0 errors) ==== - export function foo() { - return ""; - } - -==== /src/bar.mts (2 errors) ==== - // Extensionless relative path ES import in an ES module - import { foo } from "./foo"; // should error - ~~~~~~~ -!!! error TS2835: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. Did you mean './foo.mjs'? - import { baz } from "./baz"; // should also error - ~~~~~~~ -!!! error TS2834: Cannot use a relative import path without an extension in an ES module when '--moduleResolution' is 'node12' or higher. - foo; - baz; - \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions.js b/tests/baselines/reference/moduleResolutionWithoutExtensions.js deleted file mode 100644 index 79989b49e2998..0000000000000 --- a/tests/baselines/reference/moduleResolutionWithoutExtensions.js +++ /dev/null @@ -1,25 +0,0 @@ -//// [tests/cases/conformance/externalModules/moduleResolutionWithoutExtensions.ts] //// - -//// [foo.mts] -export function foo() { - return ""; -} - -//// [bar.mts] -// Extensionless relative path ES import in an ES module -import { foo } from "./foo"; // should error -import { baz } from "./baz"; // should also error -foo; -baz; - - -//// [foo.mjs] -export function foo() { - return ""; -} -//// [bar.mjs] -// Extensionless relative path ES import in an ES module -import { foo } from "./foo"; // should error -import { baz } from "./baz"; // should also error -foo; -baz; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions.symbols b/tests/baselines/reference/moduleResolutionWithoutExtensions.symbols deleted file mode 100644 index 09798d9f6fa84..0000000000000 --- a/tests/baselines/reference/moduleResolutionWithoutExtensions.symbols +++ /dev/null @@ -1,21 +0,0 @@ -=== /src/foo.mts === -export function foo() { ->foo : Symbol(foo, Decl(foo.mts, 0, 0)) - - return ""; -} - -=== /src/bar.mts === -// Extensionless relative path ES import in an ES module -import { foo } from "./foo"; // should error ->foo : Symbol(foo, Decl(bar.mts, 1, 8)) - -import { baz } from "./baz"; // should also error ->baz : Symbol(baz, Decl(bar.mts, 2, 8)) - -foo; ->foo : Symbol(foo, Decl(bar.mts, 1, 8)) - -baz; ->baz : Symbol(baz, Decl(bar.mts, 2, 8)) - diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions.types b/tests/baselines/reference/moduleResolutionWithoutExtensions.types deleted file mode 100644 index a9ae2ed558ee8..0000000000000 --- a/tests/baselines/reference/moduleResolutionWithoutExtensions.types +++ /dev/null @@ -1,22 +0,0 @@ -=== /src/foo.mts === -export function foo() { ->foo : () => string - - return ""; ->"" : "" -} - -=== /src/bar.mts === -// Extensionless relative path ES import in an ES module -import { foo } from "./foo"; // should error ->foo : any - -import { baz } from "./baz"; // should also error ->baz : any - -foo; ->foo : any - -baz; ->baz : any - diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions2.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtensions2.errors.txt deleted file mode 100644 index 107994ce0c321..0000000000000 --- a/tests/baselines/reference/moduleResolutionWithoutExtensions2.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -/src/buzz.mts(2,22): error TS2307: Cannot find module './foo' or its corresponding type declarations. - - -==== /src/buzz.mts (1 errors) ==== - // Extensionless relative path cjs import in an ES module - import foo = require("./foo"); - ~~~~~~~ -!!! error TS2307: Cannot find module './foo' or its corresponding type declarations. - foo; \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions2.js b/tests/baselines/reference/moduleResolutionWithoutExtensions2.js deleted file mode 100644 index dac7ab5f23660..0000000000000 --- a/tests/baselines/reference/moduleResolutionWithoutExtensions2.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [buzz.mts] -// Extensionless relative path cjs import in an ES module -import foo = require("./foo"); -foo; - -//// [buzz.mjs] -import { createRequire as _createRequire } from "module"; -const __require = _createRequire(import.meta.url); -// Extensionless relative path cjs import in an ES module -const foo = __require("./foo"); -foo; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions2.symbols b/tests/baselines/reference/moduleResolutionWithoutExtensions2.symbols deleted file mode 100644 index e1effe939154b..0000000000000 --- a/tests/baselines/reference/moduleResolutionWithoutExtensions2.symbols +++ /dev/null @@ -1,8 +0,0 @@ -=== /src/buzz.mts === -// Extensionless relative path cjs import in an ES module -import foo = require("./foo"); ->foo : Symbol(foo, Decl(buzz.mts, 0, 0)) - -foo; ->foo : Symbol(foo, Decl(buzz.mts, 0, 0)) - diff --git a/tests/baselines/reference/moduleResolutionWithoutExtensions2.types b/tests/baselines/reference/moduleResolutionWithoutExtensions2.types deleted file mode 100644 index 2d39a2128a2bf..0000000000000 --- a/tests/baselines/reference/moduleResolutionWithoutExtensions2.types +++ /dev/null @@ -1,8 +0,0 @@ -=== /src/buzz.mts === -// Extensionless relative path cjs import in an ES module -import foo = require("./foo"); ->foo : any - -foo; ->foo : any - From 685e98f64cd323cc8a87fd3fddd70a255c6e4293 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Wed, 27 Oct 2021 15:04:11 -0700 Subject: [PATCH 08/10] update node modules test baselines --- .../nodeModules1(module=node12).errors.txt | 200 +++++++++--------- .../nodeModules1(module=nodenext).errors.txt | 200 +++++++++--------- 2 files changed, 200 insertions(+), 200 deletions(-) diff --git a/tests/baselines/reference/nodeModules1(module=node12).errors.txt b/tests/baselines/reference/nodeModules1(module=node12).errors.txt index 6398640a86946..ddcfce15d1953 100644 --- a/tests/baselines/reference/nodeModules1(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModules1(module=node12).errors.txt @@ -15,70 +15,70 @@ tests/cases/conformance/node/index.cts(59,22): error TS1471: Module './subfolder tests/cases/conformance/node/index.cts(60,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(76,21): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(77,21): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(78,21): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(79,21): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(80,21): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(81,21): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(82,21): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(83,21): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(84,21): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(85,21): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/index.cts(76,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.cts(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.cts(78,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.cts(79,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.cts(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.cts(81,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.cts(82,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.cts(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.cts(84,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.cts(85,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.mts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(15,22): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(16,22): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(17,22): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(18,22): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(19,22): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(20,22): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(21,22): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(22,22): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(23,22): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(24,22): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/index.mts(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.mts(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.mts(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.mts(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.mts(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(75,21): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(76,21): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(77,21): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(78,21): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(79,21): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(80,21): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(81,21): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(82,21): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(83,21): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(84,21): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/index.mts(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.mts(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.mts(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.mts(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.ts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(15,22): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(16,22): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(17,22): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(18,22): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(19,22): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(20,22): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(21,22): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(22,22): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(23,22): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(24,22): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/index.ts(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.ts(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.ts(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.ts(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.ts(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(75,21): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(76,21): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(77,21): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(78,21): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(79,21): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(80,21): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(81,21): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(82,21): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(83,21): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(84,21): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/index.ts(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.ts(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.ts(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.ts(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? ==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== @@ -136,34 +136,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2307: Cannot find module ' !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -228,34 +228,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2307: Cannot find module ' !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; @@ -372,34 +372,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2307: Cannot find module ' !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // cjs format file const x = 1; export {x}; @@ -422,34 +422,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2307: Cannot find module ' !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -514,34 +514,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2307: Cannot find module ' !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; export {x}; diff --git a/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt index 6398640a86946..ddcfce15d1953 100644 --- a/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt @@ -15,70 +15,70 @@ tests/cases/conformance/node/index.cts(59,22): error TS1471: Module './subfolder tests/cases/conformance/node/index.cts(60,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(76,21): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(77,21): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(78,21): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(79,21): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(80,21): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(81,21): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(82,21): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(83,21): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(84,21): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(85,21): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/index.cts(76,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.cts(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.cts(78,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.cts(79,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.cts(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.cts(81,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.cts(82,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.cts(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.cts(84,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.cts(85,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.mts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(15,22): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(16,22): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(17,22): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(18,22): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(19,22): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(20,22): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(21,22): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(22,22): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(23,22): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(24,22): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/index.mts(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.mts(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.mts(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.mts(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.mts(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(75,21): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(76,21): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(77,21): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(78,21): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(79,21): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(80,21): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(81,21): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(82,21): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(83,21): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(84,21): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/index.mts(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.mts(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.mts(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.mts(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.mts(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.ts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(15,22): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(16,22): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(17,22): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(18,22): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(19,22): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(20,22): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(21,22): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(22,22): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(23,22): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(24,22): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/index.ts(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.ts(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.ts(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.ts(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.ts(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(75,21): error TS2307: Cannot find module './index' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(76,21): error TS2307: Cannot find module './subfolder' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(77,21): error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(78,21): error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(79,21): error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(80,21): error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(81,21): error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(82,21): error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(83,21): error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(84,21): error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +tests/cases/conformance/node/index.ts(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.ts(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.ts(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.ts(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? ==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== @@ -136,34 +136,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2307: Cannot find module ' !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -228,34 +228,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2307: Cannot find module ' !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; @@ -372,34 +372,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2307: Cannot find module ' !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // cjs format file const x = 1; export {x}; @@ -422,34 +422,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2307: Cannot find module ' !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -514,34 +514,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2307: Cannot find module ' !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2307: Cannot find module './index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/' or its corresponding type declarations. +!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './subfolder2/another/index' or its corresponding type declarations. +!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; export {x}; From f89332e54231b6805342e3dd97b1fd7f3d23555b Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Thu, 28 Oct 2021 17:33:52 -0700 Subject: [PATCH 09/10] fix error message, add new tests --- src/compiler/checker.ts | 4 ++-- src/compiler/diagnosticMessages.json | 4 ++-- .../moduleResolutionWithoutExtension1.errors.txt | 12 +++++------- .../reference/moduleResolutionWithoutExtension1.js | 10 ++-------- .../moduleResolutionWithoutExtension1.symbols | 8 +------- .../moduleResolutionWithoutExtension1.types | 8 +------- .../moduleResolutionWithoutExtension2.errors.txt | 5 ++--- .../reference/moduleResolutionWithoutExtension2.js | 9 ++------- .../moduleResolutionWithoutExtension2.symbols | 5 +---- .../moduleResolutionWithoutExtension2.types | 5 +---- .../moduleResolutionWithoutExtension3.errors.txt | 5 ++--- .../reference/moduleResolutionWithoutExtension3.js | 5 +---- .../moduleResolutionWithoutExtension3.symbols | 3 --- .../moduleResolutionWithoutExtension3.types | 3 --- .../moduleResolutionWithoutExtension4.errors.txt | 5 ++--- .../reference/moduleResolutionWithoutExtension4.js | 5 +---- .../moduleResolutionWithoutExtension4.symbols | 3 --- .../moduleResolutionWithoutExtension4.types | 3 --- .../moduleResolutionWithoutExtension5.errors.txt | 8 ++++++++ .../reference/moduleResolutionWithoutExtension5.js | 7 +++++++ .../moduleResolutionWithoutExtension5.symbols | 8 ++++++++ .../moduleResolutionWithoutExtension5.types | 12 ++++++++++++ .../moduleResolutionWithoutExtension6.errors.txt | 10 ++++++++++ .../reference/moduleResolutionWithoutExtension6.js | 9 +++++++++ .../moduleResolutionWithoutExtension6.symbols | 7 +++++++ .../moduleResolutionWithoutExtension6.types | 7 +++++++ .../moduleResolutionWithoutExtension7.errors.txt | 8 ++++++++ .../reference/moduleResolutionWithoutExtension7.js | 7 +++++++ .../moduleResolutionWithoutExtension7.symbols | 5 +++++ .../moduleResolutionWithoutExtension7.types | 5 +++++ .../moduleResolutionWithoutExtension8.errors.txt | 8 ++++++++ .../reference/moduleResolutionWithoutExtension8.js | 7 +++++++ .../moduleResolutionWithoutExtension8.symbols | 8 ++++++++ .../moduleResolutionWithoutExtension8.types | 12 ++++++++++++ .../moduleResolutionWithoutExtension1.ts | 4 +--- .../moduleResolutionWithoutExtension2.ts | 3 +-- .../moduleResolutionWithoutExtension3.ts | 1 - .../moduleResolutionWithoutExtension4.ts | 1 - .../moduleResolutionWithoutExtension5.ts | 6 ++++++ .../moduleResolutionWithoutExtension6.ts | 8 ++++++++ .../moduleResolutionWithoutExtension7.ts | 6 ++++++ .../moduleResolutionWithoutExtension8.ts | 6 ++++++ 42 files changed, 181 insertions(+), 84 deletions(-) create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension5.errors.txt create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension5.js create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension5.symbols create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension5.types create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension6.errors.txt create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension6.js create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension6.symbols create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension6.types create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension7.errors.txt create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension7.js create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension7.symbols create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension7.types create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension8.errors.txt create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension8.js create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension8.symbols create mode 100644 tests/baselines/reference/moduleResolutionWithoutExtension8.types create mode 100644 tests/cases/conformance/externalModules/moduleResolutionWithoutExtension5.ts create mode 100644 tests/cases/conformance/externalModules/moduleResolutionWithoutExtension6.ts create mode 100644 tests/cases/conformance/externalModules/moduleResolutionWithoutExtension7.ts create mode 100644 tests/cases/conformance/externalModules/moduleResolutionWithoutExtension8.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a98c3d44f5f2e..492ad331b2d86 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3528,11 +3528,11 @@ namespace ts { const suggestedExt = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))?.[1]; if (suggestedExt) { error(errorNode, - Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ES_modules_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0, + Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt); } else { - error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ES_modules_when_moduleResolution_is_node12_or_nodenext); + error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path); } } else { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index b8d436bf5bdd3..267a8efc4799b 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3341,11 +3341,11 @@ "category": "Error", "code": 2833 }, - "Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'.": { + "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path.": { "category": "Error", "code": 2834 }, - "Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean '{0}'?": { + "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean '{0}'?": { "category": "Error", "code": 2835 }, diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt index 1c7001370a8b5..5f3cbbc121cfb 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt @@ -1,5 +1,5 @@ -/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.mjs'? -/src/bar.mts(3,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.mjs'? +/src/bar.mts(3,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. ==== /src/foo.mts (0 errors) ==== @@ -11,10 +11,8 @@ // Extensionless relative path ES import in an ES module import { foo } from "./foo"; // should error, suggest adding ".mjs" ~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.mjs'? - import { baz } from "./baz"; // should also error, no extension suggestion +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.mjs'? + import { baz } from "./baz"; // should error, ask for extension, no extension suggestion ~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. - foo; - baz; +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension1.js b/tests/baselines/reference/moduleResolutionWithoutExtension1.js index 0b1eaf08de8f5..39f3af1bcb538 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension1.js +++ b/tests/baselines/reference/moduleResolutionWithoutExtension1.js @@ -8,9 +8,7 @@ export function foo() { //// [bar.mts] // Extensionless relative path ES import in an ES module import { foo } from "./foo"; // should error, suggest adding ".mjs" -import { baz } from "./baz"; // should also error, no extension suggestion -foo; -baz; +import { baz } from "./baz"; // should error, ask for extension, no extension suggestion //// [foo.mjs] @@ -18,8 +16,4 @@ export function foo() { return ""; } //// [bar.mjs] -// Extensionless relative path ES import in an ES module -import { foo } from "./foo"; // should error, suggest adding ".mjs" -import { baz } from "./baz"; // should also error, no extension suggestion -foo; -baz; +export {}; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension1.symbols b/tests/baselines/reference/moduleResolutionWithoutExtension1.symbols index 267cbbfd4ab7a..5b3588c39019d 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension1.symbols +++ b/tests/baselines/reference/moduleResolutionWithoutExtension1.symbols @@ -10,12 +10,6 @@ export function foo() { import { foo } from "./foo"; // should error, suggest adding ".mjs" >foo : Symbol(foo, Decl(bar.mts, 1, 8)) -import { baz } from "./baz"; // should also error, no extension suggestion ->baz : Symbol(baz, Decl(bar.mts, 2, 8)) - -foo; ->foo : Symbol(foo, Decl(bar.mts, 1, 8)) - -baz; +import { baz } from "./baz"; // should error, ask for extension, no extension suggestion >baz : Symbol(baz, Decl(bar.mts, 2, 8)) diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension1.types b/tests/baselines/reference/moduleResolutionWithoutExtension1.types index 31768d495a66f..79b5c11773d59 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension1.types +++ b/tests/baselines/reference/moduleResolutionWithoutExtension1.types @@ -11,12 +11,6 @@ export function foo() { import { foo } from "./foo"; // should error, suggest adding ".mjs" >foo : any -import { baz } from "./baz"; // should also error, no extension suggestion ->baz : any - -foo; ->foo : any - -baz; +import { baz } from "./baz"; // should error, ask for extension, no extension suggestion >baz : any diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension2.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension2.errors.txt index 04dbb159f4408..e541ad83a67cd 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension2.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension2.errors.txt @@ -3,7 +3,6 @@ ==== /src/buzz.mts (1 errors) ==== // Extensionless relative path cjs import in an ES module - import foo = require("./foo"); // should error + import foo = require("./foo"); // should error, should not ask for extension ~~~~~~~ -!!! error TS2307: Cannot find module './foo' or its corresponding type declarations. - foo; \ No newline at end of file +!!! error TS2307: Cannot find module './foo' or its corresponding type declarations. \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension2.js b/tests/baselines/reference/moduleResolutionWithoutExtension2.js index 054a4c7d3c4a2..f5d7cf95c75ee 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension2.js +++ b/tests/baselines/reference/moduleResolutionWithoutExtension2.js @@ -1,11 +1,6 @@ //// [buzz.mts] // Extensionless relative path cjs import in an ES module -import foo = require("./foo"); // should error -foo; +import foo = require("./foo"); // should error, should not ask for extension //// [buzz.mjs] -import { createRequire as _createRequire } from "module"; -const __require = _createRequire(import.meta.url); -// Extensionless relative path cjs import in an ES module -const foo = __require("./foo"); // should error -foo; +export {}; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension2.symbols b/tests/baselines/reference/moduleResolutionWithoutExtension2.symbols index 6116acfe066dd..c10eaa8a5b21b 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension2.symbols +++ b/tests/baselines/reference/moduleResolutionWithoutExtension2.symbols @@ -1,8 +1,5 @@ === /src/buzz.mts === // Extensionless relative path cjs import in an ES module -import foo = require("./foo"); // should error ->foo : Symbol(foo, Decl(buzz.mts, 0, 0)) - -foo; +import foo = require("./foo"); // should error, should not ask for extension >foo : Symbol(foo, Decl(buzz.mts, 0, 0)) diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension2.types b/tests/baselines/reference/moduleResolutionWithoutExtension2.types index eba8d6aacf1f6..89d7b057c8fae 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension2.types +++ b/tests/baselines/reference/moduleResolutionWithoutExtension2.types @@ -1,8 +1,5 @@ === /src/buzz.mts === // Extensionless relative path cjs import in an ES module -import foo = require("./foo"); // should error ->foo : any - -foo; +import foo = require("./foo"); // should error, should not ask for extension >foo : any diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt index 09a1053d5aa9c..0c753a1029900 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt @@ -1,4 +1,4 @@ -/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.jsx'? +/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.jsx'? ==== /src/foo.tsx (0 errors) ==== @@ -10,6 +10,5 @@ // Extensionless relative path ES import in an ES module import { foo } from "./foo"; // should error, suggest adding ".jsx" ~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.jsx'? - foo; +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.jsx'? \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension3.js b/tests/baselines/reference/moduleResolutionWithoutExtension3.js index 4f495b9e50409..964402755a434 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension3.js +++ b/tests/baselines/reference/moduleResolutionWithoutExtension3.js @@ -8,7 +8,6 @@ export function foo() { //// [bar.mts] // Extensionless relative path ES import in an ES module import { foo } from "./foo"; // should error, suggest adding ".jsx" -foo; //// [foo.jsx] @@ -20,6 +19,4 @@ function foo() { } exports.foo = foo; //// [bar.mjs] -// Extensionless relative path ES import in an ES module -import { foo } from "./foo"; // should error, suggest adding ".jsx" -foo; +export {}; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension3.symbols b/tests/baselines/reference/moduleResolutionWithoutExtension3.symbols index 731a3a799fb6b..707433d072a60 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension3.symbols +++ b/tests/baselines/reference/moduleResolutionWithoutExtension3.symbols @@ -10,6 +10,3 @@ export function foo() { import { foo } from "./foo"; // should error, suggest adding ".jsx" >foo : Symbol(foo, Decl(bar.mts, 1, 8)) -foo; ->foo : Symbol(foo, Decl(bar.mts, 1, 8)) - diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension3.types b/tests/baselines/reference/moduleResolutionWithoutExtension3.types index 1ec9b3754e818..a94a6890b6898 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension3.types +++ b/tests/baselines/reference/moduleResolutionWithoutExtension3.types @@ -11,6 +11,3 @@ export function foo() { import { foo } from "./foo"; // should error, suggest adding ".jsx" >foo : any -foo; ->foo : any - diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt index 05e14cd528253..afd24269d69bc 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt @@ -1,4 +1,4 @@ -/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.js'? +/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.js'? ==== /src/foo.tsx (0 errors) ==== @@ -10,6 +10,5 @@ // Extensionless relative path ES import in an ES module import { foo } from "./foo"; // should error, suggest adding ".js" ~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.js'? - foo; +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.js'? \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension4.js b/tests/baselines/reference/moduleResolutionWithoutExtension4.js index cce16de68a0f6..b67ea6284a3ff 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension4.js +++ b/tests/baselines/reference/moduleResolutionWithoutExtension4.js @@ -8,7 +8,6 @@ export function foo() { //// [bar.mts] // Extensionless relative path ES import in an ES module import { foo } from "./foo"; // should error, suggest adding ".js" -foo; //// [foo.js] @@ -20,6 +19,4 @@ function foo() { } exports.foo = foo; //// [bar.mjs] -// Extensionless relative path ES import in an ES module -import { foo } from "./foo"; // should error, suggest adding ".js" -foo; +export {}; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension4.symbols b/tests/baselines/reference/moduleResolutionWithoutExtension4.symbols index f04216ec6120b..ba19300835274 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension4.symbols +++ b/tests/baselines/reference/moduleResolutionWithoutExtension4.symbols @@ -10,6 +10,3 @@ export function foo() { import { foo } from "./foo"; // should error, suggest adding ".js" >foo : Symbol(foo, Decl(bar.mts, 1, 8)) -foo; ->foo : Symbol(foo, Decl(bar.mts, 1, 8)) - diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension4.types b/tests/baselines/reference/moduleResolutionWithoutExtension4.types index be9eed2321bb1..e72345bda427d 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension4.types +++ b/tests/baselines/reference/moduleResolutionWithoutExtension4.types @@ -11,6 +11,3 @@ export function foo() { import { foo } from "./foo"; // should error, suggest adding ".js" >foo : any -foo; ->foo : any - diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension5.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension5.errors.txt new file mode 100644 index 0000000000000..b4b0a89ae974f --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension5.errors.txt @@ -0,0 +1,8 @@ +/src/buzz.mts(2,8): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. + + +==== /src/buzz.mts (1 errors) ==== + // Extensionless relative path dynamic import in an ES module + import("./foo").then(x => x); // should error, ask for extension + ~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension5.js b/tests/baselines/reference/moduleResolutionWithoutExtension5.js new file mode 100644 index 0000000000000..b79c4d0d548b0 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension5.js @@ -0,0 +1,7 @@ +//// [buzz.mts] +// Extensionless relative path dynamic import in an ES module +import("./foo").then(x => x); // should error, ask for extension + +//// [buzz.mjs] +// Extensionless relative path dynamic import in an ES module +import("./foo").then(x => x); // should error, ask for extension diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension5.symbols b/tests/baselines/reference/moduleResolutionWithoutExtension5.symbols new file mode 100644 index 0000000000000..d66bb3d0fff5b --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension5.symbols @@ -0,0 +1,8 @@ +=== /src/buzz.mts === +// Extensionless relative path dynamic import in an ES module +import("./foo").then(x => x); // should error, ask for extension +>import("./foo").then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(buzz.mts, 1, 21)) +>x : Symbol(x, Decl(buzz.mts, 1, 21)) + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension5.types b/tests/baselines/reference/moduleResolutionWithoutExtension5.types new file mode 100644 index 0000000000000..d18f5276dba1c --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension5.types @@ -0,0 +1,12 @@ +=== /src/buzz.mts === +// Extensionless relative path dynamic import in an ES module +import("./foo").then(x => x); // should error, ask for extension +>import("./foo").then(x => x) : Promise +>import("./foo").then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>import("./foo") : Promise +>"./foo" : "./foo" +>then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: any) => any +>x : any +>x : any + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension6.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension6.errors.txt new file mode 100644 index 0000000000000..267a4cd5a0a53 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension6.errors.txt @@ -0,0 +1,10 @@ +/src/bar.cts(4,21): error TS2307: Cannot find module './foo' or its corresponding type declarations. + + +==== /src/bar.cts (1 errors) ==== + // Extensionless relative path import statement in a cjs module + // Import statements are not allowed in cjs files, + // but other errors should not assume that they are allowed + import { foo } from "./foo"; // should error, should not ask for extension + ~~~~~~~ +!!! error TS2307: Cannot find module './foo' or its corresponding type declarations. \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension6.js b/tests/baselines/reference/moduleResolutionWithoutExtension6.js new file mode 100644 index 0000000000000..0df0659f2d516 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension6.js @@ -0,0 +1,9 @@ +//// [bar.cts] +// Extensionless relative path import statement in a cjs module +// Import statements are not allowed in cjs files, +// but other errors should not assume that they are allowed +import { foo } from "./foo"; // should error, should not ask for extension + +//// [bar.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension6.symbols b/tests/baselines/reference/moduleResolutionWithoutExtension6.symbols new file mode 100644 index 0000000000000..0e0f1e7963667 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension6.symbols @@ -0,0 +1,7 @@ +=== /src/bar.cts === +// Extensionless relative path import statement in a cjs module +// Import statements are not allowed in cjs files, +// but other errors should not assume that they are allowed +import { foo } from "./foo"; // should error, should not ask for extension +>foo : Symbol(foo, Decl(bar.cts, 3, 8)) + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension6.types b/tests/baselines/reference/moduleResolutionWithoutExtension6.types new file mode 100644 index 0000000000000..7b87af3ccf3b3 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension6.types @@ -0,0 +1,7 @@ +=== /src/bar.cts === +// Extensionless relative path import statement in a cjs module +// Import statements are not allowed in cjs files, +// but other errors should not assume that they are allowed +import { foo } from "./foo"; // should error, should not ask for extension +>foo : any + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension7.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension7.errors.txt new file mode 100644 index 0000000000000..0ff660b3418e3 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension7.errors.txt @@ -0,0 +1,8 @@ +/src/bar.cts(2,22): error TS2307: Cannot find module './foo' or its corresponding type declarations. + + +==== /src/bar.cts (1 errors) ==== + // Extensionless relative path cjs import in a cjs module + import foo = require("./foo"); // should error, should not ask for extension + ~~~~~~~ +!!! error TS2307: Cannot find module './foo' or its corresponding type declarations. \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension7.js b/tests/baselines/reference/moduleResolutionWithoutExtension7.js new file mode 100644 index 0000000000000..949b36a9d1da8 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension7.js @@ -0,0 +1,7 @@ +//// [bar.cts] +// Extensionless relative path cjs import in a cjs module +import foo = require("./foo"); // should error, should not ask for extension + +//// [bar.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension7.symbols b/tests/baselines/reference/moduleResolutionWithoutExtension7.symbols new file mode 100644 index 0000000000000..4397e9a2e294f --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension7.symbols @@ -0,0 +1,5 @@ +=== /src/bar.cts === +// Extensionless relative path cjs import in a cjs module +import foo = require("./foo"); // should error, should not ask for extension +>foo : Symbol(foo, Decl(bar.cts, 0, 0)) + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension7.types b/tests/baselines/reference/moduleResolutionWithoutExtension7.types new file mode 100644 index 0000000000000..1ebf99baf94cb --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension7.types @@ -0,0 +1,5 @@ +=== /src/bar.cts === +// Extensionless relative path cjs import in a cjs module +import foo = require("./foo"); // should error, should not ask for extension +>foo : any + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension8.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension8.errors.txt new file mode 100644 index 0000000000000..c990522c6c707 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension8.errors.txt @@ -0,0 +1,8 @@ +/src/bar.cts(2,8): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. + + +==== /src/bar.cts (1 errors) ==== + // Extensionless relative path dynamic import in a cjs module + import("./foo").then(x => x); // should error, ask for extension + ~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension8.js b/tests/baselines/reference/moduleResolutionWithoutExtension8.js new file mode 100644 index 0000000000000..593f3668b3c73 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension8.js @@ -0,0 +1,7 @@ +//// [bar.cts] +// Extensionless relative path dynamic import in a cjs module +import("./foo").then(x => x); // should error, ask for extension + +//// [bar.cjs] +// Extensionless relative path dynamic import in a cjs module +import("./foo").then(x => x); // should error, ask for extension diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension8.symbols b/tests/baselines/reference/moduleResolutionWithoutExtension8.symbols new file mode 100644 index 0000000000000..deded53a4ec65 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension8.symbols @@ -0,0 +1,8 @@ +=== /src/bar.cts === +// Extensionless relative path dynamic import in a cjs module +import("./foo").then(x => x); // should error, ask for extension +>import("./foo").then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(bar.cts, 1, 21)) +>x : Symbol(x, Decl(bar.cts, 1, 21)) + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension8.types b/tests/baselines/reference/moduleResolutionWithoutExtension8.types new file mode 100644 index 0000000000000..fdde64edc490c --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension8.types @@ -0,0 +1,12 @@ +=== /src/bar.cts === +// Extensionless relative path dynamic import in a cjs module +import("./foo").then(x => x); // should error, ask for extension +>import("./foo").then(x => x) : Promise +>import("./foo").then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>import("./foo") : Promise +>"./foo" : "./foo" +>then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>x => x : (x: any) => any +>x : any +>x : any + diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension1.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension1.ts index d75ec2f6b0cfe..83e86fc6c6069 100644 --- a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension1.ts +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension1.ts @@ -9,6 +9,4 @@ export function foo() { // @filename: /src/bar.mts // Extensionless relative path ES import in an ES module import { foo } from "./foo"; // should error, suggest adding ".mjs" -import { baz } from "./baz"; // should also error, no extension suggestion -foo; -baz; +import { baz } from "./baz"; // should error, ask for extension, no extension suggestion diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension2.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension2.ts index 171053ce6b25f..0051e17401c7c 100644 --- a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension2.ts +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension2.ts @@ -3,5 +3,4 @@ // @filename: /src/buzz.mts // Extensionless relative path cjs import in an ES module -import foo = require("./foo"); // should error -foo; \ No newline at end of file +import foo = require("./foo"); // should error, should not ask for extension \ No newline at end of file diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts index 70ced17af50c4..2ec3ff1ad0116 100644 --- a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts @@ -10,4 +10,3 @@ export function foo() { // @filename: /src/bar.mts // Extensionless relative path ES import in an ES module import { foo } from "./foo"; // should error, suggest adding ".jsx" -foo; diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts index 8f8482ed0d47f..c1eab70f92d82 100644 --- a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts @@ -10,4 +10,3 @@ export function foo() { // @filename: /src/bar.mts // Extensionless relative path ES import in an ES module import { foo } from "./foo"; // should error, suggest adding ".js" -foo; diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension5.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension5.ts new file mode 100644 index 0000000000000..5053a242cd5d5 --- /dev/null +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension5.ts @@ -0,0 +1,6 @@ +// @moduleResolution: node12 +// @module: node12 + +// @filename: /src/buzz.mts +// Extensionless relative path dynamic import in an ES module +import("./foo").then(x => x); // should error, ask for extension \ No newline at end of file diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension6.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension6.ts new file mode 100644 index 0000000000000..2a6ef2645dd4d --- /dev/null +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension6.ts @@ -0,0 +1,8 @@ +// @moduleResolution: node12 +// @module: node12 + +// @filename: /src/bar.cts +// Extensionless relative path import statement in a cjs module +// Import statements are not allowed in cjs files, +// but other errors should not assume that they are allowed +import { foo } from "./foo"; // should error, should not ask for extension \ No newline at end of file diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension7.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension7.ts new file mode 100644 index 0000000000000..3b10dd6e48aab --- /dev/null +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension7.ts @@ -0,0 +1,6 @@ +// @moduleResolution: node12 +// @module: node12 + +// @filename: /src/bar.cts +// Extensionless relative path cjs import in a cjs module +import foo = require("./foo"); // should error, should not ask for extension \ No newline at end of file diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension8.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension8.ts new file mode 100644 index 0000000000000..fef17b3aa1e54 --- /dev/null +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension8.ts @@ -0,0 +1,6 @@ +// @moduleResolution: node12 +// @module: node12 + +// @filename: /src/bar.cts +// Extensionless relative path dynamic import in a cjs module +import("./foo").then(x => x); // should error, ask for extension \ No newline at end of file From 4b0da27fa99103e6c70fbeda59f74ec05a913067 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Fri, 29 Oct 2021 10:00:16 -0700 Subject: [PATCH 10/10] update old tests with new error message --- .../nodeModules1(module=node12).errors.txt | 200 +++++++++--------- .../nodeModules1(module=nodenext).errors.txt | 200 +++++++++--------- ...eModulesAllowJs1(module=node12).errors.txt | 200 +++++++++--------- ...odulesAllowJs1(module=nodenext).errors.txt | 200 +++++++++--------- 4 files changed, 400 insertions(+), 400 deletions(-) diff --git a/tests/baselines/reference/nodeModules1(module=node12).errors.txt b/tests/baselines/reference/nodeModules1(module=node12).errors.txt index ddcfce15d1953..724e3b73ed7b2 100644 --- a/tests/baselines/reference/nodeModules1(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModules1(module=node12).errors.txt @@ -15,70 +15,70 @@ tests/cases/conformance/node/index.cts(59,22): error TS1471: Module './subfolder tests/cases/conformance/node/index.cts(60,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(76,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.cts(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.cts(78,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.cts(79,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.cts(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.cts(81,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.cts(82,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.cts(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.cts(84,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.cts(85,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.cts(76,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.cts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(78,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(79,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.cts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(81,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(82,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.cts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(84,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(85,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.mts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.mts(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.mts(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.mts(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.mts(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.mts(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.mts(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.mts(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.mts(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.mts(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.mts(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.mts(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.mts(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.mts(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.mts(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.mts(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.ts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.ts(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.ts(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.ts(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.ts(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.ts(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.ts(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.ts(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.ts(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.ts(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.ts(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.ts(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.ts(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.ts(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.ts(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.ts(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? ==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== @@ -136,34 +136,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import path !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -228,34 +228,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import path !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; @@ -372,34 +372,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import path !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // cjs format file const x = 1; export {x}; @@ -422,34 +422,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import path !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -514,34 +514,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import path !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; export {x}; diff --git a/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt index ddcfce15d1953..724e3b73ed7b2 100644 --- a/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt @@ -15,70 +15,70 @@ tests/cases/conformance/node/index.cts(59,22): error TS1471: Module './subfolder tests/cases/conformance/node/index.cts(60,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(76,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.cts(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.cts(78,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.cts(79,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.cts(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.cts(81,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.cts(82,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.cts(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.cts(84,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.cts(85,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.cts(76,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.cts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(78,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(79,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.cts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(81,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(82,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.cts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(84,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(85,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.mts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.mts(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.mts(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.mts(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.mts(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.mts(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.mts(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.mts(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.mts(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.mts(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.mts(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.mts(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.mts(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.mts(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.mts(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.mts(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.mts(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.ts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.ts(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.ts(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.ts(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.ts(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.ts(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.ts(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.ts(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.ts(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.ts(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.ts(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.ts(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.ts(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.ts(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.ts(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.ts(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? ==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== @@ -136,34 +136,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import path !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -228,34 +228,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import path !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; @@ -372,34 +372,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import path !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // cjs format file const x = 1; export {x}; @@ -422,34 +422,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import path !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -514,34 +514,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import path !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; export {x}; diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt index 90cdb44b00031..178c28ed46004 100644 --- a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt @@ -26,27 +26,27 @@ tests/cases/conformance/node/allowJs/index.cjs(60,22): error TS1471: Module './s tests/cases/conformance/node/allowJs/index.cjs(61,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.cjs(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.js(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.js(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.js(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -64,27 +64,27 @@ tests/cases/conformance/node/allowJs/index.js(59,22): error TS1471: Module './su tests/cases/conformance/node/allowJs/index.js(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.js(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.mjs(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.mjs(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.mjs(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.mjs(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -102,16 +102,16 @@ tests/cases/conformance/node/allowJs/index.mjs(59,22): error TS1471: Module './s tests/cases/conformance/node/allowJs/index.mjs(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.mjs(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.mjs(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? ==== tests/cases/conformance/node/allowJs/subfolder/index.js (0 errors) ==== @@ -169,34 +169,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative im !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -283,34 +283,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative im !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; export {x}; @@ -448,34 +448,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative im !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // cjs format file const x = 1; export {x}; @@ -498,34 +498,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative im !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -612,34 +612,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative im !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt index 90cdb44b00031..178c28ed46004 100644 --- a/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt @@ -26,27 +26,27 @@ tests/cases/conformance/node/allowJs/index.cjs(60,22): error TS1471: Module './s tests/cases/conformance/node/allowJs/index.cjs(61,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.cjs(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.js(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.js(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.js(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -64,27 +64,27 @@ tests/cases/conformance/node/allowJs/index.js(59,22): error TS1471: Module './su tests/cases/conformance/node/allowJs/index.js(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.js(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.js(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.mjs(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.mjs(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.mjs(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.mjs(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -102,16 +102,16 @@ tests/cases/conformance/node/allowJs/index.mjs(59,22): error TS1471: Module './s tests/cases/conformance/node/allowJs/index.mjs(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.mjs(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.mjs(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. -tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? ==== tests/cases/conformance/node/allowJs/subfolder/index.js (0 errors) ==== @@ -169,34 +169,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative im !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -283,34 +283,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative im !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; export {x}; @@ -448,34 +448,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative im !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // cjs format file const x = 1; export {x}; @@ -498,34 +498,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative im !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -612,34 +612,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative im !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in ES modules when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1;