diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 14b8e477a9eed..9849aa1a952e2 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3688,6 +3688,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { getExternalModuleRequireArgument(node) || getExternalModuleImportEqualsDeclarationExpression(node), ); const resolved = resolveExternalModuleSymbol(immediate); + if (resolved && ModuleKind.Node20 <= moduleKind && moduleKind <= ModuleKind.NodeNext) { + const moduleExports = getExportOfModule(resolved, "module.exports" as __String, node, dontResolveAlias); + if (moduleExports) { + return moduleExports; + } + } markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved, /*overwriteEmpty*/ false); return resolved; } @@ -3803,16 +3809,44 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } function getTargetofModuleDefault(moduleSymbol: Symbol, node: ImportClause | ImportOrExportSpecifier, dontResolveAlias: boolean) { + const file = moduleSymbol.declarations?.find(isSourceFile); + const specifier = getModuleSpecifierForImportOrExport(node); let exportDefaultSymbol: Symbol | undefined; + let exportModuleDotExportsSymbol: Symbol | undefined; if (isShorthandAmbientModuleSymbol(moduleSymbol)) { exportDefaultSymbol = moduleSymbol; } + else if ( + file && specifier && + ModuleKind.Node20 <= moduleKind && moduleKind <= ModuleKind.NodeNext && + getEmitSyntaxForModuleSpecifierExpression(specifier) === ModuleKind.CommonJS && + host.getImpliedNodeFormatForEmit(file) === ModuleKind.ESNext && + (exportModuleDotExportsSymbol = resolveExportByName(moduleSymbol, "module.exports" as __String, node, dontResolveAlias)) + ) { + // We have a transpiled default import where the `require` resolves to an ES module with a `module.exports` named + // export. If `esModuleInterop` is enabled, this will work: + // + // const dep_1 = __importDefault(require("./dep.mjs")); // wraps like { default: require("./dep.mjs") } + // dep_1.default; // require("./dep.mjs") -> the `module.exports` export value + // + // But without `esModuleInterop`, it will be broken: + // + // const dep_1 = require("./dep.mjs"); // the `module.exports` export value (could be primitive) + // dep_1.default; // `default` property access on the `module.exports` export value + // + // We could try to resolve the 'default' property in the latter case, but it's a mistake to run in this + // environment without `esModuleInterop`, so just error. + if (!getESModuleInterop(compilerOptions)) { + error(node.name, Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), "esModuleInterop"); + return undefined; + } + markSymbolOfAliasDeclarationIfTypeOnly(node, exportModuleDotExportsSymbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ false); + return exportModuleDotExportsSymbol; + } else { exportDefaultSymbol = resolveExportByName(moduleSymbol, InternalSymbolName.Default, node, dontResolveAlias); } - const file = moduleSymbol.declarations?.find(isSourceFile); - const specifier = getModuleSpecifierForImportOrExport(node); if (!specifier) { return exportDefaultSymbol; } @@ -4958,10 +4992,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } const referenceParent = referencingLocation.parent; - if ( - (isImportDeclaration(referenceParent) && getNamespaceDeclarationNode(referenceParent)) || - isImportCall(referenceParent) - ) { + const namespaceImport = isImportDeclaration(referenceParent) && getNamespaceDeclarationNode(referenceParent); + if (namespaceImport || isImportCall(referenceParent)) { const reference = isImportCall(referenceParent) ? referenceParent.arguments[0] : referenceParent.moduleSpecifier; const type = getTypeOfSymbol(symbol); const defaultOnlyType = getTypeWithSyntheticDefaultOnly(type, symbol, moduleSymbol!, reference); @@ -4970,14 +5002,27 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } const targetFile = moduleSymbol?.declarations?.find(isSourceFile); - const isEsmCjsRef = targetFile && isESMFormatImportImportingCommonjsFormatFile(getEmitSyntaxForModuleSpecifierExpression(reference), host.getImpliedNodeFormatForEmit(targetFile)); - if (getESModuleInterop(compilerOptions) || isEsmCjsRef) { - let sigs = getSignaturesOfStructuredType(type, SignatureKind.Call); - if (!sigs || !sigs.length) { - sigs = getSignaturesOfStructuredType(type, SignatureKind.Construct); + const usageMode = getEmitSyntaxForModuleSpecifierExpression(reference); + let exportModuleDotExportsSymbol: Symbol | undefined; + if ( + namespaceImport && targetFile && + ModuleKind.Node20 <= moduleKind && moduleKind <= ModuleKind.NodeNext && + usageMode === ModuleKind.CommonJS && host.getImpliedNodeFormatForEmit(targetFile) === ModuleKind.ESNext && + (exportModuleDotExportsSymbol = resolveExportByName(symbol, "module.exports" as __String, namespaceImport, dontResolveAlias)) + ) { + if (!suppressInteropError && !(symbol.flags & (SymbolFlags.Module | SymbolFlags.Variable))) { + error(referencingLocation, Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, "esModuleInterop"); } + if (getESModuleInterop(compilerOptions) && hasSignatures(type)) { + return cloneTypeAsModuleType(exportModuleDotExportsSymbol, type, referenceParent); + } + return exportModuleDotExportsSymbol; + } + + const isEsmCjsRef = targetFile && isESMFormatImportImportingCommonjsFormatFile(usageMode, host.getImpliedNodeFormatForEmit(targetFile)); + if (getESModuleInterop(compilerOptions) || isEsmCjsRef) { if ( - (sigs && sigs.length) || + hasSignatures(type) || getPropertyOfType(type, InternalSymbolName.Default, /*skipObjectFunctionPropertyAugment*/ true) || isEsmCjsRef ) { @@ -4992,6 +5037,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return symbol; } + function hasSignatures(type: Type): boolean { + return some(getSignaturesOfStructuredType(type, SignatureKind.Call)) || some(getSignaturesOfStructuredType(type, SignatureKind.Construct)); + } + /** * Create a new symbol which has the module's type less the call and construct signatures */ @@ -38117,7 +38166,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } } else if (moduleKind < ModuleKind.ES2020 && moduleKind !== ModuleKind.System) { - error(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext); + error(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_node20_or_nodenext); } const file = getSourceFileOfNode(node); Debug.assert(!!(file.flags & NodeFlags.PossiblyContainsImportMeta), "Containing file is missing import meta node flag."); @@ -39699,6 +39748,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { switch (moduleKind) { case ModuleKind.Node16: case ModuleKind.Node18: + case ModuleKind.Node20: case ModuleKind.NodeNext: if (sourceFile.impliedNodeFormat === ModuleKind.CommonJS) { span ??= getSpanOfTokenAtPosition(sourceFile, node.pos); @@ -39719,8 +39769,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // fallthrough default: span ??= getSpanOfTokenAtPosition(sourceFile, node.pos); - const message = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher : - Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher; + const message = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher : + Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher; diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, message)); hasError = true; break; @@ -48330,12 +48380,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return grammarErrorOnNode( node, isImportAttributes - ? Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve - : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve, + ? Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve + : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_node20_nodenext_or_preserve, ); } - if (moduleKind === ModuleKind.NodeNext && !isImportAttributes) { + if (ModuleKind.Node20 <= moduleKind && moduleKind <= ModuleKind.NodeNext && !isImportAttributes) { return grammarErrorOnFirstToken(node, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert); } @@ -52383,6 +52433,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { switch (moduleKind) { case ModuleKind.Node16: case ModuleKind.Node18: + case ModuleKind.Node20: case ModuleKind.NodeNext: if (sourceFile.impliedNodeFormat === ModuleKind.CommonJS) { diagnostics.add( @@ -52401,7 +52452,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // fallthrough default: diagnostics.add( - createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher), + createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher), ); break; } @@ -53244,7 +53295,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } } else if (moduleKind === ModuleKind.ES2015) { - return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_or_nodenext); + return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_node20_or_nodenext); } if (node.typeArguments) { @@ -53258,7 +53309,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (nodeArguments.length > 1) { const importAttributesArgument = nodeArguments[1]; - return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_nodenext_or_preserve); + return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_node20_nodenext_or_preserve); } } diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index dd861e653acd8..c705ac8f92c8f 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -603,6 +603,7 @@ export const moduleOptionDeclaration: CommandLineOptionOfCustomType = { esnext: ModuleKind.ESNext, node16: ModuleKind.Node16, node18: ModuleKind.Node18, + node20: ModuleKind.Node20, nodenext: ModuleKind.NodeNext, preserve: ModuleKind.Preserve, })), diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index fad4ba72a5569..91ecc9f7f0b5e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1031,11 +1031,11 @@ "category": "Error", "code": 1322 }, - "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'.": { + "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'.": { "category": "Error", "code": 1323 }, - "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'.": { + "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'.": { "category": "Error", "code": 1324 }, @@ -1103,7 +1103,7 @@ "category": "Error", "code": 1341 }, - "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'.": { + "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'.": { "category": "Error", "code": 1343 }, @@ -1223,7 +1223,7 @@ "category": "Message", "code": 1377 }, - "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher.": { + "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher.": { "category": "Error", "code": 1378 }, @@ -1427,7 +1427,7 @@ "category": "Error", "code": 1431 }, - "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher.": { + "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher.": { "category": "Error", "code": 1432 }, @@ -3799,7 +3799,7 @@ "category": "Error", "code": 2820 }, - "Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'.": { + "Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'.": { "category": "Error", "code": 2821 }, @@ -3807,7 +3807,7 @@ "category": "Error", "code": 2822 }, - "Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'.": { + "Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'.": { "category": "Error", "code": 2823 }, @@ -3887,7 +3887,7 @@ "category": "Error", "code": 2853 }, - "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher.": { + "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher.": { "category": "Error", "code": 2854 }, diff --git a/src/compiler/transformer.ts b/src/compiler/transformer.ts index 8c19f33600649..6d9884632482e 100644 --- a/src/compiler/transformer.ts +++ b/src/compiler/transformer.ts @@ -87,6 +87,7 @@ function getModuleTransformer(moduleKind: ModuleKind): TransformerFactory" }; + import { "" as valueX } from "./arbitraryModuleNamespaceIdentifiers_module"; + if (valueX !== "someValue") throw "should be someValue"; + + export { "" as "" } from "./arbitraryModuleNamespaceIdentifiers_module"; + import { "" as valueY } from "./arbitraryModuleNamespaceIdentifiers_module"; + if (valueY !== "someValue") throw "should be someValue"; + + export * as "" from "./arbitraryModuleNamespaceIdentifiers_module"; + import { "" as valueZ } from "./arbitraryModuleNamespaceIdentifiers_module"; + if (valueZ[""] !== "someValue") throw "should be someValue"; + if (valueZ[""] !== "someValue") throw "should be someValue"; + if (valueZ[""] !== valueZ) throw "should be export namespace"; + + export { type someType as "" }; + import { type "" as typeA } from "./arbitraryModuleNamespaceIdentifiers_module"; + const importTest: typeA = "expect error about someType"; + ~~~~~~~~~~ +!!! error TS2322: Type '"expect error about someType"' is not assignable to type '"someType"'. + + export { type "" as "" } from "./arbitraryModuleNamespaceIdentifiers_module"; + import { type "" as typeB } from "./arbitraryModuleNamespaceIdentifiers_module"; + const reimportTest: typeB = "expect error about someType"; + ~~~~~~~~~~~~ +!!! error TS2322: Type '"expect error about someType"' is not assignable to type '"someType"'. + + export type * as "" from "./arbitraryModuleNamespaceIdentifiers_module"; + import { type "" as typeC } from "./arbitraryModuleNamespaceIdentifiers_module"; + export type otherType = "otherType"; + const importStarTestA: typeC.otherType = "expect error about otherType"; + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type '"expect error about otherType"' is not assignable to type '"otherType"'. + \ No newline at end of file diff --git a/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node20).js b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node20).js new file mode 100644 index 0000000000000..311a983aea48a --- /dev/null +++ b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node20).js @@ -0,0 +1,104 @@ +//// [tests/cases/conformance/es2022/arbitraryModuleNamespaceIdentifiers/arbitraryModuleNamespaceIdentifiers_module.ts] //// + +//// [arbitraryModuleNamespaceIdentifiers_module.ts] +const someValue = "someValue"; +type someType = "someType"; + +export { someValue as "" }; +import { "" as valueX } from "./arbitraryModuleNamespaceIdentifiers_module"; +if (valueX !== "someValue") throw "should be someValue"; + +export { "" as "" } from "./arbitraryModuleNamespaceIdentifiers_module"; +import { "" as valueY } from "./arbitraryModuleNamespaceIdentifiers_module"; +if (valueY !== "someValue") throw "should be someValue"; + +export * as "" from "./arbitraryModuleNamespaceIdentifiers_module"; +import { "" as valueZ } from "./arbitraryModuleNamespaceIdentifiers_module"; +if (valueZ[""] !== "someValue") throw "should be someValue"; +if (valueZ[""] !== "someValue") throw "should be someValue"; +if (valueZ[""] !== valueZ) throw "should be export namespace"; + +export { type someType as "" }; +import { type "" as typeA } from "./arbitraryModuleNamespaceIdentifiers_module"; +const importTest: typeA = "expect error about someType"; + +export { type "" as "" } from "./arbitraryModuleNamespaceIdentifiers_module"; +import { type "" as typeB } from "./arbitraryModuleNamespaceIdentifiers_module"; +const reimportTest: typeB = "expect error about someType"; + +export type * as "" from "./arbitraryModuleNamespaceIdentifiers_module"; +import { type "" as typeC } from "./arbitraryModuleNamespaceIdentifiers_module"; +export type otherType = "otherType"; +const importStarTestA: typeC.otherType = "expect error about otherType"; + + +//// [arbitraryModuleNamespaceIdentifiers_module.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports[""] = exports[""] = exports[""] = void 0; +const someValue = "someValue"; +exports[""] = someValue; +const arbitraryModuleNamespaceIdentifiers_module_1 = require("./arbitraryModuleNamespaceIdentifiers_module"); +if (arbitraryModuleNamespaceIdentifiers_module_1[""] !== "someValue") + throw "should be someValue"; +var arbitraryModuleNamespaceIdentifiers_module_2 = require("./arbitraryModuleNamespaceIdentifiers_module"); +Object.defineProperty(exports, "", { enumerable: true, get: function () { return arbitraryModuleNamespaceIdentifiers_module_2[""]; } }); +const arbitraryModuleNamespaceIdentifiers_module_3 = require("./arbitraryModuleNamespaceIdentifiers_module"); +if (arbitraryModuleNamespaceIdentifiers_module_3[""] !== "someValue") + throw "should be someValue"; +exports[""] = __importStar(require("./arbitraryModuleNamespaceIdentifiers_module")); +const arbitraryModuleNamespaceIdentifiers_module_4 = require("./arbitraryModuleNamespaceIdentifiers_module"); +if (arbitraryModuleNamespaceIdentifiers_module_4[""][""] !== "someValue") + throw "should be someValue"; +if (arbitraryModuleNamespaceIdentifiers_module_4[""][""] !== "someValue") + throw "should be someValue"; +if (arbitraryModuleNamespaceIdentifiers_module_4[""][""] !== arbitraryModuleNamespaceIdentifiers_module_4[""]) + throw "should be export namespace"; +const importTest = "expect error about someType"; +const reimportTest = "expect error about someType"; +const importStarTestA = "expect error about otherType"; + + +//// [arbitraryModuleNamespaceIdentifiers_module.d.ts] +declare const someValue = "someValue"; +type someType = "someType"; +export { someValue as "" }; +export { "" as "" } from "./arbitraryModuleNamespaceIdentifiers_module"; +export * as "" from "./arbitraryModuleNamespaceIdentifiers_module"; +export { type someType as "" }; +export { type "" as "" } from "./arbitraryModuleNamespaceIdentifiers_module"; +export type * as "" from "./arbitraryModuleNamespaceIdentifiers_module"; +export type otherType = "otherType"; diff --git a/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node20).symbols b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node20).symbols new file mode 100644 index 0000000000000..a792b7d3f5280 --- /dev/null +++ b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node20).symbols @@ -0,0 +1,82 @@ +//// [tests/cases/conformance/es2022/arbitraryModuleNamespaceIdentifiers/arbitraryModuleNamespaceIdentifiers_module.ts] //// + +=== arbitraryModuleNamespaceIdentifiers_module.ts === +const someValue = "someValue"; +>someValue : Symbol(someValue, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 0, 5)) + +type someType = "someType"; +>someType : Symbol(someType, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 0, 30)) + +export { someValue as "" }; +>someValue : Symbol(someValue, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 0, 5)) +>"" : Symbol(valueZ[""], Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 3, 8)) + +import { "" as valueX } from "./arbitraryModuleNamespaceIdentifiers_module"; +>valueX : Symbol(valueX, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 4, 8)) + +if (valueX !== "someValue") throw "should be someValue"; +>valueX : Symbol(valueX, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 4, 8)) + +export { "" as "" } from "./arbitraryModuleNamespaceIdentifiers_module"; +>"" : Symbol(valueZ[""], Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 7, 8)) + +import { "" as valueY } from "./arbitraryModuleNamespaceIdentifiers_module"; +>valueY : Symbol(valueY, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 8, 8)) + +if (valueY !== "someValue") throw "should be someValue"; +>valueY : Symbol(valueY, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 8, 8)) + +export * as "" from "./arbitraryModuleNamespaceIdentifiers_module"; +>"" : Symbol(valueZ[""], Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 11, 6)) + +import { "" as valueZ } from "./arbitraryModuleNamespaceIdentifiers_module"; +>valueZ : Symbol(valueZ, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 12, 8)) + +if (valueZ[""] !== "someValue") throw "should be someValue"; +>valueZ : Symbol(valueZ, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 12, 8)) +>"" : Symbol(valueZ[""], Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 3, 8)) + +if (valueZ[""] !== "someValue") throw "should be someValue"; +>valueZ : Symbol(valueZ, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 12, 8)) +>"" : Symbol(valueZ[""], Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 7, 8)) + +if (valueZ[""] !== valueZ) throw "should be export namespace"; +>valueZ : Symbol(valueZ, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 12, 8)) +>"" : Symbol(valueZ[""], Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 11, 6)) +>valueZ : Symbol(valueZ, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 12, 8)) + +export { type someType as "" }; +>someType : Symbol(someType, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 0, 30)) +>"" : Symbol(valueZ[""], Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 17, 8)) + +import { type "" as typeA } from "./arbitraryModuleNamespaceIdentifiers_module"; +>typeA : Symbol(typeA, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 18, 8)) + +const importTest: typeA = "expect error about someType"; +>importTest : Symbol(importTest, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 19, 5)) +>typeA : Symbol(typeA, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 18, 8)) + +export { type "" as "" } from "./arbitraryModuleNamespaceIdentifiers_module"; +>"" : Symbol(valueZ[""], Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 21, 8)) + +import { type "" as typeB } from "./arbitraryModuleNamespaceIdentifiers_module"; +>typeB : Symbol(typeB, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 22, 8)) + +const reimportTest: typeB = "expect error about someType"; +>reimportTest : Symbol(reimportTest, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 23, 5)) +>typeB : Symbol(typeB, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 22, 8)) + +export type * as "" from "./arbitraryModuleNamespaceIdentifiers_module"; +>"" : Symbol(valueZ[""], Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 25, 11)) + +import { type "" as typeC } from "./arbitraryModuleNamespaceIdentifiers_module"; +>typeC : Symbol(typeC, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 26, 8)) + +export type otherType = "otherType"; +>otherType : Symbol(valueZ.otherType, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 26, 83)) + +const importStarTestA: typeC.otherType = "expect error about otherType"; +>importStarTestA : Symbol(importStarTestA, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 28, 5)) +>typeC : Symbol(typeC, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 26, 8)) +>otherType : Symbol(valueZ.otherType, Decl(arbitraryModuleNamespaceIdentifiers_module.ts, 26, 83)) + diff --git a/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node20).types b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node20).types new file mode 100644 index 0000000000000..4574f9754d0b4 --- /dev/null +++ b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node20).types @@ -0,0 +1,151 @@ +//// [tests/cases/conformance/es2022/arbitraryModuleNamespaceIdentifiers/arbitraryModuleNamespaceIdentifiers_module.ts] //// + +=== arbitraryModuleNamespaceIdentifiers_module.ts === +const someValue = "someValue"; +>someValue : "someValue" +> : ^^^^^^^^^^^ +>"someValue" : "someValue" +> : ^^^^^^^^^^^ + +type someType = "someType"; +>someType : "someType" +> : ^^^^^^^^^^ + +export { someValue as "" }; +>someValue : "someValue" +> : ^^^^^^^^^^^ +>"" : "someValue" +> : ^^^^^^^^^^^ + +import { "" as valueX } from "./arbitraryModuleNamespaceIdentifiers_module"; +>valueX : "someValue" +> : ^^^^^^^^^^^ + +if (valueX !== "someValue") throw "should be someValue"; +>valueX !== "someValue" : boolean +> : ^^^^^^^ +>valueX : "someValue" +> : ^^^^^^^^^^^ +>"someValue" : "someValue" +> : ^^^^^^^^^^^ +>"should be someValue" : "should be someValue" +> : ^^^^^^^^^^^^^^^^^^^^^ + +export { "" as "" } from "./arbitraryModuleNamespaceIdentifiers_module"; +>"" : "someValue" +> : ^^^^^^^^^^^ + +import { "" as valueY } from "./arbitraryModuleNamespaceIdentifiers_module"; +>valueY : "someValue" +> : ^^^^^^^^^^^ + +if (valueY !== "someValue") throw "should be someValue"; +>valueY !== "someValue" : boolean +> : ^^^^^^^ +>valueY : "someValue" +> : ^^^^^^^^^^^ +>"someValue" : "someValue" +> : ^^^^^^^^^^^ +>"should be someValue" : "should be someValue" +> : ^^^^^^^^^^^^^^^^^^^^^ + +export * as "" from "./arbitraryModuleNamespaceIdentifiers_module"; +>"" : typeof valueZ +> : ^^^^^^^^^^^^^ + +import { "" as valueZ } from "./arbitraryModuleNamespaceIdentifiers_module"; +>valueZ : typeof valueZ +> : ^^^^^^^^^^^^^ + +if (valueZ[""] !== "someValue") throw "should be someValue"; +>valueZ[""] !== "someValue" : boolean +> : ^^^^^^^ +>valueZ[""] : "someValue" +> : ^^^^^^^^^^^ +>valueZ : typeof valueZ +> : ^^^^^^^^^^^^^ +>"" : "" +> : ^^^^^ +>"someValue" : "someValue" +> : ^^^^^^^^^^^ +>"should be someValue" : "should be someValue" +> : ^^^^^^^^^^^^^^^^^^^^^ + +if (valueZ[""] !== "someValue") throw "should be someValue"; +>valueZ[""] !== "someValue" : boolean +> : ^^^^^^^ +>valueZ[""] : "someValue" +> : ^^^^^^^^^^^ +>valueZ : typeof valueZ +> : ^^^^^^^^^^^^^ +>"" : "" +> : ^^^^^ +>"someValue" : "someValue" +> : ^^^^^^^^^^^ +>"should be someValue" : "should be someValue" +> : ^^^^^^^^^^^^^^^^^^^^^ + +if (valueZ[""] !== valueZ) throw "should be export namespace"; +>valueZ[""] !== valueZ : boolean +> : ^^^^^^^ +>valueZ[""] : typeof valueZ +> : ^^^^^^^^^^^^^ +>valueZ : typeof valueZ +> : ^^^^^^^^^^^^^ +>"" : "" +> : ^^^^^ +>valueZ : typeof valueZ +> : ^^^^^^^^^^^^^ +>"should be export namespace" : "should be export namespace" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +export { type someType as "" }; +>someType : any +> : ^^^ +>"" : any +> : ^^^ + +import { type "" as typeA } from "./arbitraryModuleNamespaceIdentifiers_module"; +>typeA : any +> : ^^^ + +const importTest: typeA = "expect error about someType"; +>importTest : "someType" +> : ^^^^^^^^^^ +>"expect error about someType" : "expect error about someType" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +export { type "" as "" } from "./arbitraryModuleNamespaceIdentifiers_module"; +>"" : any +> : ^^^ + +import { type "" as typeB } from "./arbitraryModuleNamespaceIdentifiers_module"; +>typeB : any +> : ^^^ + +const reimportTest: typeB = "expect error about someType"; +>reimportTest : "someType" +> : ^^^^^^^^^^ +>"expect error about someType" : "expect error about someType" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +export type * as "" from "./arbitraryModuleNamespaceIdentifiers_module"; +>"" : typeof valueZ +> : ^^^^^^^^^^^^^ + +import { type "" as typeC } from "./arbitraryModuleNamespaceIdentifiers_module"; +>typeC : typeof valueZ +> : ^^^^^^^^^^^^^ + +export type otherType = "otherType"; +>otherType : "otherType" +> : ^^^^^^^^^^^ + +const importStarTestA: typeC.otherType = "expect error about otherType"; +>importStarTestA : "otherType" +> : ^^^^^^^^^^^ +>typeC : any +> : ^^^ +>"expect error about otherType" : "expect error about otherType" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/baselines/reference/awaitInNonAsyncFunction.errors.txt b/tests/baselines/reference/awaitInNonAsyncFunction.errors.txt index 4251652ef5f45..b269d74966e25 100644 --- a/tests/baselines/reference/awaitInNonAsyncFunction.errors.txt +++ b/tests/baselines/reference/awaitInNonAsyncFunction.errors.txt @@ -12,8 +12,8 @@ awaitInNonAsyncFunction.ts(30,9): error TS1103: 'for await' loops are only allow awaitInNonAsyncFunction.ts(31,5): error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules. awaitInNonAsyncFunction.ts(34,7): error TS1103: 'for await' loops are only allowed within async functions and at the top levels of modules. awaitInNonAsyncFunction.ts(35,5): error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules. -awaitInNonAsyncFunction.ts(39,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitInNonAsyncFunction.ts(40,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitInNonAsyncFunction.ts(39,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitInNonAsyncFunction.ts(40,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. ==== awaitInNonAsyncFunction.ts (16 errors) ==== @@ -97,7 +97,7 @@ awaitInNonAsyncFunction.ts(40,1): error TS1378: Top-level 'await' expressions ar for await (const _ of []); ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. await null; ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. \ No newline at end of file +!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. \ No newline at end of file diff --git a/tests/baselines/reference/awaitUsingDeclarations.1(target=es2015).errors.txt b/tests/baselines/reference/awaitUsingDeclarations.1(target=es2015).errors.txt index a6f82cf69ebdf..0334a104e0474 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.1(target=es2015).errors.txt +++ b/tests/baselines/reference/awaitUsingDeclarations.1(target=es2015).errors.txt @@ -1,24 +1,24 @@ -awaitUsingDeclarations.1.ts(1,1): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(36,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(41,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(45,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(52,13): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(57,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(60,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(63,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(67,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(70,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(74,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(79,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(85,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(90,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(1,1): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(36,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(41,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(45,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(52,13): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(57,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(60,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(63,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(67,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(70,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(74,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(79,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(85,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(90,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. ==== awaitUsingDeclarations.1.ts (15 errors) ==== await using d1 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. async function af() { await using d3 = { async [Symbol.asyncDispose]() {} }; @@ -55,20 +55,20 @@ awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' stateme { await using d19 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } switch (Math.random()) { case 0: await using d20 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; case 1: await using d21 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; } @@ -77,48 +77,48 @@ awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' stateme case 0: await using d22 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; } try { await using d23 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } catch { await using d24 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } finally { await using d25 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } if (true) { await using d26 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } else { await using d27 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } while (true) { await using d28 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; } do { await using d29 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; } while (true); @@ -126,20 +126,20 @@ awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' stateme for (;;) { await using d30 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; } for (const x in {}) { await using d31 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } for (const x of []) { await using d32 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } export {}; \ No newline at end of file diff --git a/tests/baselines/reference/awaitUsingDeclarations.1(target=es5).errors.txt b/tests/baselines/reference/awaitUsingDeclarations.1(target=es5).errors.txt index a6f82cf69ebdf..0334a104e0474 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.1(target=es5).errors.txt +++ b/tests/baselines/reference/awaitUsingDeclarations.1(target=es5).errors.txt @@ -1,24 +1,24 @@ -awaitUsingDeclarations.1.ts(1,1): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(36,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(41,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(45,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(52,13): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(57,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(60,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(63,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(67,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(70,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(74,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(79,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(85,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(90,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(1,1): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(36,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(41,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(45,9): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(52,13): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(57,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(60,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(63,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(67,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(70,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(74,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(79,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(85,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(90,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. ==== awaitUsingDeclarations.1.ts (15 errors) ==== await using d1 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. async function af() { await using d3 = { async [Symbol.asyncDispose]() {} }; @@ -55,20 +55,20 @@ awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' stateme { await using d19 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } switch (Math.random()) { case 0: await using d20 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; case 1: await using d21 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; } @@ -77,48 +77,48 @@ awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' stateme case 0: await using d22 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; } try { await using d23 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } catch { await using d24 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } finally { await using d25 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } if (true) { await using d26 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } else { await using d27 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } while (true) { await using d28 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; } do { await using d29 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; } while (true); @@ -126,20 +126,20 @@ awaitUsingDeclarations.1.ts(94,5): error TS2854: Top-level 'await using' stateme for (;;) { await using d30 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. break; } for (const x in {}) { await using d31 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } for (const x of []) { await using d32 = { async [Symbol.asyncDispose]() {} }; ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. } export {}; \ No newline at end of file diff --git a/tests/baselines/reference/awaitUsingDeclarations.2(target=es2015).errors.txt b/tests/baselines/reference/awaitUsingDeclarations.2(target=es2015).errors.txt index 4eccfeffa6114..2966bcdfb74a4 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.2(target=es2015).errors.txt +++ b/tests/baselines/reference/awaitUsingDeclarations.2(target=es2015).errors.txt @@ -1,11 +1,11 @@ -awaitUsingDeclarations.2.ts(2,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.2.ts(2,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. ==== awaitUsingDeclarations.2.ts (1 errors) ==== { await using d1 = { async [Symbol.asyncDispose]() {} }, ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. d2 = { async [Symbol.asyncDispose]() {} }; } diff --git a/tests/baselines/reference/awaitUsingDeclarations.2(target=es5).errors.txt b/tests/baselines/reference/awaitUsingDeclarations.2(target=es5).errors.txt index 4eccfeffa6114..2966bcdfb74a4 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.2(target=es5).errors.txt +++ b/tests/baselines/reference/awaitUsingDeclarations.2(target=es5).errors.txt @@ -1,11 +1,11 @@ -awaitUsingDeclarations.2.ts(2,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.2.ts(2,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. ==== awaitUsingDeclarations.2.ts (1 errors) ==== { await using d1 = { async [Symbol.asyncDispose]() {} }, ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. d2 = { async [Symbol.asyncDispose]() {} }; } diff --git a/tests/baselines/reference/awaitUsingDeclarations.3(target=es2015).errors.txt b/tests/baselines/reference/awaitUsingDeclarations.3(target=es2015).errors.txt index 905017a52154a..3987b59b7904b 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.3(target=es2015).errors.txt +++ b/tests/baselines/reference/awaitUsingDeclarations.3(target=es2015).errors.txt @@ -1,11 +1,11 @@ -awaitUsingDeclarations.3.ts(2,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.3.ts(2,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. ==== awaitUsingDeclarations.3.ts (1 errors) ==== { await using d1 = { async [Symbol.asyncDispose]() {} }, ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. d2 = null, d3 = undefined, d4 = { [Symbol.dispose]() {} }; diff --git a/tests/baselines/reference/awaitUsingDeclarations.3(target=es5).errors.txt b/tests/baselines/reference/awaitUsingDeclarations.3(target=es5).errors.txt index 905017a52154a..3987b59b7904b 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.3(target=es5).errors.txt +++ b/tests/baselines/reference/awaitUsingDeclarations.3(target=es5).errors.txt @@ -1,11 +1,11 @@ -awaitUsingDeclarations.3.ts(2,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarations.3.ts(2,5): error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. ==== awaitUsingDeclarations.3.ts (1 errors) ==== { await using d1 = { async [Symbol.asyncDispose]() {} }, ~~~~~ -!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS2854: Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. d2 = null, d3 = undefined, d4 = { [Symbol.dispose]() {} }; diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf.3(target=es5).errors.txt b/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf.3(target=es5).errors.txt index 8a3ba085e5d13..dff557f7c85b0 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf.3(target=es5).errors.txt +++ b/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf.3(target=es5).errors.txt @@ -1,4 +1,4 @@ -awaitUsingDeclarationsInForAwaitOf.3.ts(5,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +awaitUsingDeclarationsInForAwaitOf.3.ts(5,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. awaitUsingDeclarationsInForAwaitOf.3.ts(5,23): error TS1123: Variable declaration list cannot be empty. awaitUsingDeclarationsInForAwaitOf.3.ts(8,25): error TS1123: Variable declaration list cannot be empty. @@ -10,7 +10,7 @@ awaitUsingDeclarationsInForAwaitOf.3.ts(8,25): error TS1123: Variable declaratio for await (await using of x); ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. !!! error TS1123: Variable declaration list cannot be empty. diff --git a/tests/baselines/reference/bundlerDirectoryModule(module=node20,moduleresolution=bundler).errors.txt b/tests/baselines/reference/bundlerDirectoryModule(module=node20,moduleresolution=bundler).errors.txt new file mode 100644 index 0000000000000..7a1047bfbe0d2 --- /dev/null +++ b/tests/baselines/reference/bundlerDirectoryModule(module=node20,moduleresolution=bundler).errors.txt @@ -0,0 +1,20 @@ +error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. +error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node20'. + + +!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. +!!! error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node20'. +==== /app/test.ts (0 errors) ==== + import { test } from '../lib'; + +==== /lib/package.json (0 errors) ==== + { + "main": "./cjs/index.js" + } + +==== /lib/cjs/index.js (0 errors) ==== + export function test() {} + +==== /lib/cjs/index.d.ts (0 errors) ==== + export function test(): void; + \ No newline at end of file diff --git a/tests/baselines/reference/bundlerDirectoryModule(module=node20,moduleresolution=bundler).trace.json b/tests/baselines/reference/bundlerDirectoryModule(module=node20,moduleresolution=bundler).trace.json new file mode 100644 index 0000000000000..a091a926a57fa --- /dev/null +++ b/tests/baselines/reference/bundlerDirectoryModule(module=node20,moduleresolution=bundler).trace.json @@ -0,0 +1,879 @@ +[ + "======== Resolving module '../lib' from '/app/test.ts'. ========", + "Explicitly specified module resolution kind: 'Bundler'.", + "Resolving in CJS mode with conditions 'import', 'types'.", + "Loading module as file / folder, candidate module location '/lib', target file types: TypeScript, JavaScript, Declaration, JSON.", + "File '/lib.ts' does not exist.", + "File '/lib.tsx' does not exist.", + "File '/lib.d.ts' does not exist.", + "File '/lib.js' does not exist.", + "File '/lib.jsx' does not exist.", + "Found 'package.json' at '/lib/package.json'.", + "'package.json' does not have a 'typesVersions' field.", + "'package.json' does not have a 'typings' field.", + "'package.json' does not have a 'types' field.", + "'package.json' has 'main' field './cjs/index.js' that references '/lib/cjs/index.js'.", + "File name '/lib/cjs/index.js' has a '.js' extension - stripping it.", + "File '/lib/cjs/index.ts' does not exist.", + "File '/lib/cjs/index.tsx' does not exist.", + "File '/lib/cjs/index.d.ts' exists - use it as a name resolution result.", + "======== Module name '../lib' was successfully resolved to '/lib/cjs/index.d.ts'. ========", + "======== Resolving module '@typescript/lib-es2023' from '/.src/__lib_node_modules_lookup_lib.es2023.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023'", + "Loading module '@typescript/lib-es2023' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2022' from '/.src/__lib_node_modules_lookup_lib.es2022.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022'", + "Loading module '@typescript/lib-es2022' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2021' from '/.src/__lib_node_modules_lookup_lib.es2021.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021'", + "Loading module '@typescript/lib-es2021' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2020' from '/.src/__lib_node_modules_lookup_lib.es2020.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020'", + "Loading module '@typescript/lib-es2020' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2019' from '/.src/__lib_node_modules_lookup_lib.es2019.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019'", + "Loading module '@typescript/lib-es2019' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2018' from '/.src/__lib_node_modules_lookup_lib.es2018.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018'", + "Loading module '@typescript/lib-es2018' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2017' from '/.src/__lib_node_modules_lookup_lib.es2017.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017'", + "Loading module '@typescript/lib-es2017' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2016' from '/.src/__lib_node_modules_lookup_lib.es2016.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2016' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016'", + "Loading module '@typescript/lib-es2016' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2016' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2015' from '/.src/__lib_node_modules_lookup_lib.es2015.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015'", + "Loading module '@typescript/lib-es2015' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015' was not resolved. ========", + "======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es5'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es5'", + "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es5' was not resolved. ========", + "======== Resolving module '@typescript/lib-decorators' from '/.src/__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators'", + "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-decorators' was not resolved. ========", + "======== Resolving module '@typescript/lib-decorators/legacy' from '/.src/__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators/legacy'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators/legacy'", + "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2015/core' from '/.src/__lib_node_modules_lookup_lib.es2015.core.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/core' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/core'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/core'", + "Loading module '@typescript/lib-es2015/core' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/core' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2015/collection' from '/.src/__lib_node_modules_lookup_lib.es2015.collection.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/collection' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/collection'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/collection'", + "Loading module '@typescript/lib-es2015/collection' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2015/iterable' from '/.src/__lib_node_modules_lookup_lib.es2015.iterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/iterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/iterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/iterable'", + "Loading module '@typescript/lib-es2015/iterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/iterable' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2015/symbol' from '/.src/__lib_node_modules_lookup_lib.es2015.symbol.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/symbol' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol'", + "Loading module '@typescript/lib-es2015/symbol' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/symbol' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2015/generator' from '/.src/__lib_node_modules_lookup_lib.es2015.generator.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/generator' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/generator'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/generator'", + "Loading module '@typescript/lib-es2015/generator' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/generator' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2015/promise' from '/.src/__lib_node_modules_lookup_lib.es2015.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/promise'", + "Loading module '@typescript/lib-es2015/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/promise' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2015/proxy' from '/.src/__lib_node_modules_lookup_lib.es2015.proxy.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/proxy' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/proxy'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/proxy'", + "Loading module '@typescript/lib-es2015/proxy' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/proxy' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2015/reflect' from '/.src/__lib_node_modules_lookup_lib.es2015.reflect.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/reflect' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/reflect'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/reflect'", + "Loading module '@typescript/lib-es2015/reflect' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/reflect' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2015/symbol-wellknown' from '/.src/__lib_node_modules_lookup_lib.es2015.symbol.wellknown.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/symbol-wellknown' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol-wellknown'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol-wellknown'", + "Loading module '@typescript/lib-es2015/symbol-wellknown' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/symbol-wellknown' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2016/array-include' from '/.src/__lib_node_modules_lookup_lib.es2016.array.include.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2016/array-include' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/array-include'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/array-include'", + "Loading module '@typescript/lib-es2016/array-include' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2016/array-include' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2016/intl' from '/.src/__lib_node_modules_lookup_lib.es2016.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2016/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/intl'", + "Loading module '@typescript/lib-es2016/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2016/intl' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2017/arraybuffer' from '/.src/__lib_node_modules_lookup_lib.es2017.arraybuffer.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/arraybuffer' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/arraybuffer'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/arraybuffer'", + "Loading module '@typescript/lib-es2017/arraybuffer' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/arraybuffer' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2017/date' from '/.src/__lib_node_modules_lookup_lib.es2017.date.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/date' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/date'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/date'", + "Loading module '@typescript/lib-es2017/date' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/date' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2017/intl' from '/.src/__lib_node_modules_lookup_lib.es2017.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/intl'", + "Loading module '@typescript/lib-es2017/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/intl' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2017/object' from '/.src/__lib_node_modules_lookup_lib.es2017.object.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/object' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/object'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/object'", + "Loading module '@typescript/lib-es2017/object' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/object' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2017/sharedmemory' from '/.src/__lib_node_modules_lookup_lib.es2017.sharedmemory.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/sharedmemory' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/sharedmemory'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/sharedmemory'", + "Loading module '@typescript/lib-es2017/sharedmemory' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/sharedmemory' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2017/string' from '/.src/__lib_node_modules_lookup_lib.es2017.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/string'", + "Loading module '@typescript/lib-es2017/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/string' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2017/typedarrays' from '/.src/__lib_node_modules_lookup_lib.es2017.typedarrays.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/typedarrays' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/typedarrays'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/typedarrays'", + "Loading module '@typescript/lib-es2017/typedarrays' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/typedarrays' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2018/asynciterable' from '/.src/__lib_node_modules_lookup_lib.es2018.asynciterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/asynciterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asynciterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asynciterable'", + "Loading module '@typescript/lib-es2018/asynciterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/asynciterable' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2018/asyncgenerator' from '/.src/__lib_node_modules_lookup_lib.es2018.asyncgenerator.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/asyncgenerator' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asyncgenerator'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asyncgenerator'", + "Loading module '@typescript/lib-es2018/asyncgenerator' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/asyncgenerator' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2018/promise' from '/.src/__lib_node_modules_lookup_lib.es2018.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/promise'", + "Loading module '@typescript/lib-es2018/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/promise' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2018/regexp' from '/.src/__lib_node_modules_lookup_lib.es2018.regexp.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/regexp' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/regexp'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/regexp'", + "Loading module '@typescript/lib-es2018/regexp' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/regexp' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2018/intl' from '/.src/__lib_node_modules_lookup_lib.es2018.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/intl'", + "Loading module '@typescript/lib-es2018/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/intl' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2019/array' from '/.src/__lib_node_modules_lookup_lib.es2019.array.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/array' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/array'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/array'", + "Loading module '@typescript/lib-es2019/array' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/array' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2019/object' from '/.src/__lib_node_modules_lookup_lib.es2019.object.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/object' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/object'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/object'", + "Loading module '@typescript/lib-es2019/object' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/object' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2019/string' from '/.src/__lib_node_modules_lookup_lib.es2019.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/string'", + "Loading module '@typescript/lib-es2019/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/string' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2019/symbol' from '/.src/__lib_node_modules_lookup_lib.es2019.symbol.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/symbol' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/symbol'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/symbol'", + "Loading module '@typescript/lib-es2019/symbol' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/symbol' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2019/intl' from '/.src/__lib_node_modules_lookup_lib.es2019.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/intl'", + "Loading module '@typescript/lib-es2019/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/intl' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2020/bigint' from '/.src/__lib_node_modules_lookup_lib.es2020.bigint.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/bigint' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/bigint'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/bigint'", + "Loading module '@typescript/lib-es2020/bigint' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/bigint' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2020/intl' from '/.src/__lib_node_modules_lookup_lib.es2020.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/intl'", + "Loading module '@typescript/lib-es2020/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/intl' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2020/date' from '/.src/__lib_node_modules_lookup_lib.es2020.date.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/date' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/date'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/date'", + "Loading module '@typescript/lib-es2020/date' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/date' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2020/number' from '/.src/__lib_node_modules_lookup_lib.es2020.number.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/number' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/number'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/number'", + "Loading module '@typescript/lib-es2020/number' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/number' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2020/promise' from '/.src/__lib_node_modules_lookup_lib.es2020.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/promise'", + "Loading module '@typescript/lib-es2020/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/promise' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2020/sharedmemory' from '/.src/__lib_node_modules_lookup_lib.es2020.sharedmemory.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/sharedmemory' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/sharedmemory'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/sharedmemory'", + "Loading module '@typescript/lib-es2020/sharedmemory' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/sharedmemory' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2020/string' from '/.src/__lib_node_modules_lookup_lib.es2020.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/string'", + "Loading module '@typescript/lib-es2020/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/string' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2020/symbol-wellknown' from '/.src/__lib_node_modules_lookup_lib.es2020.symbol.wellknown.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/symbol-wellknown' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/symbol-wellknown'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/symbol-wellknown'", + "Loading module '@typescript/lib-es2020/symbol-wellknown' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/symbol-wellknown' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2021/promise' from '/.src/__lib_node_modules_lookup_lib.es2021.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/promise'", + "Loading module '@typescript/lib-es2021/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/promise' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2021/string' from '/.src/__lib_node_modules_lookup_lib.es2021.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/string'", + "Loading module '@typescript/lib-es2021/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/string' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2021/weakref' from '/.src/__lib_node_modules_lookup_lib.es2021.weakref.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/weakref' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/weakref'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/weakref'", + "Loading module '@typescript/lib-es2021/weakref' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/weakref' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2021/intl' from '/.src/__lib_node_modules_lookup_lib.es2021.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/intl'", + "Loading module '@typescript/lib-es2021/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/intl' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2022/array' from '/.src/__lib_node_modules_lookup_lib.es2022.array.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/array' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/array'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/array'", + "Loading module '@typescript/lib-es2022/array' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/array' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2022/error' from '/.src/__lib_node_modules_lookup_lib.es2022.error.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/error' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/error'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/error'", + "Loading module '@typescript/lib-es2022/error' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/error' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2022/intl' from '/.src/__lib_node_modules_lookup_lib.es2022.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/intl'", + "Loading module '@typescript/lib-es2022/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/intl' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2022/object' from '/.src/__lib_node_modules_lookup_lib.es2022.object.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/object' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/object'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/object'", + "Loading module '@typescript/lib-es2022/object' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/object' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2022/regexp' from '/.src/__lib_node_modules_lookup_lib.es2022.regexp.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/regexp' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/regexp'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/regexp'", + "Loading module '@typescript/lib-es2022/regexp' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/regexp' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2022/string' from '/.src/__lib_node_modules_lookup_lib.es2022.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/string'", + "Loading module '@typescript/lib-es2022/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/string' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/array' from '/.src/__lib_node_modules_lookup_lib.es2023.array.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/array' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/array'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/array'", + "Loading module '@typescript/lib-es2023/array' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/array' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/collection' from '/.src/__lib_node_modules_lookup_lib.es2023.collection.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/collection' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/collection'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/collection'", + "Loading module '@typescript/lib-es2023/collection' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", + "======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom'", + "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom' was not resolved. ========", + "======== Resolving module '@typescript/lib-webworker/importscripts' from '/.src/__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-webworker/importscripts'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-webworker/importscripts'", + "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========", + "======== Resolving module '@typescript/lib-scripthost' from '/.src/__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-scripthost'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-scripthost'", + "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-scripthost' was not resolved. ========", + "======== Resolving module '@typescript/lib-dom/iterable' from '/.src/__lib_node_modules_lookup_lib.dom.iterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom/iterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/iterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/iterable'", + "Loading module '@typescript/lib-dom/iterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom/iterable' was not resolved. ========", + "======== Resolving module '@typescript/lib-dom/asynciterable' from '/.src/__lib_node_modules_lookup_lib.dom.asynciterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom/asynciterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/asynciterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/asynciterable'", + "Loading module '@typescript/lib-dom/asynciterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom/asynciterable' was not resolved. ========" +] \ No newline at end of file diff --git a/tests/baselines/reference/bundlerDirectoryModule(module=node20,moduleresolution=nodenext).trace.json b/tests/baselines/reference/bundlerDirectoryModule(module=node20,moduleresolution=nodenext).trace.json new file mode 100644 index 0000000000000..72fa53da4cedf --- /dev/null +++ b/tests/baselines/reference/bundlerDirectoryModule(module=node20,moduleresolution=nodenext).trace.json @@ -0,0 +1,1017 @@ +[ + "File '/app/package.json' does not exist.", + "File '/package.json' does not exist.", + "======== Resolving module '../lib' from '/app/test.ts'. ========", + "Explicitly specified module resolution kind: 'NodeNext'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "Loading module as file / folder, candidate module location '/lib', target file types: TypeScript, JavaScript, Declaration, JSON.", + "File '/lib.ts' does not exist.", + "File '/lib.tsx' does not exist.", + "File '/lib.d.ts' does not exist.", + "File '/lib.js' does not exist.", + "File '/lib.jsx' does not exist.", + "Found 'package.json' at '/lib/package.json'.", + "'package.json' does not have a 'typesVersions' field.", + "'package.json' does not have a 'typings' field.", + "'package.json' does not have a 'types' field.", + "'package.json' has 'main' field './cjs/index.js' that references '/lib/cjs/index.js'.", + "File name '/lib/cjs/index.js' has a '.js' extension - stripping it.", + "File '/lib/cjs/index.ts' does not exist.", + "File '/lib/cjs/index.tsx' does not exist.", + "File '/lib/cjs/index.d.ts' exists - use it as a name resolution result.", + "======== Module name '../lib' was successfully resolved to '/lib/cjs/index.d.ts'. ========", + "File '/lib/cjs/package.json' does not exist.", + "File '/lib/package.json' exists according to earlier cached lookups.", + "File '/.ts/package.json' does not exist.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2023' from '/.src/__lib_node_modules_lookup_lib.es2023.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023'", + "Loading module '@typescript/lib-es2023' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022' from '/.src/__lib_node_modules_lookup_lib.es2022.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022'", + "Loading module '@typescript/lib-es2022' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021' from '/.src/__lib_node_modules_lookup_lib.es2021.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021'", + "Loading module '@typescript/lib-es2021' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020' from '/.src/__lib_node_modules_lookup_lib.es2020.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020'", + "Loading module '@typescript/lib-es2020' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019' from '/.src/__lib_node_modules_lookup_lib.es2019.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019'", + "Loading module '@typescript/lib-es2019' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018' from '/.src/__lib_node_modules_lookup_lib.es2018.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018'", + "Loading module '@typescript/lib-es2018' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017' from '/.src/__lib_node_modules_lookup_lib.es2017.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017'", + "Loading module '@typescript/lib-es2017' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2016' from '/.src/__lib_node_modules_lookup_lib.es2016.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2016' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016'", + "Loading module '@typescript/lib-es2016' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2016' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015' from '/.src/__lib_node_modules_lookup_lib.es2015.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015'", + "Loading module '@typescript/lib-es2015' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es5'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es5'", + "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es5' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-decorators' from '/.src/__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators'", + "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-decorators' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-decorators/legacy' from '/.src/__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators/legacy'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators/legacy'", + "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/core' from '/.src/__lib_node_modules_lookup_lib.es2015.core.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/core' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/core'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/core'", + "Loading module '@typescript/lib-es2015/core' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/core' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/collection' from '/.src/__lib_node_modules_lookup_lib.es2015.collection.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/collection' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/collection'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/collection'", + "Loading module '@typescript/lib-es2015/collection' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/collection' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/iterable' from '/.src/__lib_node_modules_lookup_lib.es2015.iterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/iterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/iterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/iterable'", + "Loading module '@typescript/lib-es2015/iterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/iterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/symbol' from '/.src/__lib_node_modules_lookup_lib.es2015.symbol.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/symbol' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol'", + "Loading module '@typescript/lib-es2015/symbol' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/symbol' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/generator' from '/.src/__lib_node_modules_lookup_lib.es2015.generator.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/generator' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/generator'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/generator'", + "Loading module '@typescript/lib-es2015/generator' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/generator' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/promise' from '/.src/__lib_node_modules_lookup_lib.es2015.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/promise'", + "Loading module '@typescript/lib-es2015/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/proxy' from '/.src/__lib_node_modules_lookup_lib.es2015.proxy.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/proxy' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/proxy'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/proxy'", + "Loading module '@typescript/lib-es2015/proxy' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/proxy' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/reflect' from '/.src/__lib_node_modules_lookup_lib.es2015.reflect.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/reflect' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/reflect'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/reflect'", + "Loading module '@typescript/lib-es2015/reflect' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/reflect' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/symbol-wellknown' from '/.src/__lib_node_modules_lookup_lib.es2015.symbol.wellknown.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/symbol-wellknown' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol-wellknown'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol-wellknown'", + "Loading module '@typescript/lib-es2015/symbol-wellknown' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/symbol-wellknown' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2016/array-include' from '/.src/__lib_node_modules_lookup_lib.es2016.array.include.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2016/array-include' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/array-include'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/array-include'", + "Loading module '@typescript/lib-es2016/array-include' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2016/array-include' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2016/intl' from '/.src/__lib_node_modules_lookup_lib.es2016.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2016/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/intl'", + "Loading module '@typescript/lib-es2016/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2016/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/arraybuffer' from '/.src/__lib_node_modules_lookup_lib.es2017.arraybuffer.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/arraybuffer' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/arraybuffer'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/arraybuffer'", + "Loading module '@typescript/lib-es2017/arraybuffer' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/arraybuffer' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/date' from '/.src/__lib_node_modules_lookup_lib.es2017.date.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/date' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/date'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/date'", + "Loading module '@typescript/lib-es2017/date' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/date' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/intl' from '/.src/__lib_node_modules_lookup_lib.es2017.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/intl'", + "Loading module '@typescript/lib-es2017/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/object' from '/.src/__lib_node_modules_lookup_lib.es2017.object.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/object' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/object'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/object'", + "Loading module '@typescript/lib-es2017/object' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/object' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/sharedmemory' from '/.src/__lib_node_modules_lookup_lib.es2017.sharedmemory.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/sharedmemory' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/sharedmemory'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/sharedmemory'", + "Loading module '@typescript/lib-es2017/sharedmemory' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/sharedmemory' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/string' from '/.src/__lib_node_modules_lookup_lib.es2017.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/string'", + "Loading module '@typescript/lib-es2017/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/typedarrays' from '/.src/__lib_node_modules_lookup_lib.es2017.typedarrays.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/typedarrays' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/typedarrays'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/typedarrays'", + "Loading module '@typescript/lib-es2017/typedarrays' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/typedarrays' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/asynciterable' from '/.src/__lib_node_modules_lookup_lib.es2018.asynciterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/asynciterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asynciterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asynciterable'", + "Loading module '@typescript/lib-es2018/asynciterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/asynciterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/asyncgenerator' from '/.src/__lib_node_modules_lookup_lib.es2018.asyncgenerator.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/asyncgenerator' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asyncgenerator'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asyncgenerator'", + "Loading module '@typescript/lib-es2018/asyncgenerator' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/asyncgenerator' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/promise' from '/.src/__lib_node_modules_lookup_lib.es2018.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/promise'", + "Loading module '@typescript/lib-es2018/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/regexp' from '/.src/__lib_node_modules_lookup_lib.es2018.regexp.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/regexp' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/regexp'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/regexp'", + "Loading module '@typescript/lib-es2018/regexp' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/regexp' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/intl' from '/.src/__lib_node_modules_lookup_lib.es2018.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/intl'", + "Loading module '@typescript/lib-es2018/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/array' from '/.src/__lib_node_modules_lookup_lib.es2019.array.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/array' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/array'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/array'", + "Loading module '@typescript/lib-es2019/array' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/array' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/object' from '/.src/__lib_node_modules_lookup_lib.es2019.object.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/object' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/object'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/object'", + "Loading module '@typescript/lib-es2019/object' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/object' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/string' from '/.src/__lib_node_modules_lookup_lib.es2019.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/string'", + "Loading module '@typescript/lib-es2019/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/symbol' from '/.src/__lib_node_modules_lookup_lib.es2019.symbol.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/symbol' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/symbol'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/symbol'", + "Loading module '@typescript/lib-es2019/symbol' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/symbol' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/intl' from '/.src/__lib_node_modules_lookup_lib.es2019.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/intl'", + "Loading module '@typescript/lib-es2019/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/bigint' from '/.src/__lib_node_modules_lookup_lib.es2020.bigint.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/bigint' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/bigint'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/bigint'", + "Loading module '@typescript/lib-es2020/bigint' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/bigint' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/intl' from '/.src/__lib_node_modules_lookup_lib.es2020.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/intl'", + "Loading module '@typescript/lib-es2020/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/date' from '/.src/__lib_node_modules_lookup_lib.es2020.date.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/date' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/date'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/date'", + "Loading module '@typescript/lib-es2020/date' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/date' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/number' from '/.src/__lib_node_modules_lookup_lib.es2020.number.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/number' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/number'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/number'", + "Loading module '@typescript/lib-es2020/number' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/number' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/promise' from '/.src/__lib_node_modules_lookup_lib.es2020.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/promise'", + "Loading module '@typescript/lib-es2020/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/sharedmemory' from '/.src/__lib_node_modules_lookup_lib.es2020.sharedmemory.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/sharedmemory' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/sharedmemory'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/sharedmemory'", + "Loading module '@typescript/lib-es2020/sharedmemory' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/sharedmemory' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/string' from '/.src/__lib_node_modules_lookup_lib.es2020.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/string'", + "Loading module '@typescript/lib-es2020/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/symbol-wellknown' from '/.src/__lib_node_modules_lookup_lib.es2020.symbol.wellknown.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/symbol-wellknown' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/symbol-wellknown'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/symbol-wellknown'", + "Loading module '@typescript/lib-es2020/symbol-wellknown' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/symbol-wellknown' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/promise' from '/.src/__lib_node_modules_lookup_lib.es2021.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/promise'", + "Loading module '@typescript/lib-es2021/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/string' from '/.src/__lib_node_modules_lookup_lib.es2021.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/string'", + "Loading module '@typescript/lib-es2021/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/weakref' from '/.src/__lib_node_modules_lookup_lib.es2021.weakref.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/weakref' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/weakref'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/weakref'", + "Loading module '@typescript/lib-es2021/weakref' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/weakref' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/intl' from '/.src/__lib_node_modules_lookup_lib.es2021.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/intl'", + "Loading module '@typescript/lib-es2021/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/array' from '/.src/__lib_node_modules_lookup_lib.es2022.array.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/array' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/array'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/array'", + "Loading module '@typescript/lib-es2022/array' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/array' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/error' from '/.src/__lib_node_modules_lookup_lib.es2022.error.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/error' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/error'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/error'", + "Loading module '@typescript/lib-es2022/error' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/error' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/intl' from '/.src/__lib_node_modules_lookup_lib.es2022.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/intl'", + "Loading module '@typescript/lib-es2022/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/object' from '/.src/__lib_node_modules_lookup_lib.es2022.object.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/object' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/object'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/object'", + "Loading module '@typescript/lib-es2022/object' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/object' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/regexp' from '/.src/__lib_node_modules_lookup_lib.es2022.regexp.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/regexp' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/regexp'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/regexp'", + "Loading module '@typescript/lib-es2022/regexp' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/regexp' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/string' from '/.src/__lib_node_modules_lookup_lib.es2022.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/string'", + "Loading module '@typescript/lib-es2022/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2023/array' from '/.src/__lib_node_modules_lookup_lib.es2023.array.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/array' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/array'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/array'", + "Loading module '@typescript/lib-es2023/array' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/array' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2023/collection' from '/.src/__lib_node_modules_lookup_lib.es2023.collection.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/collection' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/collection'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/collection'", + "Loading module '@typescript/lib-es2023/collection' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom'", + "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-webworker/importscripts' from '/.src/__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-webworker/importscripts'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-webworker/importscripts'", + "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-scripthost' from '/.src/__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-scripthost'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-scripthost'", + "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-scripthost' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-dom/iterable' from '/.src/__lib_node_modules_lookup_lib.dom.iterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom/iterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/iterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/iterable'", + "Loading module '@typescript/lib-dom/iterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom/iterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-dom/asynciterable' from '/.src/__lib_node_modules_lookup_lib.dom.asynciterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom/asynciterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/asynciterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/asynciterable'", + "Loading module '@typescript/lib-dom/asynciterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom/asynciterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups." +] \ No newline at end of file diff --git a/tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json b/tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json index 5a942b2f50133..fca9c5f6dee63 100644 --- a/tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json +++ b/tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json @@ -4,7 +4,7 @@ "======== Resolving module '../lib' from '/app/test.ts'. ========", "Explicitly specified module resolution kind: 'NodeNext'.", "Resolving in CJS mode with conditions 'require', 'types', 'node'.", - "Loading module as file / folder, candidate module location '/lib', target file types: TypeScript, JavaScript, Declaration.", + "Loading module as file / folder, candidate module location '/lib', target file types: TypeScript, JavaScript, Declaration, JSON.", "File '/lib.ts' does not exist.", "File '/lib.tsx' does not exist.", "File '/lib.d.ts' does not exist.", diff --git a/tests/baselines/reference/cjsErrors(module=node20).errors.txt b/tests/baselines/reference/cjsErrors(module=node20).errors.txt new file mode 100644 index 0000000000000..010cc8f06a60c --- /dev/null +++ b/tests/baselines/reference/cjsErrors(module=node20).errors.txt @@ -0,0 +1,12 @@ +index.ts(1,22): error TS2876: This relative import path is unsafe to rewrite because it looks like a file name, but actually resolves to "./foo.ts/index.ts". + + +==== index.ts (1 errors) ==== + import foo = require("./foo.ts"); // Error + ~~~~~~~~~~ +!!! error TS2876: This relative import path is unsafe to rewrite because it looks like a file name, but actually resolves to "./foo.ts/index.ts". + import type _foo = require("./foo.ts"); // Ok + +==== foo.ts/index.ts (0 errors) ==== + export = {}; + \ No newline at end of file diff --git a/tests/baselines/reference/cjsErrors(module=node20).js b/tests/baselines/reference/cjsErrors(module=node20).js new file mode 100644 index 0000000000000..e5ccbfe43a87f --- /dev/null +++ b/tests/baselines/reference/cjsErrors(module=node20).js @@ -0,0 +1,17 @@ +//// [tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/cjsErrors.ts] //// + +//// [index.ts] +export = {}; + +//// [index.ts] +import foo = require("./foo.ts"); // Error +import type _foo = require("./foo.ts"); // Ok + + +//// [index.js] +"use strict"; +module.exports = {}; +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const foo = require("./foo.js"); // Error diff --git a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse empty options of --module.js b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse empty options of --module.js index a17a607373765..69a03af11011b 100644 --- a/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse empty options of --module.js +++ b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse empty options of --module.js @@ -7,4 +7,4 @@ FileNames:: 0.ts Errors:: error TS6044: Compiler option 'module' expects an argument. -error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'nodenext', 'preserve'. +error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'node20', 'nodenext', 'preserve'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with json api.js index 1bb683ffbb17b..469feff50a44e 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with json api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with json api.js @@ -25,5 +25,5 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'nodenext', 'preserve'. +error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'node20', 'nodenext', 'preserve'. diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with jsonSourceFile api.js index bcf6c6562370a..319a40dc19c17 100644 --- a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with jsonSourceFile api.js @@ -25,7 +25,7 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } Errors:: -tsconfig.json:3:15 - error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'nodenext', 'preserve'. +tsconfig.json:3:15 - error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'node20', 'nodenext', 'preserve'. 3 "module": "",    ~~ diff --git a/tests/baselines/reference/config/showConfig/Show TSConfig with transitively implied options/tsconfig.json b/tests/baselines/reference/config/showConfig/Show TSConfig with transitively implied options/tsconfig.json index 3afdb1cd6278d..c427e18fed52a 100644 --- a/tests/baselines/reference/config/showConfig/Show TSConfig with transitively implied options/tsconfig.json +++ b/tests/baselines/reference/config/showConfig/Show TSConfig with transitively implied options/tsconfig.json @@ -8,6 +8,7 @@ "allowSyntheticDefaultImports": true, "resolvePackageJsonExports": true, "resolvePackageJsonImports": true, + "resolveJsonModule": true, "useDefineForClassFields": true } } diff --git a/tests/baselines/reference/declarationFileForTsJsImport(module=node20).errors.txt b/tests/baselines/reference/declarationFileForTsJsImport(module=node20).errors.txt new file mode 100644 index 0000000000000..754dde9109382 --- /dev/null +++ b/tests/baselines/reference/declarationFileForTsJsImport(module=node20).errors.txt @@ -0,0 +1,89 @@ +main.ts(1,18): error TS2307: Cannot find module './file.js' or its corresponding type declarations. +main.ts(2,18): error TS2307: Cannot find module './file.jsx' or its corresponding type declarations. +main.ts(3,18): error TS2307: Cannot find module './file.ts' or its corresponding type declarations. +main.ts(4,18): error TS2307: Cannot find module './file.tsx' or its corresponding type declarations. +main.ts(5,18): error TS2307: Cannot find module './file.mjs' or its corresponding type declarations. +main.ts(6,18): error TS2307: Cannot find module './file.cjs' or its corresponding type declarations. +main.ts(7,18): error TS2307: Cannot find module './file.mts' or its corresponding type declarations. +main.ts(8,18): error TS2307: Cannot find module './file.cts' or its corresponding type declarations. +main.ts(9,18): error TS2307: Cannot find module './file.d.ts' or its corresponding type declarations. +main.ts(10,19): error TS2307: Cannot find module './file.d.cts' or its corresponding type declarations. +main.ts(11,19): error TS2307: Cannot find module './file.d.mts' or its corresponding type declarations. +main.ts(12,19): error TS2307: Cannot find module './file.d.json.ts' or its corresponding type declarations. + + +==== package.json (0 errors) ==== + {"type": "module"} +==== main.ts (12 errors) ==== + import def1 from "./file.js"; + ~~~~~~~~~~~ +!!! error TS2307: Cannot find module './file.js' or its corresponding type declarations. + import def2 from "./file.jsx"; + ~~~~~~~~~~~~ +!!! error TS2307: Cannot find module './file.jsx' or its corresponding type declarations. + import def3 from "./file.ts"; + ~~~~~~~~~~~ +!!! error TS2307: Cannot find module './file.ts' or its corresponding type declarations. + import def4 from "./file.tsx"; + ~~~~~~~~~~~~ +!!! error TS2307: Cannot find module './file.tsx' or its corresponding type declarations. + import def5 from "./file.mjs"; + ~~~~~~~~~~~~ +!!! error TS2307: Cannot find module './file.mjs' or its corresponding type declarations. + import def6 from "./file.cjs"; + ~~~~~~~~~~~~ +!!! error TS2307: Cannot find module './file.cjs' or its corresponding type declarations. + import def7 from "./file.mts"; + ~~~~~~~~~~~~ +!!! error TS2307: Cannot find module './file.mts' or its corresponding type declarations. + import def8 from "./file.cts"; + ~~~~~~~~~~~~ +!!! error TS2307: Cannot find module './file.cts' or its corresponding type declarations. + import def9 from "./file.d.ts"; + ~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module './file.d.ts' or its corresponding type declarations. + import def10 from "./file.d.cts"; + ~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module './file.d.cts' or its corresponding type declarations. + import def11 from "./file.d.mts"; + ~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module './file.d.mts' or its corresponding type declarations. + import def12 from "./file.d.json.ts"; + ~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module './file.d.json.ts' or its corresponding type declarations. +==== file.d.js.ts (0 errors) ==== + declare var bad: "bad1"; + export default bad; +==== file.d.jsx.ts (0 errors) ==== + declare var bad: "bad2"; + export default bad; +==== file.d.ts.ts (0 errors) ==== + declare var bad: "bad3"; + export default bad; +==== file.d.tsx.ts (0 errors) ==== + declare var bad: "bad4"; + export default bad; +==== file.d.mjs.ts (0 errors) ==== + declare var bad: "bad5"; + export default bad; +==== file.d.cjs.ts (0 errors) ==== + declare var bad: "bad6"; + export default bad; +==== file.d.mts.ts (0 errors) ==== + declare var bad: "bad7"; + export default bad; +==== file.d.cts.ts (0 errors) ==== + declare var bad: "bad8"; + export default bad; +==== file.d.d.ts.ts (0 errors) ==== + declare var bad: "bad9"; + export default bad; +==== file.d.d.mts.ts (0 errors) ==== + declare var bad: "bad10"; + export default bad; +==== file.d.d.cts.ts (0 errors) ==== + declare var bad: "bad11"; + export default bad; +==== file.d.d.json.ts (0 errors) ==== + declare var bad: "bad12"; + export default bad; \ No newline at end of file diff --git a/tests/baselines/reference/declarationFileForTsJsImport(module=node20).js b/tests/baselines/reference/declarationFileForTsJsImport(module=node20).js new file mode 100644 index 0000000000000..aec21f826cdf3 --- /dev/null +++ b/tests/baselines/reference/declarationFileForTsJsImport(module=node20).js @@ -0,0 +1,56 @@ +//// [tests/cases/conformance/nonjsExtensions/declarationFileForTsJsImport.ts] //// + +//// [package.json] +{"type": "module"} +//// [main.ts] +import def1 from "./file.js"; +import def2 from "./file.jsx"; +import def3 from "./file.ts"; +import def4 from "./file.tsx"; +import def5 from "./file.mjs"; +import def6 from "./file.cjs"; +import def7 from "./file.mts"; +import def8 from "./file.cts"; +import def9 from "./file.d.ts"; +import def10 from "./file.d.cts"; +import def11 from "./file.d.mts"; +import def12 from "./file.d.json.ts"; +//// [file.d.js.ts] +declare var bad: "bad1"; +export default bad; +//// [file.d.jsx.ts] +declare var bad: "bad2"; +export default bad; +//// [file.d.ts.ts] +declare var bad: "bad3"; +export default bad; +//// [file.d.tsx.ts] +declare var bad: "bad4"; +export default bad; +//// [file.d.mjs.ts] +declare var bad: "bad5"; +export default bad; +//// [file.d.cjs.ts] +declare var bad: "bad6"; +export default bad; +//// [file.d.mts.ts] +declare var bad: "bad7"; +export default bad; +//// [file.d.cts.ts] +declare var bad: "bad8"; +export default bad; +//// [file.d.d.ts.ts] +declare var bad: "bad9"; +export default bad; +//// [file.d.d.mts.ts] +declare var bad: "bad10"; +export default bad; +//// [file.d.d.cts.ts] +declare var bad: "bad11"; +export default bad; +//// [file.d.d.json.ts] +declare var bad: "bad12"; +export default bad; + +//// [main.js] +export {}; diff --git a/tests/baselines/reference/declarationFileForTsJsImport(module=node20).symbols b/tests/baselines/reference/declarationFileForTsJsImport(module=node20).symbols new file mode 100644 index 0000000000000..e94d8d5321583 --- /dev/null +++ b/tests/baselines/reference/declarationFileForTsJsImport(module=node20).symbols @@ -0,0 +1,123 @@ +//// [tests/cases/conformance/nonjsExtensions/declarationFileForTsJsImport.ts] //// + +=== main.ts === +import def1 from "./file.js"; +>def1 : Symbol(def1, Decl(main.ts, 0, 6)) + +import def2 from "./file.jsx"; +>def2 : Symbol(def2, Decl(main.ts, 1, 6)) + +import def3 from "./file.ts"; +>def3 : Symbol(def3, Decl(main.ts, 2, 6)) + +import def4 from "./file.tsx"; +>def4 : Symbol(def4, Decl(main.ts, 3, 6)) + +import def5 from "./file.mjs"; +>def5 : Symbol(def5, Decl(main.ts, 4, 6)) + +import def6 from "./file.cjs"; +>def6 : Symbol(def6, Decl(main.ts, 5, 6)) + +import def7 from "./file.mts"; +>def7 : Symbol(def7, Decl(main.ts, 6, 6)) + +import def8 from "./file.cts"; +>def8 : Symbol(def8, Decl(main.ts, 7, 6)) + +import def9 from "./file.d.ts"; +>def9 : Symbol(def9, Decl(main.ts, 8, 6)) + +import def10 from "./file.d.cts"; +>def10 : Symbol(def10, Decl(main.ts, 9, 6)) + +import def11 from "./file.d.mts"; +>def11 : Symbol(def11, Decl(main.ts, 10, 6)) + +import def12 from "./file.d.json.ts"; +>def12 : Symbol(def12, Decl(main.ts, 11, 6)) + +=== file.d.js.ts === +declare var bad: "bad1"; +>bad : Symbol(bad, Decl(file.d.js.ts, 0, 11)) + +export default bad; +>bad : Symbol(bad, Decl(file.d.js.ts, 0, 11)) + +=== file.d.jsx.ts === +declare var bad: "bad2"; +>bad : Symbol(bad, Decl(file.d.jsx.ts, 0, 11)) + +export default bad; +>bad : Symbol(bad, Decl(file.d.jsx.ts, 0, 11)) + +=== file.d.ts.ts === +declare var bad: "bad3"; +>bad : Symbol(bad, Decl(file.d.ts.ts, 0, 11)) + +export default bad; +>bad : Symbol(bad, Decl(file.d.ts.ts, 0, 11)) + +=== file.d.tsx.ts === +declare var bad: "bad4"; +>bad : Symbol(bad, Decl(file.d.tsx.ts, 0, 11)) + +export default bad; +>bad : Symbol(bad, Decl(file.d.tsx.ts, 0, 11)) + +=== file.d.mjs.ts === +declare var bad: "bad5"; +>bad : Symbol(bad, Decl(file.d.mjs.ts, 0, 11)) + +export default bad; +>bad : Symbol(bad, Decl(file.d.mjs.ts, 0, 11)) + +=== file.d.cjs.ts === +declare var bad: "bad6"; +>bad : Symbol(bad, Decl(file.d.cjs.ts, 0, 11)) + +export default bad; +>bad : Symbol(bad, Decl(file.d.cjs.ts, 0, 11)) + +=== file.d.mts.ts === +declare var bad: "bad7"; +>bad : Symbol(bad, Decl(file.d.mts.ts, 0, 11)) + +export default bad; +>bad : Symbol(bad, Decl(file.d.mts.ts, 0, 11)) + +=== file.d.cts.ts === +declare var bad: "bad8"; +>bad : Symbol(bad, Decl(file.d.cts.ts, 0, 11)) + +export default bad; +>bad : Symbol(bad, Decl(file.d.cts.ts, 0, 11)) + +=== file.d.d.ts.ts === +declare var bad: "bad9"; +>bad : Symbol(bad, Decl(file.d.d.ts.ts, 0, 11)) + +export default bad; +>bad : Symbol(bad, Decl(file.d.d.ts.ts, 0, 11)) + +=== file.d.d.mts.ts === +declare var bad: "bad10"; +>bad : Symbol(bad, Decl(file.d.d.mts.ts, 0, 11)) + +export default bad; +>bad : Symbol(bad, Decl(file.d.d.mts.ts, 0, 11)) + +=== file.d.d.cts.ts === +declare var bad: "bad11"; +>bad : Symbol(bad, Decl(file.d.d.cts.ts, 0, 11)) + +export default bad; +>bad : Symbol(bad, Decl(file.d.d.cts.ts, 0, 11)) + +=== file.d.d.json.ts === +declare var bad: "bad12"; +>bad : Symbol(bad, Decl(file.d.d.json.ts, 0, 11)) + +export default bad; +>bad : Symbol(bad, Decl(file.d.d.json.ts, 0, 11)) + diff --git a/tests/baselines/reference/declarationFileForTsJsImport(module=node20).types b/tests/baselines/reference/declarationFileForTsJsImport(module=node20).types new file mode 100644 index 0000000000000..1a1aadcb795a1 --- /dev/null +++ b/tests/baselines/reference/declarationFileForTsJsImport(module=node20).types @@ -0,0 +1,159 @@ +//// [tests/cases/conformance/nonjsExtensions/declarationFileForTsJsImport.ts] //// + +=== main.ts === +import def1 from "./file.js"; +>def1 : any +> : ^^^ + +import def2 from "./file.jsx"; +>def2 : any +> : ^^^ + +import def3 from "./file.ts"; +>def3 : any +> : ^^^ + +import def4 from "./file.tsx"; +>def4 : any +> : ^^^ + +import def5 from "./file.mjs"; +>def5 : any +> : ^^^ + +import def6 from "./file.cjs"; +>def6 : any +> : ^^^ + +import def7 from "./file.mts"; +>def7 : any +> : ^^^ + +import def8 from "./file.cts"; +>def8 : any +> : ^^^ + +import def9 from "./file.d.ts"; +>def9 : any +> : ^^^ + +import def10 from "./file.d.cts"; +>def10 : any +> : ^^^ + +import def11 from "./file.d.mts"; +>def11 : any +> : ^^^ + +import def12 from "./file.d.json.ts"; +>def12 : any +> : ^^^ + +=== file.d.js.ts === +declare var bad: "bad1"; +>bad : "bad1" +> : ^^^^^^ + +export default bad; +>bad : "bad1" +> : ^^^^^^ + +=== file.d.jsx.ts === +declare var bad: "bad2"; +>bad : "bad2" +> : ^^^^^^ + +export default bad; +>bad : "bad2" +> : ^^^^^^ + +=== file.d.ts.ts === +declare var bad: "bad3"; +>bad : "bad3" +> : ^^^^^^ + +export default bad; +>bad : "bad3" +> : ^^^^^^ + +=== file.d.tsx.ts === +declare var bad: "bad4"; +>bad : "bad4" +> : ^^^^^^ + +export default bad; +>bad : "bad4" +> : ^^^^^^ + +=== file.d.mjs.ts === +declare var bad: "bad5"; +>bad : "bad5" +> : ^^^^^^ + +export default bad; +>bad : "bad5" +> : ^^^^^^ + +=== file.d.cjs.ts === +declare var bad: "bad6"; +>bad : "bad6" +> : ^^^^^^ + +export default bad; +>bad : "bad6" +> : ^^^^^^ + +=== file.d.mts.ts === +declare var bad: "bad7"; +>bad : "bad7" +> : ^^^^^^ + +export default bad; +>bad : "bad7" +> : ^^^^^^ + +=== file.d.cts.ts === +declare var bad: "bad8"; +>bad : "bad8" +> : ^^^^^^ + +export default bad; +>bad : "bad8" +> : ^^^^^^ + +=== file.d.d.ts.ts === +declare var bad: "bad9"; +>bad : "bad9" +> : ^^^^^^ + +export default bad; +>bad : "bad9" +> : ^^^^^^ + +=== file.d.d.mts.ts === +declare var bad: "bad10"; +>bad : "bad10" +> : ^^^^^^^ + +export default bad; +>bad : "bad10" +> : ^^^^^^^ + +=== file.d.d.cts.ts === +declare var bad: "bad11"; +>bad : "bad11" +> : ^^^^^^^ + +export default bad; +>bad : "bad11" +> : ^^^^^^^ + +=== file.d.d.json.ts === +declare var bad: "bad12"; +>bad : "bad12" +> : ^^^^^^^ + +export default bad; +>bad : "bad12" +> : ^^^^^^^ + diff --git a/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=false,module=node20).errors.txt b/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=false,module=node20).errors.txt new file mode 100644 index 0000000000000..04c3dfd21db95 --- /dev/null +++ b/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=false,module=node20).errors.txt @@ -0,0 +1,15 @@ +main.ts(1,22): error TS6263: Module './dir/native.node' was resolved to 'dir/native.d.node.ts', but '--allowArbitraryExtensions' is not set. + + +==== main.ts (1 errors) ==== + import mod = require("./dir/native.node"); + ~~~~~~~~~~~~~~~~~~~ +!!! error TS6263: Module './dir/native.node' was resolved to 'dir/native.d.node.ts', but '--allowArbitraryExtensions' is not set. + mod.doNativeThing("good"); + +==== package.json (0 errors) ==== + {"type": "module"} +==== dir/package.json (0 errors) ==== + {"type": "commonjs"} +==== dir/native.d.node.ts (0 errors) ==== + export function doNativeThing(flag: string): unknown; \ No newline at end of file diff --git a/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=false,module=node20).js b/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=false,module=node20).js new file mode 100644 index 0000000000000..0db936c68b811 --- /dev/null +++ b/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=false,module=node20).js @@ -0,0 +1,18 @@ +//// [tests/cases/conformance/nonjsExtensions/declarationFilesForNodeNativeModules.ts] //// + +//// [package.json] +{"type": "module"} +//// [package.json] +{"type": "commonjs"} +//// [native.d.node.ts] +export function doNativeThing(flag: string): unknown; +//// [main.ts] +import mod = require("./dir/native.node"); +mod.doNativeThing("good"); + + +//// [main.js] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +const mod = __require("./dir/native.node"); +mod.doNativeThing("good"); diff --git a/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=false,module=node20).symbols b/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=false,module=node20).symbols new file mode 100644 index 0000000000000..ea430da48c093 --- /dev/null +++ b/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=false,module=node20).symbols @@ -0,0 +1,9 @@ +//// [tests/cases/conformance/nonjsExtensions/declarationFilesForNodeNativeModules.ts] //// + +=== main.ts === +import mod = require("./dir/native.node"); +>mod : Symbol(mod, Decl(main.ts, 0, 0)) + +mod.doNativeThing("good"); +>mod : Symbol(mod, Decl(main.ts, 0, 0)) + diff --git a/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=false,module=node20).types b/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=false,module=node20).types new file mode 100644 index 0000000000000..8374dbda79e3d --- /dev/null +++ b/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=false,module=node20).types @@ -0,0 +1,19 @@ +//// [tests/cases/conformance/nonjsExtensions/declarationFilesForNodeNativeModules.ts] //// + +=== main.ts === +import mod = require("./dir/native.node"); +>mod : any +> : ^^^ + +mod.doNativeThing("good"); +>mod.doNativeThing("good") : any +> : ^^^ +>mod.doNativeThing : any +> : ^^^ +>mod : any +> : ^^^ +>doNativeThing : any +> : ^^^ +>"good" : "good" +> : ^^^^^^ + diff --git a/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=true,module=node20).js b/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=true,module=node20).js new file mode 100644 index 0000000000000..0db936c68b811 --- /dev/null +++ b/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=true,module=node20).js @@ -0,0 +1,18 @@ +//// [tests/cases/conformance/nonjsExtensions/declarationFilesForNodeNativeModules.ts] //// + +//// [package.json] +{"type": "module"} +//// [package.json] +{"type": "commonjs"} +//// [native.d.node.ts] +export function doNativeThing(flag: string): unknown; +//// [main.ts] +import mod = require("./dir/native.node"); +mod.doNativeThing("good"); + + +//// [main.js] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +const mod = __require("./dir/native.node"); +mod.doNativeThing("good"); diff --git a/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=true,module=node20).symbols b/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=true,module=node20).symbols new file mode 100644 index 0000000000000..dbe22cfd2c152 --- /dev/null +++ b/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=true,module=node20).symbols @@ -0,0 +1,16 @@ +//// [tests/cases/conformance/nonjsExtensions/declarationFilesForNodeNativeModules.ts] //// + +=== main.ts === +import mod = require("./dir/native.node"); +>mod : Symbol(mod, Decl(main.ts, 0, 0)) + +mod.doNativeThing("good"); +>mod.doNativeThing : Symbol(mod.doNativeThing, Decl(native.d.node.ts, 0, 0)) +>mod : Symbol(mod, Decl(main.ts, 0, 0)) +>doNativeThing : Symbol(mod.doNativeThing, Decl(native.d.node.ts, 0, 0)) + +=== dir/native.d.node.ts === +export function doNativeThing(flag: string): unknown; +>doNativeThing : Symbol(doNativeThing, Decl(native.d.node.ts, 0, 0)) +>flag : Symbol(flag, Decl(native.d.node.ts, 0, 30)) + diff --git a/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=true,module=node20).types b/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=true,module=node20).types new file mode 100644 index 0000000000000..15f33fb70a207 --- /dev/null +++ b/tests/baselines/reference/declarationFilesForNodeNativeModules(allowarbitraryextensions=true,module=node20).types @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/nonjsExtensions/declarationFilesForNodeNativeModules.ts] //// + +=== main.ts === +import mod = require("./dir/native.node"); +>mod : typeof mod +> : ^^^^^^^^^^ + +mod.doNativeThing("good"); +>mod.doNativeThing("good") : unknown +> : ^^^^^^^ +>mod.doNativeThing : (flag: string) => unknown +> : ^ ^^ ^^^^^ +>mod : typeof mod +> : ^^^^^^^^^^ +>doNativeThing : (flag: string) => unknown +> : ^ ^^ ^^^^^ +>"good" : "good" +> : ^^^^^^ + +=== dir/native.d.node.ts === +export function doNativeThing(flag: string): unknown; +>doNativeThing : (flag: string) => unknown +> : ^ ^^ ^^^^^ +>flag : string +> : ^^^^^^ + diff --git a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node20).errors.txt b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node20).errors.txt new file mode 100644 index 0000000000000..07470d26af612 --- /dev/null +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node20).errors.txt @@ -0,0 +1,14 @@ +error TS5070: Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'. +error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node20'. + + +!!! error TS5070: Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'. +!!! error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node20'. +==== a.ts (0 errors) ==== + declare var dec: any, __decorate: any; + @dec export class A { + } + + const o = { a: 1 }; + const y = { ...o }; + \ No newline at end of file diff --git a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node20).js b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node20).js new file mode 100644 index 0000000000000..47204b7a76f30 --- /dev/null +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node20).js @@ -0,0 +1,26 @@ +//// [tests/cases/compiler/emitHelpersWithLocalCollisions.ts] //// + +//// [a.ts] +declare var dec: any, __decorate: any; +@dec export class A { +} + +const o = { a: 1 }; +const y = { ...o }; + + +//// [a.js] +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +let A = class A { +}; +A = __decorate([ + dec +], A); +export { A }; +const o = { a: 1 }; +const y = Object.assign({}, o); diff --git a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=nodenext).errors.txt b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=nodenext).errors.txt index 4b7e63ced908d..3537cb1753855 100644 --- a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=nodenext).errors.txt +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=nodenext).errors.txt @@ -1,6 +1,8 @@ +error TS5070: Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'. error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. +!!! error TS5070: Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'. !!! error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. ==== a.ts (0 errors) ==== declare var dec: any, __decorate: any; diff --git a/tests/baselines/reference/esmModuleExports1.errors.txt b/tests/baselines/reference/esmModuleExports1.errors.txt new file mode 100644 index 0000000000000..b16dc4624aca1 --- /dev/null +++ b/tests/baselines/reference/esmModuleExports1.errors.txt @@ -0,0 +1,24 @@ +/importer-cts.cts(10,10): error TS2614: Module '"./exporter.mjs"' has no exported member 'Oops'. Did you mean to use 'import Oops from "./exporter.mjs"' instead? + + +==== /importer-cjs.cjs (0 errors) ==== + const Foo = require("./exporter.mjs"); + new Foo(); + +==== /importer-cts.cts (1 errors) ==== + import Foo = require("./exporter.mjs"); + new Foo(); + + import Foo2 from "./exporter.mjs"; + new Foo2(); + + import * as Foo3 from "./exporter.mjs"; + new Foo3(); + + import { Oops } from "./exporter.mjs"; + ~~~~ +!!! error TS2614: Module '"./exporter.mjs"' has no exported member 'Oops'. Did you mean to use 'import Oops from "./exporter.mjs"' instead? + +==== /exporter.mts (0 errors) ==== + export default class Foo {} + export { Foo as "module.exports" }; \ No newline at end of file diff --git a/tests/baselines/reference/esmModuleExports1.symbols b/tests/baselines/reference/esmModuleExports1.symbols new file mode 100644 index 0000000000000..402ceeeb087c1 --- /dev/null +++ b/tests/baselines/reference/esmModuleExports1.symbols @@ -0,0 +1,41 @@ +//// [tests/cases/conformance/node/esmModuleExports1.ts] //// + +=== /importer-cjs.cjs === +const Foo = require("./exporter.mjs"); +>Foo : Symbol(Foo, Decl(importer-cjs.cjs, 0, 5)) +>require : Symbol(require) +>"./exporter.mjs" : Symbol("/exporter", Decl(exporter.mts, 0, 0)) + +new Foo(); +>Foo : Symbol(Foo, Decl(importer-cjs.cjs, 0, 5)) + +=== /importer-cts.cts === +import Foo = require("./exporter.mjs"); +>Foo : Symbol(Foo, Decl(importer-cts.cts, 0, 0)) + +new Foo(); +>Foo : Symbol(Foo, Decl(importer-cts.cts, 0, 0)) + +import Foo2 from "./exporter.mjs"; +>Foo2 : Symbol(Foo2, Decl(importer-cts.cts, 3, 6)) + +new Foo2(); +>Foo2 : Symbol(Foo2, Decl(importer-cts.cts, 3, 6)) + +import * as Foo3 from "./exporter.mjs"; +>Foo3 : Symbol(Foo3, Decl(importer-cts.cts, 6, 6)) + +new Foo3(); +>Foo3 : Symbol(Foo3, Decl(importer-cts.cts, 6, 6)) + +import { Oops } from "./exporter.mjs"; +>Oops : Symbol(Oops, Decl(importer-cts.cts, 9, 8)) + +=== /exporter.mts === +export default class Foo {} +>Foo : Symbol(Foo, Decl(exporter.mts, 0, 0)) + +export { Foo as "module.exports" }; +>Foo : Symbol(Foo, Decl(exporter.mts, 0, 0)) +>"module.exports" : Symbol("module.exports", Decl(exporter.mts, 1, 8)) + diff --git a/tests/baselines/reference/esmModuleExports1.types b/tests/baselines/reference/esmModuleExports1.types new file mode 100644 index 0000000000000..99cb595abfc6a --- /dev/null +++ b/tests/baselines/reference/esmModuleExports1.types @@ -0,0 +1,65 @@ +//// [tests/cases/conformance/node/esmModuleExports1.ts] //// + +=== /importer-cjs.cjs === +const Foo = require("./exporter.mjs"); +>Foo : typeof Foo +> : ^^^^^^^^^^ +>require("./exporter.mjs") : typeof import("/exporter", { with: { "resolution-mode": "import" } }) +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>require : any +> : ^^^ +>"./exporter.mjs" : "./exporter.mjs" +> : ^^^^^^^^^^^^^^^^ + +new Foo(); +>new Foo() : Foo +> : ^^^ +>Foo : typeof Foo +> : ^^^^^^^^^^ + +=== /importer-cts.cts === +import Foo = require("./exporter.mjs"); +>Foo : typeof Foo +> : ^^^^^^^^^^ + +new Foo(); +>new Foo() : Foo +> : ^^^ +>Foo : typeof Foo +> : ^^^^^^^^^^ + +import Foo2 from "./exporter.mjs"; +>Foo2 : typeof Foo +> : ^^^^^^^^^^ + +new Foo2(); +>new Foo2() : Foo +> : ^^^ +>Foo2 : typeof Foo +> : ^^^^^^^^^^ + +import * as Foo3 from "./exporter.mjs"; +>Foo3 : typeof Foo +> : ^^^^^^^^^^ + +new Foo3(); +>new Foo3() : Foo +> : ^^^ +>Foo3 : typeof Foo +> : ^^^^^^^^^^ + +import { Oops } from "./exporter.mjs"; +>Oops : any +> : ^^^ + +=== /exporter.mts === +export default class Foo {} +>Foo : Foo +> : ^^^ + +export { Foo as "module.exports" }; +>Foo : typeof Foo +> : ^^^^^^^^^^ +>"module.exports" : typeof Foo +> : ^^^^^^^^^^ + diff --git a/tests/baselines/reference/esmModuleExports2(esmoduleinterop=false).errors.txt b/tests/baselines/reference/esmModuleExports2(esmoduleinterop=false).errors.txt new file mode 100644 index 0000000000000..ad250e2728344 --- /dev/null +++ b/tests/baselines/reference/esmModuleExports2(esmoduleinterop=false).errors.txt @@ -0,0 +1,43 @@ +/importer-cjs.cjs(2,5): error TS2351: This expression is not constructable. + Type 'String' has no construct signatures. +/importer-cts.cts(2,5): error TS2351: This expression is not constructable. + Type 'String' has no construct signatures. +/importer-cts.cts(4,8): error TS1259: Module '"/exporter"' can only be default-imported using the 'esModuleInterop' flag +/importer-cts.cts(8,5): error TS2351: This expression is not constructable. + Type 'String' has no construct signatures. +/importer-cts.cts(10,10): error TS2614: Module '"./exporter.mjs"' has no exported member 'Oops'. Did you mean to use 'import Oops from "./exporter.mjs"' instead? + + +==== /importer-cjs.cjs (1 errors) ==== + const Foo = require("./exporter.mjs"); + new Foo(); + ~~~ +!!! error TS2351: This expression is not constructable. +!!! error TS2351: Type 'String' has no construct signatures. + +==== /importer-cts.cts (4 errors) ==== + import Foo = require("./exporter.mjs"); + new Foo(); + ~~~ +!!! error TS2351: This expression is not constructable. +!!! error TS2351: Type 'String' has no construct signatures. + + import Foo2 from "./exporter.mjs"; + ~~~~ +!!! error TS1259: Module '"/exporter"' can only be default-imported using the 'esModuleInterop' flag + new Foo2(); + + import * as Foo3 from "./exporter.mjs"; + new Foo3(); + ~~~~ +!!! error TS2351: This expression is not constructable. +!!! error TS2351: Type 'String' has no construct signatures. + + import { Oops } from "./exporter.mjs"; + ~~~~ +!!! error TS2614: Module '"./exporter.mjs"' has no exported member 'Oops'. Did you mean to use 'import Oops from "./exporter.mjs"' instead? + +==== /exporter.mts (0 errors) ==== + export default class Foo {} + const oops = "oops"; + export { oops as "module.exports" }; \ No newline at end of file diff --git a/tests/baselines/reference/esmModuleExports2(esmoduleinterop=false).symbols b/tests/baselines/reference/esmModuleExports2(esmoduleinterop=false).symbols new file mode 100644 index 0000000000000..4bb8d4d0dfd7b --- /dev/null +++ b/tests/baselines/reference/esmModuleExports2(esmoduleinterop=false).symbols @@ -0,0 +1,44 @@ +//// [tests/cases/conformance/node/esmModuleExports2.ts] //// + +=== /importer-cjs.cjs === +const Foo = require("./exporter.mjs"); +>Foo : Symbol(Foo, Decl(importer-cjs.cjs, 0, 5)) +>require : Symbol(require) +>"./exporter.mjs" : Symbol("/exporter", Decl(exporter.mts, 0, 0)) + +new Foo(); +>Foo : Symbol(Foo, Decl(importer-cjs.cjs, 0, 5)) + +=== /importer-cts.cts === +import Foo = require("./exporter.mjs"); +>Foo : Symbol(Foo, Decl(importer-cts.cts, 0, 0)) + +new Foo(); +>Foo : Symbol(Foo, Decl(importer-cts.cts, 0, 0)) + +import Foo2 from "./exporter.mjs"; +>Foo2 : Symbol(Foo2, Decl(importer-cts.cts, 3, 6)) + +new Foo2(); +>Foo2 : Symbol(Foo2, Decl(importer-cts.cts, 3, 6)) + +import * as Foo3 from "./exporter.mjs"; +>Foo3 : Symbol(Foo3, Decl(importer-cts.cts, 6, 6)) + +new Foo3(); +>Foo3 : Symbol(Foo3, Decl(importer-cts.cts, 6, 6)) + +import { Oops } from "./exporter.mjs"; +>Oops : Symbol(Oops, Decl(importer-cts.cts, 9, 8)) + +=== /exporter.mts === +export default class Foo {} +>Foo : Symbol(Foo, Decl(exporter.mts, 0, 0)) + +const oops = "oops"; +>oops : Symbol(oops, Decl(exporter.mts, 1, 5)) + +export { oops as "module.exports" }; +>oops : Symbol(oops, Decl(exporter.mts, 1, 5)) +>"module.exports" : Symbol("module.exports", Decl(exporter.mts, 2, 8)) + diff --git a/tests/baselines/reference/esmModuleExports2(esmoduleinterop=false).types b/tests/baselines/reference/esmModuleExports2(esmoduleinterop=false).types new file mode 100644 index 0000000000000..4539e2949f35d --- /dev/null +++ b/tests/baselines/reference/esmModuleExports2(esmoduleinterop=false).types @@ -0,0 +1,71 @@ +//// [tests/cases/conformance/node/esmModuleExports2.ts] //// + +=== /importer-cjs.cjs === +const Foo = require("./exporter.mjs"); +>Foo : "oops" +> : ^^^^^^ +>require("./exporter.mjs") : typeof import("/exporter", { with: { "resolution-mode": "import" } }) +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>require : any +> : ^^^ +>"./exporter.mjs" : "./exporter.mjs" +> : ^^^^^^^^^^^^^^^^ + +new Foo(); +>new Foo() : any +> : ^^^ +>Foo : "oops" +> : ^^^^^^ + +=== /importer-cts.cts === +import Foo = require("./exporter.mjs"); +>Foo : "oops" +> : ^^^^^^ + +new Foo(); +>new Foo() : any +> : ^^^ +>Foo : "oops" +> : ^^^^^^ + +import Foo2 from "./exporter.mjs"; +>Foo2 : any +> : ^^^ + +new Foo2(); +>new Foo2() : any +> : ^^^ +>Foo2 : any +> : ^^^ + +import * as Foo3 from "./exporter.mjs"; +>Foo3 : "oops" +> : ^^^^^^ + +new Foo3(); +>new Foo3() : any +> : ^^^ +>Foo3 : "oops" +> : ^^^^^^ + +import { Oops } from "./exporter.mjs"; +>Oops : any +> : ^^^ + +=== /exporter.mts === +export default class Foo {} +>Foo : Foo +> : ^^^ + +const oops = "oops"; +>oops : "oops" +> : ^^^^^^ +>"oops" : "oops" +> : ^^^^^^ + +export { oops as "module.exports" }; +>oops : "oops" +> : ^^^^^^ +>"module.exports" : "oops" +> : ^^^^^^ + diff --git a/tests/baselines/reference/esmModuleExports2(esmoduleinterop=true).errors.txt b/tests/baselines/reference/esmModuleExports2(esmoduleinterop=true).errors.txt new file mode 100644 index 0000000000000..a31f9bf4c203d --- /dev/null +++ b/tests/baselines/reference/esmModuleExports2(esmoduleinterop=true).errors.txt @@ -0,0 +1,45 @@ +/importer-cjs.cjs(2,5): error TS2351: This expression is not constructable. + Type 'String' has no construct signatures. +/importer-cts.cts(2,5): error TS2351: This expression is not constructable. + Type 'String' has no construct signatures. +/importer-cts.cts(5,5): error TS2351: This expression is not constructable. + Type 'String' has no construct signatures. +/importer-cts.cts(8,5): error TS2351: This expression is not constructable. + Type 'String' has no construct signatures. +/importer-cts.cts(10,10): error TS2614: Module '"./exporter.mjs"' has no exported member 'Oops'. Did you mean to use 'import Oops from "./exporter.mjs"' instead? + + +==== /importer-cjs.cjs (1 errors) ==== + const Foo = require("./exporter.mjs"); + new Foo(); + ~~~ +!!! error TS2351: This expression is not constructable. +!!! error TS2351: Type 'String' has no construct signatures. + +==== /importer-cts.cts (4 errors) ==== + import Foo = require("./exporter.mjs"); + new Foo(); + ~~~ +!!! error TS2351: This expression is not constructable. +!!! error TS2351: Type 'String' has no construct signatures. + + import Foo2 from "./exporter.mjs"; + new Foo2(); + ~~~~ +!!! error TS2351: This expression is not constructable. +!!! error TS2351: Type 'String' has no construct signatures. + + import * as Foo3 from "./exporter.mjs"; + new Foo3(); + ~~~~ +!!! error TS2351: This expression is not constructable. +!!! error TS2351: Type 'String' has no construct signatures. + + import { Oops } from "./exporter.mjs"; + ~~~~ +!!! error TS2614: Module '"./exporter.mjs"' has no exported member 'Oops'. Did you mean to use 'import Oops from "./exporter.mjs"' instead? + +==== /exporter.mts (0 errors) ==== + export default class Foo {} + const oops = "oops"; + export { oops as "module.exports" }; \ No newline at end of file diff --git a/tests/baselines/reference/esmModuleExports2(esmoduleinterop=true).symbols b/tests/baselines/reference/esmModuleExports2(esmoduleinterop=true).symbols new file mode 100644 index 0000000000000..4bb8d4d0dfd7b --- /dev/null +++ b/tests/baselines/reference/esmModuleExports2(esmoduleinterop=true).symbols @@ -0,0 +1,44 @@ +//// [tests/cases/conformance/node/esmModuleExports2.ts] //// + +=== /importer-cjs.cjs === +const Foo = require("./exporter.mjs"); +>Foo : Symbol(Foo, Decl(importer-cjs.cjs, 0, 5)) +>require : Symbol(require) +>"./exporter.mjs" : Symbol("/exporter", Decl(exporter.mts, 0, 0)) + +new Foo(); +>Foo : Symbol(Foo, Decl(importer-cjs.cjs, 0, 5)) + +=== /importer-cts.cts === +import Foo = require("./exporter.mjs"); +>Foo : Symbol(Foo, Decl(importer-cts.cts, 0, 0)) + +new Foo(); +>Foo : Symbol(Foo, Decl(importer-cts.cts, 0, 0)) + +import Foo2 from "./exporter.mjs"; +>Foo2 : Symbol(Foo2, Decl(importer-cts.cts, 3, 6)) + +new Foo2(); +>Foo2 : Symbol(Foo2, Decl(importer-cts.cts, 3, 6)) + +import * as Foo3 from "./exporter.mjs"; +>Foo3 : Symbol(Foo3, Decl(importer-cts.cts, 6, 6)) + +new Foo3(); +>Foo3 : Symbol(Foo3, Decl(importer-cts.cts, 6, 6)) + +import { Oops } from "./exporter.mjs"; +>Oops : Symbol(Oops, Decl(importer-cts.cts, 9, 8)) + +=== /exporter.mts === +export default class Foo {} +>Foo : Symbol(Foo, Decl(exporter.mts, 0, 0)) + +const oops = "oops"; +>oops : Symbol(oops, Decl(exporter.mts, 1, 5)) + +export { oops as "module.exports" }; +>oops : Symbol(oops, Decl(exporter.mts, 1, 5)) +>"module.exports" : Symbol("module.exports", Decl(exporter.mts, 2, 8)) + diff --git a/tests/baselines/reference/esmModuleExports2(esmoduleinterop=true).types b/tests/baselines/reference/esmModuleExports2(esmoduleinterop=true).types new file mode 100644 index 0000000000000..b63e6dd802e5f --- /dev/null +++ b/tests/baselines/reference/esmModuleExports2(esmoduleinterop=true).types @@ -0,0 +1,71 @@ +//// [tests/cases/conformance/node/esmModuleExports2.ts] //// + +=== /importer-cjs.cjs === +const Foo = require("./exporter.mjs"); +>Foo : "oops" +> : ^^^^^^ +>require("./exporter.mjs") : typeof import("/exporter", { with: { "resolution-mode": "import" } }) +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>require : any +> : ^^^ +>"./exporter.mjs" : "./exporter.mjs" +> : ^^^^^^^^^^^^^^^^ + +new Foo(); +>new Foo() : any +> : ^^^ +>Foo : "oops" +> : ^^^^^^ + +=== /importer-cts.cts === +import Foo = require("./exporter.mjs"); +>Foo : "oops" +> : ^^^^^^ + +new Foo(); +>new Foo() : any +> : ^^^ +>Foo : "oops" +> : ^^^^^^ + +import Foo2 from "./exporter.mjs"; +>Foo2 : "oops" +> : ^^^^^^ + +new Foo2(); +>new Foo2() : any +> : ^^^ +>Foo2 : "oops" +> : ^^^^^^ + +import * as Foo3 from "./exporter.mjs"; +>Foo3 : "oops" +> : ^^^^^^ + +new Foo3(); +>new Foo3() : any +> : ^^^ +>Foo3 : "oops" +> : ^^^^^^ + +import { Oops } from "./exporter.mjs"; +>Oops : any +> : ^^^ + +=== /exporter.mts === +export default class Foo {} +>Foo : Foo +> : ^^^ + +const oops = "oops"; +>oops : "oops" +> : ^^^^^^ +>"oops" : "oops" +> : ^^^^^^ + +export { oops as "module.exports" }; +>oops : "oops" +> : ^^^^^^ +>"module.exports" : "oops" +> : ^^^^^^ + diff --git a/tests/baselines/reference/esmModuleExports3.errors.txt b/tests/baselines/reference/esmModuleExports3.errors.txt new file mode 100644 index 0000000000000..c55cdee708bef --- /dev/null +++ b/tests/baselines/reference/esmModuleExports3.errors.txt @@ -0,0 +1,41 @@ +/importer-cjs.cjs(2,5): error TS1362: 'Foo' cannot be used as a value because it was exported using 'export type'. +/importer-cts.cts(2,5): error TS1362: 'Foo' cannot be used as a value because it was exported using 'export type'. +/importer-cts.cts(5,5): error TS1362: 'Foo2' cannot be used as a value because it was exported using 'export type'. +/importer-cts.cts(8,5): error TS1362: 'Foo3' cannot be used as a value because it was exported using 'export type'. +/importer-cts.cts(10,10): error TS2614: Module '"./exporter.mjs"' has no exported member 'Oops'. Did you mean to use 'import Oops from "./exporter.mjs"' instead? + + +==== /importer-cjs.cjs (1 errors) ==== + const Foo = require("./exporter.mjs"); + new Foo(); + ~~~ +!!! error TS1362: 'Foo' cannot be used as a value because it was exported using 'export type'. +!!! related TS1377 /exporter.mts:2:15: 'Foo' was exported here. + +==== /importer-cts.cts (4 errors) ==== + import Foo = require("./exporter.mjs"); + new Foo(); + ~~~ +!!! error TS1362: 'Foo' cannot be used as a value because it was exported using 'export type'. +!!! related TS1377 /exporter.mts:2:15: 'Foo' was exported here. + + import Foo2 from "./exporter.mjs"; + new Foo2(); + ~~~~ +!!! error TS1362: 'Foo2' cannot be used as a value because it was exported using 'export type'. +!!! related TS1377 /exporter.mts:2:15: 'Foo2' was exported here. + + import * as Foo3 from "./exporter.mjs"; + new Foo3(); + ~~~~ +!!! error TS1362: 'Foo3' cannot be used as a value because it was exported using 'export type'. +!!! related TS1377 /exporter.mts:2:15: 'Foo3' was exported here. + + import { Oops } from "./exporter.mjs"; + ~~~~ +!!! error TS2614: Module '"./exporter.mjs"' has no exported member 'Oops'. Did you mean to use 'import Oops from "./exporter.mjs"' instead? + +==== /exporter.mts (0 errors) ==== + export default class Foo {} + export type { Foo as "module.exports" } + \ No newline at end of file diff --git a/tests/baselines/reference/esmModuleExports3.symbols b/tests/baselines/reference/esmModuleExports3.symbols new file mode 100644 index 0000000000000..e23df06c8781d --- /dev/null +++ b/tests/baselines/reference/esmModuleExports3.symbols @@ -0,0 +1,41 @@ +//// [tests/cases/conformance/node/esmModuleExports3.ts] //// + +=== /importer-cjs.cjs === +const Foo = require("./exporter.mjs"); +>Foo : Symbol(Foo, Decl(importer-cjs.cjs, 0, 5)) +>require : Symbol(require) +>"./exporter.mjs" : Symbol("/exporter", Decl(exporter.mts, 0, 0)) + +new Foo(); +>Foo : Symbol(Foo, Decl(importer-cjs.cjs, 0, 5)) + +=== /importer-cts.cts === +import Foo = require("./exporter.mjs"); +>Foo : Symbol(Foo, Decl(importer-cts.cts, 0, 0)) + +new Foo(); +>Foo : Symbol(Foo, Decl(importer-cts.cts, 0, 0)) + +import Foo2 from "./exporter.mjs"; +>Foo2 : Symbol(Foo2, Decl(importer-cts.cts, 3, 6)) + +new Foo2(); +>Foo2 : Symbol(Foo2, Decl(importer-cts.cts, 3, 6)) + +import * as Foo3 from "./exporter.mjs"; +>Foo3 : Symbol(Foo3, Decl(importer-cts.cts, 6, 6)) + +new Foo3(); +>Foo3 : Symbol(Foo3, Decl(importer-cts.cts, 6, 6)) + +import { Oops } from "./exporter.mjs"; +>Oops : Symbol(Oops, Decl(importer-cts.cts, 9, 8)) + +=== /exporter.mts === +export default class Foo {} +>Foo : Symbol(Foo, Decl(exporter.mts, 0, 0)) + +export type { Foo as "module.exports" } +>Foo : Symbol(Foo, Decl(exporter.mts, 0, 0)) +>"module.exports" : Symbol("module.exports", Decl(exporter.mts, 1, 13)) + diff --git a/tests/baselines/reference/esmModuleExports3.types b/tests/baselines/reference/esmModuleExports3.types new file mode 100644 index 0000000000000..631911ab5ed1d --- /dev/null +++ b/tests/baselines/reference/esmModuleExports3.types @@ -0,0 +1,65 @@ +//// [tests/cases/conformance/node/esmModuleExports3.ts] //// + +=== /importer-cjs.cjs === +const Foo = require("./exporter.mjs"); +>Foo : typeof Foo +> : ^^^^^^^^^^ +>require("./exporter.mjs") : typeof import("/exporter", { with: { "resolution-mode": "import" } }) +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>require : any +> : ^^^ +>"./exporter.mjs" : "./exporter.mjs" +> : ^^^^^^^^^^^^^^^^ + +new Foo(); +>new Foo() : Foo +> : ^^^ +>Foo : typeof Foo +> : ^^^^^^^^^^ + +=== /importer-cts.cts === +import Foo = require("./exporter.mjs"); +>Foo : typeof Foo +> : ^^^^^^^^^^ + +new Foo(); +>new Foo() : Foo +> : ^^^ +>Foo : typeof Foo +> : ^^^^^^^^^^ + +import Foo2 from "./exporter.mjs"; +>Foo2 : typeof Foo +> : ^^^^^^^^^^ + +new Foo2(); +>new Foo2() : Foo +> : ^^^ +>Foo2 : typeof Foo +> : ^^^^^^^^^^ + +import * as Foo3 from "./exporter.mjs"; +>Foo3 : typeof Foo +> : ^^^^^^^^^^ + +new Foo3(); +>new Foo3() : Foo +> : ^^^ +>Foo3 : typeof Foo +> : ^^^^^^^^^^ + +import { Oops } from "./exporter.mjs"; +>Oops : any +> : ^^^ + +=== /exporter.mts === +export default class Foo {} +>Foo : Foo +> : ^^^ + +export type { Foo as "module.exports" } +>Foo : typeof Foo +> : ^^^^^^^^^^ +>"module.exports" : typeof Foo +> : ^^^^^^^^^^ + diff --git a/tests/baselines/reference/importAssertion1(module=commonjs).errors.txt b/tests/baselines/reference/importAssertion1(module=commonjs).errors.txt index f68327654fdf1..96d411a196413 100644 --- a/tests/baselines/reference/importAssertion1(module=commonjs).errors.txt +++ b/tests/baselines/reference/importAssertion1(module=commonjs).errors.txt @@ -1,16 +1,16 @@ -1.ts(1,14): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(3,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -3.ts(2,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. -3.ts(3,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. -3.ts(4,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. -3.ts(5,26): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. -3.ts(7,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +1.ts(1,14): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(2,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(3,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(1,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(2,38): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +3.ts(2,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. +3.ts(3,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. +3.ts(4,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. +3.ts(5,26): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. +3.ts(7,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. 3.ts(8,11): message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments -3.ts(9,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. -3.ts(10,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +3.ts(9,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. +3.ts(10,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. 3.ts(10,52): error TS1009: Trailing comma not allowed. @@ -21,13 +21,13 @@ ==== 1.ts (3 errors) ==== import './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import { a, b } from './0' assert { "type": "json" } ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import * as foo from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. a; b; foo.a; @@ -36,10 +36,10 @@ ==== 2.ts (2 errors) ==== import { a, b } from './0' assert {} ~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import { a as c, b as d } from './0' assert { a: "a", b: "b", c: "c" } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. a; b; c; @@ -49,29 +49,29 @@ const a = import('./0') const b = import('./0', { assert: { type: "json" } }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. const c = import('./0', { assert: { type: "json", ttype: "typo" } }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. const d = import('./0', { assert: {} }) ~~~~~~~~~~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. const dd = import('./0', {}) ~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. declare function foo(): any; const e = import('./0', foo()) ~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. const f = import() ~~~~~~~~ !!! message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments const g = import('./0', {}, {}) ~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. const h = import('./0', { assert: { type: "json" }},) ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. ~ !!! error TS1009: Trailing comma not allowed. diff --git a/tests/baselines/reference/importAssertion1(module=es2015).errors.txt b/tests/baselines/reference/importAssertion1(module=es2015).errors.txt index 12ad1bcdf3f19..8d120f6aab05e 100644 --- a/tests/baselines/reference/importAssertion1(module=es2015).errors.txt +++ b/tests/baselines/reference/importAssertion1(module=es2015).errors.txt @@ -1,17 +1,17 @@ -1.ts(1,14): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(3,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -3.ts(1,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(2,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(3,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(4,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(5,12): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(7,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(8,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(9,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(10,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +1.ts(1,14): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(2,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(3,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(1,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(2,38): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +3.ts(1,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(2,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(3,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(4,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(5,12): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(7,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(8,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(9,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(10,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. ==== 0.ts (0 errors) ==== @@ -21,13 +21,13 @@ ==== 1.ts (3 errors) ==== import './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import { a, b } from './0' assert { "type": "json" } ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import * as foo from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. a; b; foo.a; @@ -36,10 +36,10 @@ ==== 2.ts (2 errors) ==== import { a, b } from './0' assert {} ~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import { a as c, b as d } from './0' assert { a: "a", b: "b", c: "c" } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. a; b; c; @@ -48,31 +48,31 @@ ==== 3.ts (9 errors) ==== const a = import('./0') ~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. const b = import('./0', { assert: { type: "json" } }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. const c = import('./0', { assert: { type: "json", ttype: "typo" } }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. const d = import('./0', { assert: {} }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. const dd = import('./0', {}) ~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. declare function foo(): any; const e = import('./0', foo()) ~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. const f = import() ~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. const g = import('./0', {}, {}) ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. const h = import('./0', { assert: { type: "json" }},) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. \ No newline at end of file diff --git a/tests/baselines/reference/importAssertion2(module=commonjs).errors.txt b/tests/baselines/reference/importAssertion2(module=commonjs).errors.txt index a83609d1f2b89..a71f6df42c13d 100644 --- a/tests/baselines/reference/importAssertion2(module=commonjs).errors.txt +++ b/tests/baselines/reference/importAssertion2(module=commonjs).errors.txt @@ -1,9 +1,9 @@ -1.ts(1,22): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(3,21): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(4,27): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +1.ts(1,22): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(2,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(3,21): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(4,27): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(1,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(2,38): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== 0.ts (0 errors) ==== @@ -13,22 +13,22 @@ ==== 1.ts (4 errors) ==== export {} from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export { a, b } from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export * from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export * as ns from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== 2.ts (2 errors) ==== export { a, b } from './0' assert {} ~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export { a as c, b as d } from './0' assert { a: "a", b: "b", c: "c" } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. \ No newline at end of file diff --git a/tests/baselines/reference/importAssertion2(module=es2015).errors.txt b/tests/baselines/reference/importAssertion2(module=es2015).errors.txt index a83609d1f2b89..a71f6df42c13d 100644 --- a/tests/baselines/reference/importAssertion2(module=es2015).errors.txt +++ b/tests/baselines/reference/importAssertion2(module=es2015).errors.txt @@ -1,9 +1,9 @@ -1.ts(1,22): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(3,21): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(4,27): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +1.ts(1,22): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(2,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(3,21): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(4,27): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(1,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(2,38): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== 0.ts (0 errors) ==== @@ -13,22 +13,22 @@ ==== 1.ts (4 errors) ==== export {} from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export { a, b } from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export * from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export * as ns from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== 2.ts (2 errors) ==== export { a, b } from './0' assert {} ~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export { a as c, b as d } from './0' assert { a: "a", b: "b", c: "c" } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. \ No newline at end of file diff --git a/tests/baselines/reference/importAssertion3(module=es2015).errors.txt b/tests/baselines/reference/importAssertion3(module=es2015).errors.txt index 5b353cb0b4be4..9ca5e660161ac 100644 --- a/tests/baselines/reference/importAssertion3(module=es2015).errors.txt +++ b/tests/baselines/reference/importAssertion3(module=es2015).errors.txt @@ -1,7 +1,7 @@ -1.ts(1,27): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(2,30): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(1,31): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(2,33): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +1.ts(1,27): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(2,30): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(1,31): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(2,33): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== 0.ts (0 errors) ==== @@ -10,17 +10,17 @@ ==== 1.ts (2 errors) ==== export type {} from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export type { I } from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== 2.ts (2 errors) ==== import type { I } from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import type * as foo from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes1(module=commonjs).errors.txt b/tests/baselines/reference/importAttributes1(module=commonjs).errors.txt index 78849639e48e7..6f48644fe547c 100644 --- a/tests/baselines/reference/importAttributes1(module=commonjs).errors.txt +++ b/tests/baselines/reference/importAttributes1(module=commonjs).errors.txt @@ -1,16 +1,16 @@ -1.ts(1,14): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(3,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -3.ts(2,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. -3.ts(3,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. -3.ts(4,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. -3.ts(5,26): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. -3.ts(7,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +1.ts(1,14): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(3,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +3.ts(2,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. +3.ts(3,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. +3.ts(4,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. +3.ts(5,26): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. +3.ts(7,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. 3.ts(8,11): message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments -3.ts(9,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. -3.ts(10,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +3.ts(9,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. +3.ts(10,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. 3.ts(10,50): error TS1009: Trailing comma not allowed. @@ -21,13 +21,13 @@ ==== 1.ts (3 errors) ==== import './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import { a, b } from './0' with { "type": "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import * as foo from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. a; b; foo.a; @@ -35,10 +35,10 @@ ==== 2.ts (2 errors) ==== import { a, b } from './0' with {} ~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. a; b; c; @@ -47,29 +47,29 @@ const a = import('./0') const b = import('./0', { with: { type: "json" } }) ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. const c = import('./0', { with: { type: "json", ttype: "typo" } }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. const d = import('./0', { with: {} }) ~~~~~~~~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. const dd = import('./0', {}) ~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. declare function foo(): any; const e = import('./0', foo()) ~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. const f = import() ~~~~~~~~ !!! message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments const g = import('./0', {}, {}) ~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. const h = import('./0', { with: { type: "json" }},) ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. ~ !!! error TS1009: Trailing comma not allowed. \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes1(module=es2015).errors.txt b/tests/baselines/reference/importAttributes1(module=es2015).errors.txt index 31ef819879c67..c8d6f581440f5 100644 --- a/tests/baselines/reference/importAttributes1(module=es2015).errors.txt +++ b/tests/baselines/reference/importAttributes1(module=es2015).errors.txt @@ -1,17 +1,17 @@ -1.ts(1,14): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(3,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -3.ts(1,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(2,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(3,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(4,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(5,12): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(7,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(8,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(9,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -3.ts(10,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +1.ts(1,14): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(3,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +3.ts(1,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(2,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(3,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(4,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(5,12): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(7,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(8,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(9,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +3.ts(10,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. ==== 0.ts (0 errors) ==== @@ -21,13 +21,13 @@ ==== 1.ts (3 errors) ==== import './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import { a, b } from './0' with { "type": "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import * as foo from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. a; b; foo.a; @@ -35,10 +35,10 @@ ==== 2.ts (2 errors) ==== import { a, b } from './0' with {} ~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. a; b; c; @@ -46,30 +46,30 @@ ==== 3.ts (9 errors) ==== const a = import('./0') ~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. const b = import('./0', { with: { type: "json" } }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. const c = import('./0', { with: { type: "json", ttype: "typo" } }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. const d = import('./0', { with: {} }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. const dd = import('./0', {}) ~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. declare function foo(): any; const e = import('./0', foo()) ~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. const f = import() ~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. const g = import('./0', {}, {}) ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. const h = import('./0', { with: { type: "json" }},) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes2(module=commonjs).errors.txt b/tests/baselines/reference/importAttributes2(module=commonjs).errors.txt index fea6b67dc1ec4..7171347b35feb 100644 --- a/tests/baselines/reference/importAttributes2(module=commonjs).errors.txt +++ b/tests/baselines/reference/importAttributes2(module=commonjs).errors.txt @@ -1,9 +1,9 @@ -1.ts(1,22): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(3,21): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(4,27): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +1.ts(1,22): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(3,21): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(4,27): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== 0.ts (0 errors) ==== @@ -13,22 +13,22 @@ ==== 1.ts (4 errors) ==== export {} from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export { a, b } from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export * from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export * as ns from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== 2.ts (2 errors) ==== export { a, b } from './0' with {} ~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes2(module=es2015).errors.txt b/tests/baselines/reference/importAttributes2(module=es2015).errors.txt index fea6b67dc1ec4..7171347b35feb 100644 --- a/tests/baselines/reference/importAttributes2(module=es2015).errors.txt +++ b/tests/baselines/reference/importAttributes2(module=es2015).errors.txt @@ -1,9 +1,9 @@ -1.ts(1,22): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(3,21): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(4,27): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +1.ts(1,22): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(3,21): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(4,27): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== 0.ts (0 errors) ==== @@ -13,22 +13,22 @@ ==== 1.ts (4 errors) ==== export {} from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export { a, b } from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export * from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export * as ns from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== 2.ts (2 errors) ==== export { a, b } from './0' with {} ~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes3(module=es2015).errors.txt b/tests/baselines/reference/importAttributes3(module=es2015).errors.txt index 8e0a253a65778..069b64d9d3bb1 100644 --- a/tests/baselines/reference/importAttributes3(module=es2015).errors.txt +++ b/tests/baselines/reference/importAttributes3(module=es2015).errors.txt @@ -1,7 +1,7 @@ -1.ts(1,27): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.ts(2,30): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(1,31): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -2.ts(2,33): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +1.ts(1,27): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.ts(2,30): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(1,31): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +2.ts(2,33): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== 0.ts (0 errors) ==== @@ -10,16 +10,16 @@ ==== 1.ts (2 errors) ==== export type {} from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export type { I } from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== 2.ts (2 errors) ==== import type { I } from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import type * as foo from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes6(module=node20).errors.txt b/tests/baselines/reference/importAttributes6(module=node20).errors.txt new file mode 100644 index 0000000000000..f2f160a4bd0e1 --- /dev/null +++ b/tests/baselines/reference/importAttributes6(module=node20).errors.txt @@ -0,0 +1,56 @@ +mod.mts(1,37): error TS2322: Type '{ field: 0; }' is not assignable to type 'ImportAttributes'. + Property 'field' is incompatible with index signature. + Type 'number' is not assignable to type 'string'. +mod.mts(1,51): error TS2858: Import attribute values must be string literal expressions. +mod.mts(2,51): error TS2858: Import attribute values must be string literal expressions. +mod.mts(3,37): error TS2322: Type '{ field: RegExp; }' is not assignable to type 'ImportAttributes'. + Property 'field' is incompatible with index signature. + Type 'RegExp' is not assignable to type 'string'. +mod.mts(3,51): error TS2858: Import attribute values must be string literal expressions. +mod.mts(4,37): error TS2322: Type '{ field: string[]; }' is not assignable to type 'ImportAttributes'. + Property 'field' is incompatible with index signature. + Type 'string[]' is not assignable to type 'string'. +mod.mts(4,51): error TS2858: Import attribute values must be string literal expressions. +mod.mts(5,37): error TS2322: Type '{ field: { a: number; }; }' is not assignable to type 'ImportAttributes'. + Property 'field' is incompatible with index signature. + Type '{ a: number; }' is not assignable to type 'string'. +mod.mts(5,51): error TS2858: Import attribute values must be string literal expressions. +mod.mts(6,65): error TS2858: Import attribute values must be string literal expressions. + + +==== mod.mts (10 errors) ==== + import * as thing1 from "./mod.mjs" with { field: 0 }; + ~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type '{ field: 0; }' is not assignable to type 'ImportAttributes'. +!!! error TS2322: Property 'field' is incompatible with index signature. +!!! error TS2322: Type 'number' is not assignable to type 'string'. + ~ +!!! error TS2858: Import attribute values must be string literal expressions. + import * as thing2 from "./mod.mjs" with { field: `a` }; + ~~~ +!!! error TS2858: Import attribute values must be string literal expressions. + import * as thing3 from "./mod.mjs" with { field: /a/g }; + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type '{ field: RegExp; }' is not assignable to type 'ImportAttributes'. +!!! error TS2322: Property 'field' is incompatible with index signature. +!!! error TS2322: Type 'RegExp' is not assignable to type 'string'. + ~~~~ +!!! error TS2858: Import attribute values must be string literal expressions. + import * as thing4 from "./mod.mjs" with { field: ["a"] }; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type '{ field: string[]; }' is not assignable to type 'ImportAttributes'. +!!! error TS2322: Property 'field' is incompatible with index signature. +!!! error TS2322: Type 'string[]' is not assignable to type 'string'. + ~~~~~ +!!! error TS2858: Import attribute values must be string literal expressions. + import * as thing5 from "./mod.mjs" with { field: { a: 0 } }; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type '{ field: { a: number; }; }' is not assignable to type 'ImportAttributes'. +!!! error TS2322: Property 'field' is incompatible with index signature. +!!! error TS2322: Type '{ a: number; }' is not assignable to type 'string'. + ~~~~~~~~ +!!! error TS2858: Import attribute values must be string literal expressions. + import * as thing6 from "./mod.mjs" with { type: "json", field: 0..toString() }; + ~~~~~~~~~~~~~ +!!! error TS2858: Import attribute values must be string literal expressions. + \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes6(module=node20).js b/tests/baselines/reference/importAttributes6(module=node20).js new file mode 100644 index 0000000000000..6d346c55c8e5a --- /dev/null +++ b/tests/baselines/reference/importAttributes6(module=node20).js @@ -0,0 +1,13 @@ +//// [tests/cases/conformance/importAttributes/importAttributes6.ts] //// + +//// [mod.mts] +import * as thing1 from "./mod.mjs" with { field: 0 }; +import * as thing2 from "./mod.mjs" with { field: `a` }; +import * as thing3 from "./mod.mjs" with { field: /a/g }; +import * as thing4 from "./mod.mjs" with { field: ["a"] }; +import * as thing5 from "./mod.mjs" with { field: { a: 0 } }; +import * as thing6 from "./mod.mjs" with { type: "json", field: 0..toString() }; + + +//// [mod.mjs] +export {}; diff --git a/tests/baselines/reference/importAttributes6(module=node20).symbols b/tests/baselines/reference/importAttributes6(module=node20).symbols new file mode 100644 index 0000000000000..b46ae41350e9a --- /dev/null +++ b/tests/baselines/reference/importAttributes6(module=node20).symbols @@ -0,0 +1,24 @@ +//// [tests/cases/conformance/importAttributes/importAttributes6.ts] //// + +=== mod.mts === +import * as thing1 from "./mod.mjs" with { field: 0 }; +>thing1 : Symbol(thing1, Decl(mod.mts, 0, 6)) + +import * as thing2 from "./mod.mjs" with { field: `a` }; +>thing2 : Symbol(thing2, Decl(mod.mts, 1, 6)) + +import * as thing3 from "./mod.mjs" with { field: /a/g }; +>thing3 : Symbol(thing3, Decl(mod.mts, 2, 6)) + +import * as thing4 from "./mod.mjs" with { field: ["a"] }; +>thing4 : Symbol(thing4, Decl(mod.mts, 3, 6)) + +import * as thing5 from "./mod.mjs" with { field: { a: 0 } }; +>thing5 : Symbol(thing5, Decl(mod.mts, 4, 6)) +>a : Symbol(a, Decl(mod.mts, 4, 51)) + +import * as thing6 from "./mod.mjs" with { type: "json", field: 0..toString() }; +>thing6 : Symbol(thing6, Decl(mod.mts, 5, 6)) +>0..toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + diff --git a/tests/baselines/reference/importAttributes6(module=node20).types b/tests/baselines/reference/importAttributes6(module=node20).types new file mode 100644 index 0000000000000..bb218f496175f --- /dev/null +++ b/tests/baselines/reference/importAttributes6(module=node20).types @@ -0,0 +1,61 @@ +//// [tests/cases/conformance/importAttributes/importAttributes6.ts] //// + +=== mod.mts === +import * as thing1 from "./mod.mjs" with { field: 0 }; +>thing1 : typeof thing1 +> : ^^^^^^^^^^^^^ +>field : any +> : ^^^ + +import * as thing2 from "./mod.mjs" with { field: `a` }; +>thing2 : typeof thing1 +> : ^^^^^^^^^^^^^ +>field : any +> : ^^^ + +import * as thing3 from "./mod.mjs" with { field: /a/g }; +>thing3 : typeof thing1 +> : ^^^^^^^^^^^^^ +>field : any +> : ^^^ +>/a/g : RegExp +> : ^^^^^^ + +import * as thing4 from "./mod.mjs" with { field: ["a"] }; +>thing4 : typeof thing1 +> : ^^^^^^^^^^^^^ +>field : any +> : ^^^ +>["a"] : string[] +> : ^^^^^^^^ +>"a" : "a" +> : ^^^ + +import * as thing5 from "./mod.mjs" with { field: { a: 0 } }; +>thing5 : typeof thing1 +> : ^^^^^^^^^^^^^ +>field : any +> : ^^^ +>{ a: 0 } : { a: number; } +> : ^^^^^^^^^^^^^^ +>a : number +> : ^^^^^^ +>0 : 0 +> : ^ + +import * as thing6 from "./mod.mjs" with { type: "json", field: 0..toString() }; +>thing6 : typeof thing1 +> : ^^^^^^^^^^^^^ +>type : any +> : ^^^ +>field : any +> : ^^^ +>0..toString() : string +> : ^^^^^^ +>0..toString : (radix?: number) => string +> : ^ ^^^ ^^^^^ +>0. : 0 +> : ^ +>toString : (radix?: number) => string +> : ^ ^^^ ^^^^^ + diff --git a/tests/baselines/reference/importCallExpressionErrorInES2015.errors.txt b/tests/baselines/reference/importCallExpressionErrorInES2015.errors.txt index fd15d2d1dbd06..ca51075431695 100644 --- a/tests/baselines/reference/importCallExpressionErrorInES2015.errors.txt +++ b/tests/baselines/reference/importCallExpressionErrorInES2015.errors.txt @@ -1,6 +1,6 @@ -1.ts(1,1): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -1.ts(2,10): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -1.ts(8,16): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +1.ts(1,1): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +1.ts(2,10): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +1.ts(8,16): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. ==== 0.ts (0 errors) ==== @@ -9,10 +9,10 @@ ==== 1.ts (3 errors) ==== import("./0"); ~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. var p1 = import("./0"); ~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. p1.then(zero => { return zero.foo(); }) @@ -20,5 +20,5 @@ function foo() { const p2 = import("./0"); ~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. } \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionGrammarError.errors.txt b/tests/baselines/reference/importCallExpressionGrammarError.errors.txt index c055c26a5f610..fb85831429a53 100644 --- a/tests/baselines/reference/importCallExpressionGrammarError.errors.txt +++ b/tests/baselines/reference/importCallExpressionGrammarError.errors.txt @@ -2,7 +2,7 @@ importCallExpressionGrammarError.ts(5,8): error TS1325: Argument of dynamic impo importCallExpressionGrammarError.ts(7,17): error TS1325: Argument of dynamic import cannot be spread element. importCallExpressionGrammarError.ts(8,12): message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments importCallExpressionGrammarError.ts(9,19): error TS2307: Cannot find module 'pathToModule' or its corresponding type declarations. -importCallExpressionGrammarError.ts(9,35): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +importCallExpressionGrammarError.ts(9,35): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. importCallExpressionGrammarError.ts(9,35): error TS2559: Type '"secondModule"' has no properties in common with type 'ImportCallOptions'. @@ -25,6 +25,6 @@ importCallExpressionGrammarError.ts(9,35): error TS2559: Type '"secondModule"' h ~~~~~~~~~~~~~~ !!! error TS2307: Cannot find module 'pathToModule' or its corresponding type declarations. ~~~~~~~~~~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. ~~~~~~~~~~~~~~ !!! error TS2559: Type '"secondModule"' has no properties in common with type 'ImportCallOptions'. \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionNestedES2015.errors.txt b/tests/baselines/reference/importCallExpressionNestedES2015.errors.txt index 8e2c1556da376..122ef7adececc 100644 --- a/tests/baselines/reference/importCallExpressionNestedES2015.errors.txt +++ b/tests/baselines/reference/importCallExpressionNestedES2015.errors.txt @@ -1,5 +1,5 @@ -index.ts(2,18): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -index.ts(2,32): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +index.ts(2,18): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +index.ts(2,32): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. ==== foo.ts (0 errors) ==== @@ -9,7 +9,7 @@ index.ts(2,32): error TS1323: Dynamic imports are only supported when the '--mod async function foo() { return await import((await import("./foo")).default); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. } \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionNestedES20152.errors.txt b/tests/baselines/reference/importCallExpressionNestedES20152.errors.txt index 8e2c1556da376..122ef7adececc 100644 --- a/tests/baselines/reference/importCallExpressionNestedES20152.errors.txt +++ b/tests/baselines/reference/importCallExpressionNestedES20152.errors.txt @@ -1,5 +1,5 @@ -index.ts(2,18): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. -index.ts(2,32): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +index.ts(2,18): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. +index.ts(2,32): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. ==== foo.ts (0 errors) ==== @@ -9,7 +9,7 @@ index.ts(2,32): error TS1323: Dynamic imports are only supported when the '--mod async function foo() { return await import((await import("./foo")).default); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', 'node20', or 'nodenext'. } \ No newline at end of file diff --git a/tests/baselines/reference/importMeta(module=commonjs,target=es5).errors.txt b/tests/baselines/reference/importMeta(module=commonjs,target=es5).errors.txt index 360e04abf29ab..e86672a229888 100644 --- a/tests/baselines/reference/importMeta(module=commonjs,target=es5).errors.txt +++ b/tests/baselines/reference/importMeta(module=commonjs,target=es5).errors.txt @@ -1,25 +1,25 @@ error TS2468: Cannot find global value 'Promise'. -assignmentTargets.ts(1,32): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +assignmentTargets.ts(1,32): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. assignmentTargets.ts(1,44): error TS2339: Property 'blah' does not exist on type 'ImportMeta'. -assignmentTargets.ts(1,51): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +assignmentTargets.ts(1,51): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'. -assignmentTargets.ts(1,70): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. -assignmentTargets.ts(2,1): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +assignmentTargets.ts(1,70): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. +assignmentTargets.ts(2,1): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. -assignmentTargets.ts(11,21): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +assignmentTargets.ts(11,21): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. example.ts(2,2): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. -example.ts(3,59): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. -example.ts(6,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +example.ts(3,59): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. +example.ts(6,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'. -moduleLookingFile01.ts(1,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. -moduleLookingFile01.ts(2,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +moduleLookingFile01.ts(1,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. +moduleLookingFile01.ts(2,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? -moduleLookingFile01.ts(3,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +moduleLookingFile01.ts(3,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? -scriptLookingFile01.ts(1,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. -scriptLookingFile01.ts(2,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +scriptLookingFile01.ts(1,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. +scriptLookingFile01.ts(2,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. scriptLookingFile01.ts(2,22): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? -scriptLookingFile01.ts(3,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +scriptLookingFile01.ts(3,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? @@ -31,12 +31,12 @@ scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-proper !!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString()); ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. const blob = await response.blob(); const size = import.meta.scriptElement.dataset.size || 300; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~~~~~~~~~~ !!! error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'. @@ -50,48 +50,48 @@ scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-proper ==== moduleLookingFile01.ts (5 errors) ==== export let x = import.meta; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. export let y = import.metal; ~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~~ !!! error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? export let z = import.import.import.malkovich; ~~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~~~ !!! error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? ==== scriptLookingFile01.ts (5 errors) ==== let globalA = import.meta; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. let globalB = import.metal; ~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~~ !!! error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? let globalC = import.import.import.malkovich; ~~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~~~ !!! error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? ==== assignmentTargets.ts (8 errors) ==== export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'ImportMeta'. ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~ !!! error TS2339: Property 'blue' does not exist on type 'ImportMeta'. ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. import.meta = foo; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~~~~~~~~ !!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. @@ -104,4 +104,4 @@ scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-proper const { a, b, c } = import.meta.wellKnownProperty; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. \ No newline at end of file +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. \ No newline at end of file diff --git a/tests/baselines/reference/importMeta(module=commonjs,target=esnext).errors.txt b/tests/baselines/reference/importMeta(module=commonjs,target=esnext).errors.txt index 360e04abf29ab..e86672a229888 100644 --- a/tests/baselines/reference/importMeta(module=commonjs,target=esnext).errors.txt +++ b/tests/baselines/reference/importMeta(module=commonjs,target=esnext).errors.txt @@ -1,25 +1,25 @@ error TS2468: Cannot find global value 'Promise'. -assignmentTargets.ts(1,32): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +assignmentTargets.ts(1,32): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. assignmentTargets.ts(1,44): error TS2339: Property 'blah' does not exist on type 'ImportMeta'. -assignmentTargets.ts(1,51): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +assignmentTargets.ts(1,51): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'. -assignmentTargets.ts(1,70): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. -assignmentTargets.ts(2,1): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +assignmentTargets.ts(1,70): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. +assignmentTargets.ts(2,1): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. -assignmentTargets.ts(11,21): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +assignmentTargets.ts(11,21): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. example.ts(2,2): error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. -example.ts(3,59): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. -example.ts(6,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +example.ts(3,59): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. +example.ts(6,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'. -moduleLookingFile01.ts(1,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. -moduleLookingFile01.ts(2,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +moduleLookingFile01.ts(1,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. +moduleLookingFile01.ts(2,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? -moduleLookingFile01.ts(3,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +moduleLookingFile01.ts(3,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? -scriptLookingFile01.ts(1,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. -scriptLookingFile01.ts(2,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +scriptLookingFile01.ts(1,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. +scriptLookingFile01.ts(2,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. scriptLookingFile01.ts(2,22): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? -scriptLookingFile01.ts(3,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +scriptLookingFile01.ts(3,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? @@ -31,12 +31,12 @@ scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-proper !!! error TS2705: An async function or method in ES5 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString()); ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. const blob = await response.blob(); const size = import.meta.scriptElement.dataset.size || 300; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~~~~~~~~~~ !!! error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'. @@ -50,48 +50,48 @@ scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-proper ==== moduleLookingFile01.ts (5 errors) ==== export let x = import.meta; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. export let y = import.metal; ~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~~ !!! error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? export let z = import.import.import.malkovich; ~~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~~~ !!! error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? ==== scriptLookingFile01.ts (5 errors) ==== let globalA = import.meta; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. let globalB = import.metal; ~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~~ !!! error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? let globalC = import.import.import.malkovich; ~~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~~~ !!! error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? ==== assignmentTargets.ts (8 errors) ==== export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'ImportMeta'. ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~ !!! error TS2339: Property 'blue' does not exist on type 'ImportMeta'. ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. import.meta = foo; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. ~~~~~~~~~~~ !!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. @@ -104,4 +104,4 @@ scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-proper const { a, b, c } = import.meta.wellKnownProperty; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'. \ No newline at end of file +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', or 'nodenext'. \ No newline at end of file diff --git a/tests/baselines/reference/importTag14.errors.txt b/tests/baselines/reference/importTag14.errors.txt index 9969d70670899..e1cd4433648ab 100644 --- a/tests/baselines/reference/importTag14.errors.txt +++ b/tests/baselines/reference/importTag14.errors.txt @@ -1,5 +1,5 @@ /foo.js(1,33): error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. -/foo.js(1,33): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +/foo.js(1,33): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. /foo.js(1,38): error TS1005: '{' expected. @@ -8,7 +8,7 @@ ~~~~ !!! error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. ~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. !!! error TS1005: '{' expected. \ No newline at end of file diff --git a/tests/baselines/reference/importTag15(module=es2015).errors.txt b/tests/baselines/reference/importTag15(module=es2015).errors.txt index 45e47c28ad649..ae3f68aaa071e 100644 --- a/tests/baselines/reference/importTag15(module=es2015).errors.txt +++ b/tests/baselines/reference/importTag15(module=es2015).errors.txt @@ -1,5 +1,5 @@ -1.js(1,30): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -1.js(2,33): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +1.js(1,30): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +1.js(2,33): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== 0.ts (0 errors) ==== @@ -8,10 +8,10 @@ ==== 1.js (2 errors) ==== /** @import { I } from './0' with { type: "json" } */ ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. /** @import * as foo from './0' with { type: "json" } */ ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. /** @param {I} a */ function f(a) {} diff --git a/tests/baselines/reference/moduleNodeDefaultImports(module=node20).errors.txt b/tests/baselines/reference/moduleNodeDefaultImports(module=node20).errors.txt new file mode 100644 index 0000000000000..2fd1d68ba8d00 --- /dev/null +++ b/tests/baselines/reference/moduleNodeDefaultImports(module=node20).errors.txt @@ -0,0 +1,64 @@ +b.mts(15,1): error TS2349: This expression is not callable. + Type 'typeof import("mod")' has no call signatures. +b.mts(16,1): error TS2349: This expression is not callable. + Type 'typeof import("mod")' has no call signatures. +b.mts(17,1): error TS2349: This expression is not callable. + Type 'typeof import("mod")' has no call signatures. +b.mts(18,1): error TS2349: This expression is not callable. + Type 'typeof import("mod")' has no call signatures. +b.mts(19,6): error TS2349: This expression is not callable. + Type 'typeof import("mod")' has no call signatures. +b.mts(20,6): error TS2349: This expression is not callable. + Type 'typeof import("mod")' has no call signatures. + + +==== mod.cts (0 errors) ==== + declare function fun(): void; + export default fun; +==== b.mts (6 errors) ==== + import a from "./mod.cjs"; + import { default as b } from "./mod.cjs"; + import c, { default as d } from "./mod.cjs"; + import * as self from "./b.mjs"; + export { default } from "./mod.cjs"; + export { default as def } from "./mod.cjs"; + + a === b; + b === c; + c === d; + d === self.default; + self.default === self.def; + + // should all fail + a(); + ~ +!!! error TS2349: This expression is not callable. +!!! error TS2349: Type 'typeof import("mod")' has no call signatures. + b(); + ~ +!!! error TS2349: This expression is not callable. +!!! error TS2349: Type 'typeof import("mod")' has no call signatures. + c(); + ~ +!!! error TS2349: This expression is not callable. +!!! error TS2349: Type 'typeof import("mod")' has no call signatures. + d(); + ~ +!!! error TS2349: This expression is not callable. +!!! error TS2349: Type 'typeof import("mod")' has no call signatures. + self.default(); + ~~~~~~~ +!!! error TS2349: This expression is not callable. +!!! error TS2349: Type 'typeof import("mod")' has no call signatures. + self.def(); + ~~~ +!!! error TS2349: This expression is not callable. +!!! error TS2349: Type 'typeof import("mod")' has no call signatures. + + // should all work + a.default(); + b.default(); + c.default(); + d.default(); + self.default.default(); + self.def.default(); \ No newline at end of file diff --git a/tests/baselines/reference/moduleNodeDefaultImports(module=node20).js b/tests/baselines/reference/moduleNodeDefaultImports(module=node20).js new file mode 100644 index 0000000000000..1d6e31ec0afb2 --- /dev/null +++ b/tests/baselines/reference/moduleNodeDefaultImports(module=node20).js @@ -0,0 +1,65 @@ +//// [tests/cases/compiler/moduleNodeDefaultImports.ts] //// + +//// [mod.cts] +declare function fun(): void; +export default fun; +//// [b.mts] +import a from "./mod.cjs"; +import { default as b } from "./mod.cjs"; +import c, { default as d } from "./mod.cjs"; +import * as self from "./b.mjs"; +export { default } from "./mod.cjs"; +export { default as def } from "./mod.cjs"; + +a === b; +b === c; +c === d; +d === self.default; +self.default === self.def; + +// should all fail +a(); +b(); +c(); +d(); +self.default(); +self.def(); + +// should all work +a.default(); +b.default(); +c.default(); +d.default(); +self.default.default(); +self.def.default(); + +//// [mod.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = fun; +//// [b.mjs] +import a from "./mod.cjs"; +import { default as b } from "./mod.cjs"; +import c, { default as d } from "./mod.cjs"; +import * as self from "./b.mjs"; +export { default } from "./mod.cjs"; +export { default as def } from "./mod.cjs"; +a === b; +b === c; +c === d; +d === self.default; +self.default === self.def; +// should all fail +a(); +b(); +c(); +d(); +self.default(); +self.def(); +// should all work +a.default(); +b.default(); +c.default(); +d.default(); +self.default.default(); +self.def.default(); diff --git a/tests/baselines/reference/moduleNodeDefaultImports(module=node20).symbols b/tests/baselines/reference/moduleNodeDefaultImports(module=node20).symbols new file mode 100644 index 0000000000000..8c292112c561f --- /dev/null +++ b/tests/baselines/reference/moduleNodeDefaultImports(module=node20).symbols @@ -0,0 +1,116 @@ +//// [tests/cases/compiler/moduleNodeDefaultImports.ts] //// + +=== mod.cts === +declare function fun(): void; +>fun : Symbol(fun, Decl(mod.cts, 0, 0)) + +export default fun; +>fun : Symbol(fun, Decl(mod.cts, 0, 0)) + +=== b.mts === +import a from "./mod.cjs"; +>a : Symbol(a, Decl(b.mts, 0, 6)) + +import { default as b } from "./mod.cjs"; +>default : Symbol(a, Decl(mod.cts, 0, 0)) +>b : Symbol(b, Decl(b.mts, 1, 8)) + +import c, { default as d } from "./mod.cjs"; +>c : Symbol(c, Decl(b.mts, 2, 6)) +>default : Symbol(a, Decl(mod.cts, 0, 0)) +>d : Symbol(d, Decl(b.mts, 2, 11)) + +import * as self from "./b.mjs"; +>self : Symbol(self, Decl(b.mts, 3, 6)) + +export { default } from "./mod.cjs"; +>default : Symbol(self.default, Decl(b.mts, 4, 8)) + +export { default as def } from "./mod.cjs"; +>default : Symbol(a, Decl(mod.cts, 0, 0)) +>def : Symbol(self.def, Decl(b.mts, 5, 8)) + +a === b; +>a : Symbol(a, Decl(b.mts, 0, 6)) +>b : Symbol(b, Decl(b.mts, 1, 8)) + +b === c; +>b : Symbol(b, Decl(b.mts, 1, 8)) +>c : Symbol(c, Decl(b.mts, 2, 6)) + +c === d; +>c : Symbol(c, Decl(b.mts, 2, 6)) +>d : Symbol(d, Decl(b.mts, 2, 11)) + +d === self.default; +>d : Symbol(d, Decl(b.mts, 2, 11)) +>self.default : Symbol(self.default, Decl(b.mts, 4, 8)) +>self : Symbol(self, Decl(b.mts, 3, 6)) +>default : Symbol(self.default, Decl(b.mts, 4, 8)) + +self.default === self.def; +>self.default : Symbol(self.default, Decl(b.mts, 4, 8)) +>self : Symbol(self, Decl(b.mts, 3, 6)) +>default : Symbol(self.default, Decl(b.mts, 4, 8)) +>self.def : Symbol(self.def, Decl(b.mts, 5, 8)) +>self : Symbol(self, Decl(b.mts, 3, 6)) +>def : Symbol(self.def, Decl(b.mts, 5, 8)) + +// should all fail +a(); +>a : Symbol(a, Decl(b.mts, 0, 6)) + +b(); +>b : Symbol(b, Decl(b.mts, 1, 8)) + +c(); +>c : Symbol(c, Decl(b.mts, 2, 6)) + +d(); +>d : Symbol(d, Decl(b.mts, 2, 11)) + +self.default(); +>self.default : Symbol(self.default, Decl(b.mts, 4, 8)) +>self : Symbol(self, Decl(b.mts, 3, 6)) +>default : Symbol(self.default, Decl(b.mts, 4, 8)) + +self.def(); +>self.def : Symbol(self.def, Decl(b.mts, 5, 8)) +>self : Symbol(self, Decl(b.mts, 3, 6)) +>def : Symbol(self.def, Decl(b.mts, 5, 8)) + +// should all work +a.default(); +>a.default : Symbol(a.default, Decl(mod.cts, 0, 29)) +>a : Symbol(a, Decl(b.mts, 0, 6)) +>default : Symbol(a.default, Decl(mod.cts, 0, 29)) + +b.default(); +>b.default : Symbol(a.default, Decl(mod.cts, 0, 29)) +>b : Symbol(b, Decl(b.mts, 1, 8)) +>default : Symbol(a.default, Decl(mod.cts, 0, 29)) + +c.default(); +>c.default : Symbol(a.default, Decl(mod.cts, 0, 29)) +>c : Symbol(c, Decl(b.mts, 2, 6)) +>default : Symbol(a.default, Decl(mod.cts, 0, 29)) + +d.default(); +>d.default : Symbol(a.default, Decl(mod.cts, 0, 29)) +>d : Symbol(d, Decl(b.mts, 2, 11)) +>default : Symbol(a.default, Decl(mod.cts, 0, 29)) + +self.default.default(); +>self.default.default : Symbol(a.default, Decl(mod.cts, 0, 29)) +>self.default : Symbol(self.default, Decl(b.mts, 4, 8)) +>self : Symbol(self, Decl(b.mts, 3, 6)) +>default : Symbol(self.default, Decl(b.mts, 4, 8)) +>default : Symbol(a.default, Decl(mod.cts, 0, 29)) + +self.def.default(); +>self.def.default : Symbol(a.default, Decl(mod.cts, 0, 29)) +>self.def : Symbol(self.def, Decl(b.mts, 5, 8)) +>self : Symbol(self, Decl(b.mts, 3, 6)) +>def : Symbol(self.def, Decl(b.mts, 5, 8)) +>default : Symbol(a.default, Decl(mod.cts, 0, 29)) + diff --git a/tests/baselines/reference/moduleNodeDefaultImports(module=node20).types b/tests/baselines/reference/moduleNodeDefaultImports(module=node20).types new file mode 100644 index 0000000000000..84b8ccc87d275 --- /dev/null +++ b/tests/baselines/reference/moduleNodeDefaultImports(module=node20).types @@ -0,0 +1,210 @@ +//// [tests/cases/compiler/moduleNodeDefaultImports.ts] //// + +=== mod.cts === +declare function fun(): void; +>fun : () => void +> : ^^^^^^ + +export default fun; +>fun : () => void +> : ^^^^^^ + +=== b.mts === +import a from "./mod.cjs"; +>a : typeof a +> : ^^^^^^^^ + +import { default as b } from "./mod.cjs"; +>default : typeof a +> : ^^^^^^^^ +>b : typeof a +> : ^^^^^^^^ + +import c, { default as d } from "./mod.cjs"; +>c : typeof a +> : ^^^^^^^^ +>default : typeof a +> : ^^^^^^^^ +>d : typeof a +> : ^^^^^^^^ + +import * as self from "./b.mjs"; +>self : typeof self +> : ^^^^^^^^^^^ + +export { default } from "./mod.cjs"; +>default : typeof a +> : ^^^^^^^^ + +export { default as def } from "./mod.cjs"; +>default : typeof a +> : ^^^^^^^^ +>def : typeof a +> : ^^^^^^^^ + +a === b; +>a === b : boolean +> : ^^^^^^^ +>a : typeof a +> : ^^^^^^^^ +>b : typeof a +> : ^^^^^^^^ + +b === c; +>b === c : boolean +> : ^^^^^^^ +>b : typeof a +> : ^^^^^^^^ +>c : typeof a +> : ^^^^^^^^ + +c === d; +>c === d : boolean +> : ^^^^^^^ +>c : typeof a +> : ^^^^^^^^ +>d : typeof a +> : ^^^^^^^^ + +d === self.default; +>d === self.default : boolean +> : ^^^^^^^ +>d : typeof a +> : ^^^^^^^^ +>self.default : typeof a +> : ^^^^^^^^ +>self : typeof self +> : ^^^^^^^^^^^ +>default : typeof a +> : ^^^^^^^^ + +self.default === self.def; +>self.default === self.def : boolean +> : ^^^^^^^ +>self.default : typeof a +> : ^^^^^^^^ +>self : typeof self +> : ^^^^^^^^^^^ +>default : typeof a +> : ^^^^^^^^ +>self.def : typeof a +> : ^^^^^^^^ +>self : typeof self +> : ^^^^^^^^^^^ +>def : typeof a +> : ^^^^^^^^ + +// should all fail +a(); +>a() : any +> : ^^^ +>a : typeof a +> : ^^^^^^^^ + +b(); +>b() : any +> : ^^^ +>b : typeof a +> : ^^^^^^^^ + +c(); +>c() : any +> : ^^^ +>c : typeof a +> : ^^^^^^^^ + +d(); +>d() : any +> : ^^^ +>d : typeof a +> : ^^^^^^^^ + +self.default(); +>self.default() : any +> : ^^^ +>self.default : typeof a +> : ^^^^^^^^ +>self : typeof self +> : ^^^^^^^^^^^ +>default : typeof a +> : ^^^^^^^^ + +self.def(); +>self.def() : any +> : ^^^ +>self.def : typeof a +> : ^^^^^^^^ +>self : typeof self +> : ^^^^^^^^^^^ +>def : typeof a +> : ^^^^^^^^ + +// should all work +a.default(); +>a.default() : void +> : ^^^^ +>a.default : () => void +> : ^^^^^^ +>a : typeof a +> : ^^^^^^^^ +>default : () => void +> : ^^^^^^ + +b.default(); +>b.default() : void +> : ^^^^ +>b.default : () => void +> : ^^^^^^ +>b : typeof a +> : ^^^^^^^^ +>default : () => void +> : ^^^^^^ + +c.default(); +>c.default() : void +> : ^^^^ +>c.default : () => void +> : ^^^^^^ +>c : typeof a +> : ^^^^^^^^ +>default : () => void +> : ^^^^^^ + +d.default(); +>d.default() : void +> : ^^^^ +>d.default : () => void +> : ^^^^^^ +>d : typeof a +> : ^^^^^^^^ +>default : () => void +> : ^^^^^^ + +self.default.default(); +>self.default.default() : void +> : ^^^^ +>self.default.default : () => void +> : ^^^^^^ +>self.default : typeof a +> : ^^^^^^^^ +>self : typeof self +> : ^^^^^^^^^^^ +>default : typeof a +> : ^^^^^^^^ +>default : () => void +> : ^^^^^^ + +self.def.default(); +>self.def.default() : void +> : ^^^^ +>self.def.default : () => void +> : ^^^^^^ +>self.def : typeof a +> : ^^^^^^^^ +>self : typeof self +> : ^^^^^^^^^^^ +>def : typeof a +> : ^^^^^^^^ +>default : () => void +> : ^^^^^^ + diff --git a/tests/baselines/reference/modulePreserveTopLevelAwait1(target=es2016).errors.txt b/tests/baselines/reference/modulePreserveTopLevelAwait1(target=es2016).errors.txt index 8aa6718972b94..88dac4a214ed7 100644 --- a/tests/baselines/reference/modulePreserveTopLevelAwait1(target=es2016).errors.txt +++ b/tests/baselines/reference/modulePreserveTopLevelAwait1(target=es2016).errors.txt @@ -1,14 +1,14 @@ -modulePreserveTopLevelAwait1.ts(1,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -modulePreserveTopLevelAwait1.ts(2,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +modulePreserveTopLevelAwait1.ts(1,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +modulePreserveTopLevelAwait1.ts(2,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. ==== modulePreserveTopLevelAwait1.ts (2 errors) ==== for await (const x of []) {} ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. await Promise.resolve(); ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. export {}; \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=node16).js b/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=node16).js new file mode 100644 index 0000000000000..2d0c7b4607ea5 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=node16).js @@ -0,0 +1,52 @@ +//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": "./entrypoint.js" +} +//// [entrypoint.d.ts] +export declare function thing(): void; +//// [index.ts] +import * as p from "pkg"; +p.thing(); + +//// [index.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const p = __importStar(require("pkg")); +p.thing(); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=node16).symbols b/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=node16).symbols new file mode 100644 index 0000000000000..7233a43c05fff --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=node16).symbols @@ -0,0 +1,15 @@ +//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// + +=== node_modules/pkg/entrypoint.d.ts === +export declare function thing(): void; +>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0)) + +=== index.ts === +import * as p from "pkg"; +>p : Symbol(p, Decl(index.ts, 0, 6)) + +p.thing(); +>p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) +>p : Symbol(p, Decl(index.ts, 0, 6)) +>thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=node16).types b/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=node16).types new file mode 100644 index 0000000000000..b65e67d7fe713 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=node16).types @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// + +=== node_modules/pkg/entrypoint.d.ts === +export declare function thing(): void; +>thing : () => void +> : ^^^^^^ + +=== index.ts === +import * as p from "pkg"; +>p : typeof p +> : ^^^^^^^^ + +p.thing(); +>p.thing() : void +> : ^^^^ +>p.thing : () => void +> : ^^^^^^ +>p : typeof p +> : ^^^^^^^^ +>thing : () => void +> : ^^^^^^ + diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=nodenext).js b/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=nodenext).js new file mode 100644 index 0000000000000..2d0c7b4607ea5 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=nodenext).js @@ -0,0 +1,52 @@ +//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": "./entrypoint.js" +} +//// [entrypoint.d.ts] +export declare function thing(): void; +//// [index.ts] +import * as p from "pkg"; +p.thing(); + +//// [index.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const p = __importStar(require("pkg")); +p.thing(); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=nodenext).symbols b/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=nodenext).symbols new file mode 100644 index 0000000000000..7233a43c05fff --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=nodenext).symbols @@ -0,0 +1,15 @@ +//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// + +=== node_modules/pkg/entrypoint.d.ts === +export declare function thing(): void; +>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0)) + +=== index.ts === +import * as p from "pkg"; +>p : Symbol(p, Decl(index.ts, 0, 6)) + +p.thing(); +>p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) +>p : Symbol(p, Decl(index.ts, 0, 6)) +>thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=nodenext).types b/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=nodenext).types new file mode 100644 index 0000000000000..b65e67d7fe713 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node20,moduleresolution=nodenext).types @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// + +=== node_modules/pkg/entrypoint.d.ts === +export declare function thing(): void; +>thing : () => void +> : ^^^^^^ + +=== index.ts === +import * as p from "pkg"; +>p : typeof p +> : ^^^^^^^^ + +p.thing(); +>p.thing() : void +> : ^^^^ +>p.thing : () => void +> : ^^^^^^ +>p : typeof p +> : ^^^^^^^^ +>thing : () => void +> : ^^^^^^ + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension3(module=node20).errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension3(module=node20).errors.txt new file mode 100644 index 0000000000000..9571e971dea6f --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension3(module=node20).errors.txt @@ -0,0 +1,14 @@ +/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './foo.jsx'? + \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension3(module=node20).js b/tests/baselines/reference/moduleResolutionWithoutExtension3(module=node20).js new file mode 100644 index 0000000000000..3b4e816e48e71 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension3(module=node20).js @@ -0,0 +1,21 @@ +//// [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.jsx] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = foo; +function foo() { + return ""; +} +//// [bar.mjs] +export {}; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension3(module=node20).symbols b/tests/baselines/reference/moduleResolutionWithoutExtension3(module=node20).symbols new file mode 100644 index 0000000000000..8c8671bd3cae4 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension3(module=node20).symbols @@ -0,0 +1,14 @@ +//// [tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts] //// + +=== /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)) + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension3(module=node20).types b/tests/baselines/reference/moduleResolutionWithoutExtension3(module=node20).types new file mode 100644 index 0000000000000..34e0dc5a61e00 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension3(module=node20).types @@ -0,0 +1,18 @@ +//// [tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts] //// + +=== /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 +> : ^^^ + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension4(module=node20).errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension4(module=node20).errors.txt new file mode 100644 index 0000000000000..b1a357f1f1d1a --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension4(module=node20).errors.txt @@ -0,0 +1,14 @@ +/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './foo.js'? + \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension4(module=node20).js b/tests/baselines/reference/moduleResolutionWithoutExtension4(module=node20).js new file mode 100644 index 0000000000000..9fe42ebd8fb44 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension4(module=node20).js @@ -0,0 +1,21 @@ +//// [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.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = foo; +function foo() { + return ""; +} +//// [bar.mjs] +export {}; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension4(module=node20).symbols b/tests/baselines/reference/moduleResolutionWithoutExtension4(module=node20).symbols new file mode 100644 index 0000000000000..27f69a9a5e0b0 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension4(module=node20).symbols @@ -0,0 +1,14 @@ +//// [tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts] //// + +=== /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)) + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension4(module=node20).types b/tests/baselines/reference/moduleResolutionWithoutExtension4(module=node20).types new file mode 100644 index 0000000000000..35993101c47e6 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithoutExtension4(module=node20).types @@ -0,0 +1,18 @@ +//// [tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts] //// + +=== /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 +> : ^^^ + diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node20).errors.txt b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node20).errors.txt new file mode 100644 index 0000000000000..8ceed405f3085 --- /dev/null +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node20).errors.txt @@ -0,0 +1,23 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. + + +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. +==== index.js (0 errors) ==== + // esm format file + import * as self from "package"; + self; +==== index.mjs (0 errors) ==== + // esm format file + import * as self from "package"; + self; +==== index.cjs (0 errors) ==== + // esm format file + import * as self from "package"; + self; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node20).js b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node20).js new file mode 100644 index 0000000000000..1498e98d79602 --- /dev/null +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node20).js @@ -0,0 +1,77 @@ +//// [tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts] //// + +//// [index.js] +// esm format file +import * as self from "package"; +self; +//// [index.mjs] +// esm format file +import * as self from "package"; +self; +//// [index.cjs] +// esm format file +import * as self from "package"; +self; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" +} + +//// [index.js] +// esm format file +import * as self from "package"; +self; +//// [index.mjs] +// esm format file +import * as self from "package"; +self; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// esm format file +const self = __importStar(require("package")); +self; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node20).symbols b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node20).symbols new file mode 100644 index 0000000000000..5d67f58f34b98 --- /dev/null +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node20).symbols @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts] //// + +=== index.js === +// esm format file +import * as self from "package"; +>self : Symbol(self, Decl(index.js, 1, 6)) + +self; +>self : Symbol(self, Decl(index.js, 1, 6)) + +=== index.mjs === +// esm format file +import * as self from "package"; +>self : Symbol(self, Decl(index.mjs, 1, 6)) + +self; +>self : Symbol(self, Decl(index.mjs, 1, 6)) + +=== index.cjs === +// esm format file +import * as self from "package"; +>self : Symbol(self, Decl(index.cjs, 1, 6)) + +self; +>self : Symbol(self, Decl(index.cjs, 1, 6)) + diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node20).types b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node20).types new file mode 100644 index 0000000000000..f8e06c7c53e1c --- /dev/null +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node20).types @@ -0,0 +1,32 @@ +//// [tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts] //// + +=== index.js === +// esm format file +import * as self from "package"; +>self : typeof self +> : ^^^^^^^^^^^ + +self; +>self : typeof self +> : ^^^^^^^^^^^ + +=== index.mjs === +// esm format file +import * as self from "package"; +>self : typeof self +> : ^^^^^^^^^^^ + +self; +>self : typeof self +> : ^^^^^^^^^^^ + +=== index.cjs === +// esm format file +import * as self from "package"; +>self : typeof self +> : ^^^^^^^^^^^ + +self; +>self : typeof self +> : ^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModules1(module=node20).errors.txt b/tests/baselines/reference/nodeModules1(module=node20).errors.txt new file mode 100644 index 0000000000000..52d56aff661b7 --- /dev/null +++ b/tests/baselines/reference/nodeModules1(module=node20).errors.txt @@ -0,0 +1,486 @@ +index.cts(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. +index.cts(76,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +index.cts(77,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.cts(78,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.cts(79,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +index.cts(80,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.cts(81,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.cts(82,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +index.cts(83,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.cts(84,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.cts(85,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +index.mts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. +index.mts(15,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +index.mts(16,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mts(17,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mts(18,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +index.mts(19,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mts(20,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mts(21,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +index.mts(22,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mts(23,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mts(24,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +index.mts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. +index.mts(75,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +index.mts(76,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mts(77,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mts(78,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +index.mts(79,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mts(80,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mts(81,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +index.mts(82,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mts(83,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mts(84,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +index.ts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. +index.ts(15,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +index.ts(16,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.ts(17,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.ts(18,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +index.ts(19,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.ts(20,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.ts(21,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +index.ts(22,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.ts(23,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.ts(24,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +index.ts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. +index.ts(75,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +index.ts(76,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.ts(77,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.ts(78,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +index.ts(79,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.ts(80,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.ts(81,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +index.ts(82,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.ts(83,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.ts(84,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + + +==== subfolder/index.ts (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== subfolder/index.cts (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== subfolder/index.mts (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== subfolder2/index.ts (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== subfolder2/index.cts (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== subfolder2/index.mts (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== subfolder2/another/index.ts (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== subfolder2/another/index.mts (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== subfolder2/another/index.cts (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== index.mts (22 errors) ==== + import * as m1 from "./index.js"; + import * as m2 from "./index.mjs"; + import * as m3 from "./index.cjs"; + import * as m4 from "./subfolder/index.js"; + import * as m5 from "./subfolder/index.mjs"; + import * as m6 from "./subfolder/index.cjs"; + import * as m7 from "./subfolder2/index.js"; + import * as m8 from "./subfolder2/index.mjs"; + import * as m9 from "./subfolder2/index.cjs"; + import * as m10 from "./subfolder2/another/index.js"; + import * as m11 from "./subfolder2/another/index.mjs"; + import * as m12 from "./subfolder2/another/index.cjs"; + // The next ones should all fail - esm format files have no index resolution or extension resolution + import * as m13 from "./"; + ~~~~ +!!! 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + import * as m15 from "./subfolder"; + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + import * as m18 from "./subfolder2"; + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + import * as m21 from "./subfolder2/another"; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + void m1; + void m2; + void m3; + void m4; + void m5; + void m6; + void m7; + void m8; + void m9; + void m10; + void m11; + void m12; + void m13; + void m14; + void m15; + void m16; + void m17; + void m18; + void m19; + void m20; + void m21; + void m22; + void m23; + + // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) + import m24 = require("./"); + import m25 = require("./index"); + import m26 = require("./subfolder"); + import m27 = require("./subfolder/"); + import m28 = require("./subfolder/index"); + import m29 = require("./subfolder2"); + import m30 = require("./subfolder2/"); + import m31 = require("./subfolder2/index"); + import m32 = require("./subfolder2/another"); + import m33 = require("./subfolder2/another/"); + import m34 = require("./subfolder2/another/index"); + void m24; + void m25; + void m26; + void m27; + void m28; + void m29; + void m30; + void m31; + void m32; + void m33; + void m34; + + // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution + const _m35 = import("./"); + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + const _m36 = import("./index"); + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + const _m37 = import("./subfolder"); + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m38 = import("./subfolder/"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + const _m40 = import("./subfolder2"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m41 = import("./subfolder2/"); + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + const _m43 = import("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + + // esm format file + const x = 1; + export {x}; +==== index.cts (11 errors) ==== + // ESM-format imports below should issue errors + import * as m1 from "./index.js"; + import * as m2 from "./index.mjs"; + import * as m3 from "./index.cjs"; + import * as m4 from "./subfolder/index.js"; + import * as m5 from "./subfolder/index.mjs"; + import * as m6 from "./subfolder/index.cjs"; + import * as m7 from "./subfolder2/index.js"; + import * as m8 from "./subfolder2/index.mjs"; + import * as m9 from "./subfolder2/index.cjs"; + import * as m10 from "./subfolder2/another/index.js"; + import * as m11 from "./subfolder2/another/index.mjs"; + import * as m12 from "./subfolder2/another/index.cjs"; + // The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) + import * as m13 from "./"; + import * as m14 from "./index"; + import * as m15 from "./subfolder"; + import * as m16 from "./subfolder/"; + import * as m17 from "./subfolder/index"; + import * as m18 from "./subfolder2"; + import * as m19 from "./subfolder2/"; + import * as m20 from "./subfolder2/index"; + import * as m21 from "./subfolder2/another"; + import * as m22 from "./subfolder2/another/"; + import * as m23 from "./subfolder2/another/index"; + void m1; + void m2; + void m3; + void m4; + void m5; + void m6; + void m7; + void m8; + void m9; + void m10; + void m11; + void m12; + void m13; + void m14; + void m15; + void m16; + void m17; + void m18; + void m19; + void m20; + void m21; + void m22; + void m23; + + // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) + import m24 = require("./"); + import m25 = require("./index"); + import m26 = require("./subfolder"); + import m27 = require("./subfolder/"); + import m28 = require("./subfolder/index"); + import m29 = require("./subfolder2"); + import m30 = require("./subfolder2/"); + import m31 = require("./subfolder2/index"); + import m32 = require("./subfolder2/another"); + import m33 = require("./subfolder2/another/"); + import m34 = require("./subfolder2/another/index"); + void m24; + void m25; + void m26; + void m27; + void m28; + void m29; + void m30; + void m31; + void m32; + void m33; + void m34; + + // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution + const _m35 = import("./"); + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + const _m36 = import("./index"); + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + const _m37 = import("./subfolder"); + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m38 = import("./subfolder/"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + const _m40 = import("./subfolder2"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m41 = import("./subfolder2/"); + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + const _m43 = import("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + // cjs format file + const x = 1; + export {x}; +==== index.ts (22 errors) ==== + import * as m1 from "./index.js"; + import * as m2 from "./index.mjs"; + import * as m3 from "./index.cjs"; + import * as m4 from "./subfolder/index.js"; + import * as m5 from "./subfolder/index.mjs"; + import * as m6 from "./subfolder/index.cjs"; + import * as m7 from "./subfolder2/index.js"; + import * as m8 from "./subfolder2/index.mjs"; + import * as m9 from "./subfolder2/index.cjs"; + import * as m10 from "./subfolder2/another/index.js"; + import * as m11 from "./subfolder2/another/index.mjs"; + import * as m12 from "./subfolder2/another/index.cjs"; + // The next ones shouldn't all work - esm format files have no index resolution or extension resolution + import * as m13 from "./"; + ~~~~ +!!! 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + import * as m15 from "./subfolder"; + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + import * as m18 from "./subfolder2"; + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + import * as m21 from "./subfolder2/another"; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + void m1; + void m2; + void m3; + void m4; + void m5; + void m6; + void m7; + void m8; + void m9; + void m10; + void m11; + void m12; + void m13; + void m14; + void m15; + void m16; + void m17; + void m18; + void m19; + void m20; + void m21; + void m22; + void m23; + + // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) + import m24 = require("./"); + import m25 = require("./index"); + import m26 = require("./subfolder"); + import m27 = require("./subfolder/"); + import m28 = require("./subfolder/index"); + import m29 = require("./subfolder2"); + import m30 = require("./subfolder2/"); + import m31 = require("./subfolder2/index"); + import m32 = require("./subfolder2/another"); + import m33 = require("./subfolder2/another/"); + import m34 = require("./subfolder2/another/index"); + void m24; + void m25; + void m26; + void m27; + void m28; + void m29; + void m30; + void m31; + void m32; + void m33; + void m34; + + // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution + const _m35 = import("./"); + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + const _m36 = import("./index"); + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + const _m37 = import("./subfolder"); + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m38 = import("./subfolder/"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + const _m40 = import("./subfolder2"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m41 = import("./subfolder2/"); + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + const _m43 = import("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + // esm format file + const x = 1; + export {x}; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== subfolder2/package.json (0 errors) ==== + { + } +==== subfolder2/another/package.json (0 errors) ==== + { + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModules1(module=node20).js b/tests/baselines/reference/nodeModules1(module=node20).js new file mode 100644 index 0000000000000..bfebc4d12e830 --- /dev/null +++ b/tests/baselines/reference/nodeModules1(module=node20).js @@ -0,0 +1,710 @@ +//// [tests/cases/conformance/node/nodeModules1.ts] //// + +//// [index.ts] +// cjs format file +const x = 1; +export {x}; +//// [index.cts] +// cjs format file +const x = 1; +export {x}; +//// [index.mts] +// esm format file +const x = 1; +export {x}; +//// [index.ts] +// cjs format file +const x = 1; +export {x}; +//// [index.cts] +// cjs format file +const x = 1; +export {x}; +//// [index.mts] +// esm format file +const x = 1; +export {x}; +//// [index.ts] +// esm format file +const x = 1; +export {x}; +//// [index.mts] +// esm format file +const x = 1; +export {x}; +//// [index.cts] +// cjs format file +const x = 1; +export {x}; +//// [index.mts] +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +import m25 = require("./index"); +import m26 = require("./subfolder"); +import m27 = require("./subfolder/"); +import m28 = require("./subfolder/index"); +import m29 = require("./subfolder2"); +import m30 = require("./subfolder2/"); +import m31 = require("./subfolder2/index"); +import m32 = require("./subfolder2/another"); +import m33 = require("./subfolder2/another/"); +import m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); + +// esm format file +const x = 1; +export {x}; +//// [index.cts] +// ESM-format imports below should issue errors +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +import m25 = require("./index"); +import m26 = require("./subfolder"); +import m27 = require("./subfolder/"); +import m28 = require("./subfolder/index"); +import m29 = require("./subfolder2"); +import m30 = require("./subfolder2/"); +import m31 = require("./subfolder2/index"); +import m32 = require("./subfolder2/another"); +import m33 = require("./subfolder2/another/"); +import m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// cjs format file +const x = 1; +export {x}; +//// [index.ts] +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +import m25 = require("./index"); +import m26 = require("./subfolder"); +import m27 = require("./subfolder/"); +import m28 = require("./subfolder/index"); +import m29 = require("./subfolder2"); +import m30 = require("./subfolder2/"); +import m31 = require("./subfolder2/index"); +import m32 = require("./subfolder2/another"); +import m33 = require("./subfolder2/another/"); +import m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// esm format file +const x = 1; +export {x}; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [package.json] +{ +} +//// [package.json] +{ + "type": "module" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.mjs] +// esm format file +const x = 1; +export { x }; +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.mjs] +// esm format file +const x = 1; +export { x }; +//// [index.js] +// esm format file +const x = 1; +export { x }; +//// [index.mjs] +// esm format file +const x = 1; +export { x }; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// ESM-format imports below should issue errors +const m1 = __importStar(require("./index.js")); +const m2 = __importStar(require("./index.mjs")); +const m3 = __importStar(require("./index.cjs")); +const m4 = __importStar(require("./subfolder/index.js")); +const m5 = __importStar(require("./subfolder/index.mjs")); +const m6 = __importStar(require("./subfolder/index.cjs")); +const m7 = __importStar(require("./subfolder2/index.js")); +const m8 = __importStar(require("./subfolder2/index.mjs")); +const m9 = __importStar(require("./subfolder2/index.cjs")); +const m10 = __importStar(require("./subfolder2/another/index.js")); +const m11 = __importStar(require("./subfolder2/another/index.mjs")); +const m12 = __importStar(require("./subfolder2/another/index.cjs")); +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +const m13 = __importStar(require("./")); +const m14 = __importStar(require("./index")); +const m15 = __importStar(require("./subfolder")); +const m16 = __importStar(require("./subfolder/")); +const m17 = __importStar(require("./subfolder/index")); +const m18 = __importStar(require("./subfolder2")); +const m19 = __importStar(require("./subfolder2/")); +const m20 = __importStar(require("./subfolder2/index")); +const m21 = __importStar(require("./subfolder2/another")); +const m22 = __importStar(require("./subfolder2/another/")); +const m23 = __importStar(require("./subfolder2/another/index")); +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +const m24 = require("./"); +const m25 = require("./index"); +const m26 = require("./subfolder"); +const m27 = require("./subfolder/"); +const m28 = require("./subfolder/index"); +const m29 = require("./subfolder2"); +const m30 = require("./subfolder2/"); +const m31 = require("./subfolder2/index"); +const m32 = require("./subfolder2/another"); +const m33 = require("./subfolder2/another/"); +const m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// cjs format file +const x = 1; +exports.x = x; +//// [index.js] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +const m24 = __require("./"); +const m25 = __require("./index"); +const m26 = __require("./subfolder"); +const m27 = __require("./subfolder/"); +const m28 = __require("./subfolder/index"); +const m29 = __require("./subfolder2"); +const m30 = __require("./subfolder2/"); +const m31 = __require("./subfolder2/index"); +const m32 = __require("./subfolder2/another"); +const m33 = __require("./subfolder2/another/"); +const m34 = __require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// esm format file +const x = 1; +export { x }; +//// [index.mjs] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +const m24 = __require("./"); +const m25 = __require("./index"); +const m26 = __require("./subfolder"); +const m27 = __require("./subfolder/"); +const m28 = __require("./subfolder/index"); +const m29 = __require("./subfolder2"); +const m30 = __require("./subfolder2/"); +const m31 = __require("./subfolder2/index"); +const m32 = __require("./subfolder2/another"); +const m33 = __require("./subfolder2/another/"); +const m34 = __require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// esm format file +const x = 1; +export { x }; + + +//// [index.d.ts] +declare const x = 1; +export { x }; +//// [index.d.cts] +declare const x = 1; +export { x }; +//// [index.d.mts] +declare const x = 1; +export { x }; +//// [index.d.ts] +declare const x = 1; +export { x }; +//// [index.d.cts] +declare const x = 1; +export { x }; +//// [index.d.mts] +declare const x = 1; +export { x }; +//// [index.d.ts] +declare const x = 1; +export { x }; +//// [index.d.mts] +declare const x = 1; +export { x }; +//// [index.d.cts] +declare const x = 1; +export { x }; +//// [index.d.cts] +declare const x = 1; +export { x }; +//// [index.d.ts] +declare const x = 1; +export { x }; +//// [index.d.mts] +declare const x = 1; +export { x }; diff --git a/tests/baselines/reference/nodeModules1(module=node20).symbols b/tests/baselines/reference/nodeModules1(module=node20).symbols new file mode 100644 index 0000000000000..cf80f6db97d80 --- /dev/null +++ b/tests/baselines/reference/nodeModules1(module=node20).symbols @@ -0,0 +1,819 @@ +//// [tests/cases/conformance/node/nodeModules1.ts] //// + +=== subfolder/index.ts === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.ts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +=== subfolder/index.cts === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.cts, 2, 8)) + +=== subfolder/index.mts === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.mts, 2, 8)) + +=== subfolder2/index.ts === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.ts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +=== subfolder2/index.cts === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.cts, 2, 8)) + +=== subfolder2/index.mts === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.mts, 2, 8)) + +=== subfolder2/another/index.ts === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.ts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +=== subfolder2/another/index.mts === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.mts, 2, 8)) + +=== subfolder2/another/index.cts === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.cts, 2, 8)) + +=== index.mts === +import * as m1 from "./index.js"; +>m1 : Symbol(m1, Decl(index.mts, 0, 6)) + +import * as m2 from "./index.mjs"; +>m2 : Symbol(m2, Decl(index.mts, 1, 6)) + +import * as m3 from "./index.cjs"; +>m3 : Symbol(m3, Decl(index.mts, 2, 6)) + +import * as m4 from "./subfolder/index.js"; +>m4 : Symbol(m4, Decl(index.mts, 3, 6)) + +import * as m5 from "./subfolder/index.mjs"; +>m5 : Symbol(m5, Decl(index.mts, 4, 6)) + +import * as m6 from "./subfolder/index.cjs"; +>m6 : Symbol(m6, Decl(index.mts, 5, 6)) + +import * as m7 from "./subfolder2/index.js"; +>m7 : Symbol(m7, Decl(index.mts, 6, 6)) + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : Symbol(m8, Decl(index.mts, 7, 6)) + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : Symbol(m9, Decl(index.mts, 8, 6)) + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : Symbol(m10, Decl(index.mts, 9, 6)) + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : Symbol(m11, Decl(index.mts, 10, 6)) + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : Symbol(m12, Decl(index.mts, 11, 6)) + +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : Symbol(m13, Decl(index.mts, 13, 6)) + +import * as m14 from "./index"; +>m14 : Symbol(m14, Decl(index.mts, 14, 6)) + +import * as m15 from "./subfolder"; +>m15 : Symbol(m15, Decl(index.mts, 15, 6)) + +import * as m16 from "./subfolder/"; +>m16 : Symbol(m16, Decl(index.mts, 16, 6)) + +import * as m17 from "./subfolder/index"; +>m17 : Symbol(m17, Decl(index.mts, 17, 6)) + +import * as m18 from "./subfolder2"; +>m18 : Symbol(m18, Decl(index.mts, 18, 6)) + +import * as m19 from "./subfolder2/"; +>m19 : Symbol(m19, Decl(index.mts, 19, 6)) + +import * as m20 from "./subfolder2/index"; +>m20 : Symbol(m20, Decl(index.mts, 20, 6)) + +import * as m21 from "./subfolder2/another"; +>m21 : Symbol(m21, Decl(index.mts, 21, 6)) + +import * as m22 from "./subfolder2/another/"; +>m22 : Symbol(m22, Decl(index.mts, 22, 6)) + +import * as m23 from "./subfolder2/another/index"; +>m23 : Symbol(m23, Decl(index.mts, 23, 6)) + +void m1; +>m1 : Symbol(m1, Decl(index.mts, 0, 6)) + +void m2; +>m2 : Symbol(m2, Decl(index.mts, 1, 6)) + +void m3; +>m3 : Symbol(m3, Decl(index.mts, 2, 6)) + +void m4; +>m4 : Symbol(m4, Decl(index.mts, 3, 6)) + +void m5; +>m5 : Symbol(m5, Decl(index.mts, 4, 6)) + +void m6; +>m6 : Symbol(m6, Decl(index.mts, 5, 6)) + +void m7; +>m7 : Symbol(m7, Decl(index.mts, 6, 6)) + +void m8; +>m8 : Symbol(m8, Decl(index.mts, 7, 6)) + +void m9; +>m9 : Symbol(m9, Decl(index.mts, 8, 6)) + +void m10; +>m10 : Symbol(m10, Decl(index.mts, 9, 6)) + +void m11; +>m11 : Symbol(m11, Decl(index.mts, 10, 6)) + +void m12; +>m12 : Symbol(m12, Decl(index.mts, 11, 6)) + +void m13; +>m13 : Symbol(m13, Decl(index.mts, 13, 6)) + +void m14; +>m14 : Symbol(m14, Decl(index.mts, 14, 6)) + +void m15; +>m15 : Symbol(m15, Decl(index.mts, 15, 6)) + +void m16; +>m16 : Symbol(m16, Decl(index.mts, 16, 6)) + +void m17; +>m17 : Symbol(m17, Decl(index.mts, 17, 6)) + +void m18; +>m18 : Symbol(m18, Decl(index.mts, 18, 6)) + +void m19; +>m19 : Symbol(m19, Decl(index.mts, 19, 6)) + +void m20; +>m20 : Symbol(m20, Decl(index.mts, 20, 6)) + +void m21; +>m21 : Symbol(m21, Decl(index.mts, 21, 6)) + +void m22; +>m22 : Symbol(m22, Decl(index.mts, 22, 6)) + +void m23; +>m23 : Symbol(m23, Decl(index.mts, 23, 6)) + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : Symbol(m24, Decl(index.mts, 46, 9)) + +import m25 = require("./index"); +>m25 : Symbol(m25, Decl(index.mts, 49, 27)) + +import m26 = require("./subfolder"); +>m26 : Symbol(m26, Decl(index.mts, 50, 32)) + +import m27 = require("./subfolder/"); +>m27 : Symbol(m27, Decl(index.mts, 51, 36)) + +import m28 = require("./subfolder/index"); +>m28 : Symbol(m28, Decl(index.mts, 52, 37)) + +import m29 = require("./subfolder2"); +>m29 : Symbol(m29, Decl(index.mts, 53, 42)) + +import m30 = require("./subfolder2/"); +>m30 : Symbol(m30, Decl(index.mts, 54, 37)) + +import m31 = require("./subfolder2/index"); +>m31 : Symbol(m31, Decl(index.mts, 55, 38)) + +import m32 = require("./subfolder2/another"); +>m32 : Symbol(m32, Decl(index.mts, 56, 43)) + +import m33 = require("./subfolder2/another/"); +>m33 : Symbol(m33, Decl(index.mts, 57, 45)) + +import m34 = require("./subfolder2/another/index"); +>m34 : Symbol(m34, Decl(index.mts, 58, 46)) + +void m24; +>m24 : Symbol(m24, Decl(index.mts, 46, 9)) + +void m25; +>m25 : Symbol(m25, Decl(index.mts, 49, 27)) + +void m26; +>m26 : Symbol(m26, Decl(index.mts, 50, 32)) + +void m27; +>m27 : Symbol(m27, Decl(index.mts, 51, 36)) + +void m28; +>m28 : Symbol(m28, Decl(index.mts, 52, 37)) + +void m29; +>m29 : Symbol(m29, Decl(index.mts, 53, 42)) + +void m30; +>m30 : Symbol(m30, Decl(index.mts, 54, 37)) + +void m31; +>m31 : Symbol(m31, Decl(index.mts, 55, 38)) + +void m32; +>m32 : Symbol(m32, Decl(index.mts, 56, 43)) + +void m33; +>m33 : Symbol(m33, Decl(index.mts, 57, 45)) + +void m34; +>m34 : Symbol(m34, Decl(index.mts, 58, 46)) + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Symbol(_m35, Decl(index.mts, 73, 5)) + +const _m36 = import("./index"); +>_m36 : Symbol(_m36, Decl(index.mts, 74, 5)) + +const _m37 = import("./subfolder"); +>_m37 : Symbol(_m37, Decl(index.mts, 75, 5)) + +const _m38 = import("./subfolder/"); +>_m38 : Symbol(_m38, Decl(index.mts, 76, 5)) + +const _m39 = import("./subfolder/index"); +>_m39 : Symbol(_m39, Decl(index.mts, 77, 5)) + +const _m40 = import("./subfolder2"); +>_m40 : Symbol(_m40, Decl(index.mts, 78, 5)) + +const _m41 = import("./subfolder2/"); +>_m41 : Symbol(_m41, Decl(index.mts, 79, 5)) + +const _m42 = import("./subfolder2/index"); +>_m42 : Symbol(_m42, Decl(index.mts, 80, 5)) + +const _m43 = import("./subfolder2/another"); +>_m43 : Symbol(_m43, Decl(index.mts, 81, 5)) + +const _m44 = import("./subfolder2/another/"); +>_m44 : Symbol(_m44, Decl(index.mts, 82, 5)) + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Symbol(_m45, Decl(index.mts, 83, 5)) + +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mts, 86, 5)) + +export {x}; +>x : Symbol(m2.x, Decl(index.mts, 87, 8)) + +=== index.cts === +// ESM-format imports below should issue errors +import * as m1 from "./index.js"; +>m1 : Symbol(m1, Decl(index.cts, 1, 6)) + +import * as m2 from "./index.mjs"; +>m2 : Symbol(m2, Decl(index.cts, 2, 6)) + +import * as m3 from "./index.cjs"; +>m3 : Symbol(m3, Decl(index.cts, 3, 6)) + +import * as m4 from "./subfolder/index.js"; +>m4 : Symbol(m4, Decl(index.cts, 4, 6)) + +import * as m5 from "./subfolder/index.mjs"; +>m5 : Symbol(m5, Decl(index.cts, 5, 6)) + +import * as m6 from "./subfolder/index.cjs"; +>m6 : Symbol(m6, Decl(index.cts, 6, 6)) + +import * as m7 from "./subfolder2/index.js"; +>m7 : Symbol(m7, Decl(index.cts, 7, 6)) + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : Symbol(m8, Decl(index.cts, 8, 6)) + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : Symbol(m9, Decl(index.cts, 9, 6)) + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : Symbol(m10, Decl(index.cts, 10, 6)) + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : Symbol(m11, Decl(index.cts, 11, 6)) + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : Symbol(m12, Decl(index.cts, 12, 6)) + +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +import * as m13 from "./"; +>m13 : Symbol(m13, Decl(index.cts, 14, 6)) + +import * as m14 from "./index"; +>m14 : Symbol(m14, Decl(index.cts, 15, 6)) + +import * as m15 from "./subfolder"; +>m15 : Symbol(m15, Decl(index.cts, 16, 6)) + +import * as m16 from "./subfolder/"; +>m16 : Symbol(m16, Decl(index.cts, 17, 6)) + +import * as m17 from "./subfolder/index"; +>m17 : Symbol(m17, Decl(index.cts, 18, 6)) + +import * as m18 from "./subfolder2"; +>m18 : Symbol(m18, Decl(index.cts, 19, 6)) + +import * as m19 from "./subfolder2/"; +>m19 : Symbol(m19, Decl(index.cts, 20, 6)) + +import * as m20 from "./subfolder2/index"; +>m20 : Symbol(m20, Decl(index.cts, 21, 6)) + +import * as m21 from "./subfolder2/another"; +>m21 : Symbol(m21, Decl(index.cts, 22, 6)) + +import * as m22 from "./subfolder2/another/"; +>m22 : Symbol(m22, Decl(index.cts, 23, 6)) + +import * as m23 from "./subfolder2/another/index"; +>m23 : Symbol(m23, Decl(index.cts, 24, 6)) + +void m1; +>m1 : Symbol(m1, Decl(index.cts, 1, 6)) + +void m2; +>m2 : Symbol(m2, Decl(index.cts, 2, 6)) + +void m3; +>m3 : Symbol(m3, Decl(index.cts, 3, 6)) + +void m4; +>m4 : Symbol(m4, Decl(index.cts, 4, 6)) + +void m5; +>m5 : Symbol(m5, Decl(index.cts, 5, 6)) + +void m6; +>m6 : Symbol(m6, Decl(index.cts, 6, 6)) + +void m7; +>m7 : Symbol(m7, Decl(index.cts, 7, 6)) + +void m8; +>m8 : Symbol(m8, Decl(index.cts, 8, 6)) + +void m9; +>m9 : Symbol(m9, Decl(index.cts, 9, 6)) + +void m10; +>m10 : Symbol(m10, Decl(index.cts, 10, 6)) + +void m11; +>m11 : Symbol(m11, Decl(index.cts, 11, 6)) + +void m12; +>m12 : Symbol(m12, Decl(index.cts, 12, 6)) + +void m13; +>m13 : Symbol(m13, Decl(index.cts, 14, 6)) + +void m14; +>m14 : Symbol(m14, Decl(index.cts, 15, 6)) + +void m15; +>m15 : Symbol(m15, Decl(index.cts, 16, 6)) + +void m16; +>m16 : Symbol(m16, Decl(index.cts, 17, 6)) + +void m17; +>m17 : Symbol(m17, Decl(index.cts, 18, 6)) + +void m18; +>m18 : Symbol(m18, Decl(index.cts, 19, 6)) + +void m19; +>m19 : Symbol(m19, Decl(index.cts, 20, 6)) + +void m20; +>m20 : Symbol(m20, Decl(index.cts, 21, 6)) + +void m21; +>m21 : Symbol(m21, Decl(index.cts, 22, 6)) + +void m22; +>m22 : Symbol(m22, Decl(index.cts, 23, 6)) + +void m23; +>m23 : Symbol(m23, Decl(index.cts, 24, 6)) + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : Symbol(m24, Decl(index.cts, 47, 9)) + +import m25 = require("./index"); +>m25 : Symbol(m25, Decl(index.cts, 50, 27)) + +import m26 = require("./subfolder"); +>m26 : Symbol(m26, Decl(index.cts, 51, 32)) + +import m27 = require("./subfolder/"); +>m27 : Symbol(m27, Decl(index.cts, 52, 36)) + +import m28 = require("./subfolder/index"); +>m28 : Symbol(m28, Decl(index.cts, 53, 37)) + +import m29 = require("./subfolder2"); +>m29 : Symbol(m29, Decl(index.cts, 54, 42)) + +import m30 = require("./subfolder2/"); +>m30 : Symbol(m30, Decl(index.cts, 55, 37)) + +import m31 = require("./subfolder2/index"); +>m31 : Symbol(m31, Decl(index.cts, 56, 38)) + +import m32 = require("./subfolder2/another"); +>m32 : Symbol(m32, Decl(index.cts, 57, 43)) + +import m33 = require("./subfolder2/another/"); +>m33 : Symbol(m33, Decl(index.cts, 58, 45)) + +import m34 = require("./subfolder2/another/index"); +>m34 : Symbol(m34, Decl(index.cts, 59, 46)) + +void m24; +>m24 : Symbol(m24, Decl(index.cts, 47, 9)) + +void m25; +>m25 : Symbol(m25, Decl(index.cts, 50, 27)) + +void m26; +>m26 : Symbol(m26, Decl(index.cts, 51, 32)) + +void m27; +>m27 : Symbol(m27, Decl(index.cts, 52, 36)) + +void m28; +>m28 : Symbol(m28, Decl(index.cts, 53, 37)) + +void m29; +>m29 : Symbol(m29, Decl(index.cts, 54, 42)) + +void m30; +>m30 : Symbol(m30, Decl(index.cts, 55, 37)) + +void m31; +>m31 : Symbol(m31, Decl(index.cts, 56, 38)) + +void m32; +>m32 : Symbol(m32, Decl(index.cts, 57, 43)) + +void m33; +>m33 : Symbol(m33, Decl(index.cts, 58, 45)) + +void m34; +>m34 : Symbol(m34, Decl(index.cts, 59, 46)) + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Symbol(_m35, Decl(index.cts, 74, 5)) + +const _m36 = import("./index"); +>_m36 : Symbol(_m36, Decl(index.cts, 75, 5)) + +const _m37 = import("./subfolder"); +>_m37 : Symbol(_m37, Decl(index.cts, 76, 5)) + +const _m38 = import("./subfolder/"); +>_m38 : Symbol(_m38, Decl(index.cts, 77, 5)) + +const _m39 = import("./subfolder/index"); +>_m39 : Symbol(_m39, Decl(index.cts, 78, 5)) + +const _m40 = import("./subfolder2"); +>_m40 : Symbol(_m40, Decl(index.cts, 79, 5)) + +const _m41 = import("./subfolder2/"); +>_m41 : Symbol(_m41, Decl(index.cts, 80, 5)) + +const _m42 = import("./subfolder2/index"); +>_m42 : Symbol(_m42, Decl(index.cts, 81, 5)) + +const _m43 = import("./subfolder2/another"); +>_m43 : Symbol(_m43, Decl(index.cts, 82, 5)) + +const _m44 = import("./subfolder2/another/"); +>_m44 : Symbol(_m44, Decl(index.cts, 83, 5)) + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Symbol(_m45, Decl(index.cts, 84, 5)) + +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cts, 86, 5)) + +export {x}; +>x : Symbol(m3.x, Decl(index.cts, 87, 8)) + +=== index.ts === +import * as m1 from "./index.js"; +>m1 : Symbol(m1, Decl(index.ts, 0, 6)) + +import * as m2 from "./index.mjs"; +>m2 : Symbol(m2, Decl(index.ts, 1, 6)) + +import * as m3 from "./index.cjs"; +>m3 : Symbol(m3, Decl(index.ts, 2, 6)) + +import * as m4 from "./subfolder/index.js"; +>m4 : Symbol(m4, Decl(index.ts, 3, 6)) + +import * as m5 from "./subfolder/index.mjs"; +>m5 : Symbol(m5, Decl(index.ts, 4, 6)) + +import * as m6 from "./subfolder/index.cjs"; +>m6 : Symbol(m6, Decl(index.ts, 5, 6)) + +import * as m7 from "./subfolder2/index.js"; +>m7 : Symbol(m7, Decl(index.ts, 6, 6)) + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : Symbol(m8, Decl(index.ts, 7, 6)) + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : Symbol(m9, Decl(index.ts, 8, 6)) + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : Symbol(m10, Decl(index.ts, 9, 6)) + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : Symbol(m11, Decl(index.ts, 10, 6)) + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : Symbol(m12, Decl(index.ts, 11, 6)) + +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : Symbol(m13, Decl(index.ts, 13, 6)) + +import * as m14 from "./index"; +>m14 : Symbol(m14, Decl(index.ts, 14, 6)) + +import * as m15 from "./subfolder"; +>m15 : Symbol(m15, Decl(index.ts, 15, 6)) + +import * as m16 from "./subfolder/"; +>m16 : Symbol(m16, Decl(index.ts, 16, 6)) + +import * as m17 from "./subfolder/index"; +>m17 : Symbol(m17, Decl(index.ts, 17, 6)) + +import * as m18 from "./subfolder2"; +>m18 : Symbol(m18, Decl(index.ts, 18, 6)) + +import * as m19 from "./subfolder2/"; +>m19 : Symbol(m19, Decl(index.ts, 19, 6)) + +import * as m20 from "./subfolder2/index"; +>m20 : Symbol(m20, Decl(index.ts, 20, 6)) + +import * as m21 from "./subfolder2/another"; +>m21 : Symbol(m21, Decl(index.ts, 21, 6)) + +import * as m22 from "./subfolder2/another/"; +>m22 : Symbol(m22, Decl(index.ts, 22, 6)) + +import * as m23 from "./subfolder2/another/index"; +>m23 : Symbol(m23, Decl(index.ts, 23, 6)) + +void m1; +>m1 : Symbol(m1, Decl(index.ts, 0, 6)) + +void m2; +>m2 : Symbol(m2, Decl(index.ts, 1, 6)) + +void m3; +>m3 : Symbol(m3, Decl(index.ts, 2, 6)) + +void m4; +>m4 : Symbol(m4, Decl(index.ts, 3, 6)) + +void m5; +>m5 : Symbol(m5, Decl(index.ts, 4, 6)) + +void m6; +>m6 : Symbol(m6, Decl(index.ts, 5, 6)) + +void m7; +>m7 : Symbol(m7, Decl(index.ts, 6, 6)) + +void m8; +>m8 : Symbol(m8, Decl(index.ts, 7, 6)) + +void m9; +>m9 : Symbol(m9, Decl(index.ts, 8, 6)) + +void m10; +>m10 : Symbol(m10, Decl(index.ts, 9, 6)) + +void m11; +>m11 : Symbol(m11, Decl(index.ts, 10, 6)) + +void m12; +>m12 : Symbol(m12, Decl(index.ts, 11, 6)) + +void m13; +>m13 : Symbol(m13, Decl(index.ts, 13, 6)) + +void m14; +>m14 : Symbol(m14, Decl(index.ts, 14, 6)) + +void m15; +>m15 : Symbol(m15, Decl(index.ts, 15, 6)) + +void m16; +>m16 : Symbol(m16, Decl(index.ts, 16, 6)) + +void m17; +>m17 : Symbol(m17, Decl(index.ts, 17, 6)) + +void m18; +>m18 : Symbol(m18, Decl(index.ts, 18, 6)) + +void m19; +>m19 : Symbol(m19, Decl(index.ts, 19, 6)) + +void m20; +>m20 : Symbol(m20, Decl(index.ts, 20, 6)) + +void m21; +>m21 : Symbol(m21, Decl(index.ts, 21, 6)) + +void m22; +>m22 : Symbol(m22, Decl(index.ts, 22, 6)) + +void m23; +>m23 : Symbol(m23, Decl(index.ts, 23, 6)) + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : Symbol(m24, Decl(index.ts, 46, 9)) + +import m25 = require("./index"); +>m25 : Symbol(m25, Decl(index.ts, 49, 27)) + +import m26 = require("./subfolder"); +>m26 : Symbol(m26, Decl(index.ts, 50, 32)) + +import m27 = require("./subfolder/"); +>m27 : Symbol(m27, Decl(index.ts, 51, 36)) + +import m28 = require("./subfolder/index"); +>m28 : Symbol(m28, Decl(index.ts, 52, 37)) + +import m29 = require("./subfolder2"); +>m29 : Symbol(m29, Decl(index.ts, 53, 42)) + +import m30 = require("./subfolder2/"); +>m30 : Symbol(m30, Decl(index.ts, 54, 37)) + +import m31 = require("./subfolder2/index"); +>m31 : Symbol(m31, Decl(index.ts, 55, 38)) + +import m32 = require("./subfolder2/another"); +>m32 : Symbol(m32, Decl(index.ts, 56, 43)) + +import m33 = require("./subfolder2/another/"); +>m33 : Symbol(m33, Decl(index.ts, 57, 45)) + +import m34 = require("./subfolder2/another/index"); +>m34 : Symbol(m34, Decl(index.ts, 58, 46)) + +void m24; +>m24 : Symbol(m24, Decl(index.ts, 46, 9)) + +void m25; +>m25 : Symbol(m25, Decl(index.ts, 49, 27)) + +void m26; +>m26 : Symbol(m26, Decl(index.ts, 50, 32)) + +void m27; +>m27 : Symbol(m27, Decl(index.ts, 51, 36)) + +void m28; +>m28 : Symbol(m28, Decl(index.ts, 52, 37)) + +void m29; +>m29 : Symbol(m29, Decl(index.ts, 53, 42)) + +void m30; +>m30 : Symbol(m30, Decl(index.ts, 54, 37)) + +void m31; +>m31 : Symbol(m31, Decl(index.ts, 55, 38)) + +void m32; +>m32 : Symbol(m32, Decl(index.ts, 56, 43)) + +void m33; +>m33 : Symbol(m33, Decl(index.ts, 57, 45)) + +void m34; +>m34 : Symbol(m34, Decl(index.ts, 58, 46)) + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Symbol(_m35, Decl(index.ts, 73, 5)) + +const _m36 = import("./index"); +>_m36 : Symbol(_m36, Decl(index.ts, 74, 5)) + +const _m37 = import("./subfolder"); +>_m37 : Symbol(_m37, Decl(index.ts, 75, 5)) + +const _m38 = import("./subfolder/"); +>_m38 : Symbol(_m38, Decl(index.ts, 76, 5)) + +const _m39 = import("./subfolder/index"); +>_m39 : Symbol(_m39, Decl(index.ts, 77, 5)) + +const _m40 = import("./subfolder2"); +>_m40 : Symbol(_m40, Decl(index.ts, 78, 5)) + +const _m41 = import("./subfolder2/"); +>_m41 : Symbol(_m41, Decl(index.ts, 79, 5)) + +const _m42 = import("./subfolder2/index"); +>_m42 : Symbol(_m42, Decl(index.ts, 80, 5)) + +const _m43 = import("./subfolder2/another"); +>_m43 : Symbol(_m43, Decl(index.ts, 81, 5)) + +const _m44 = import("./subfolder2/another/"); +>_m44 : Symbol(_m44, Decl(index.ts, 82, 5)) + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Symbol(_m45, Decl(index.ts, 83, 5)) + +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.ts, 85, 5)) + +export {x}; +>x : Symbol(m1.x, Decl(index.ts, 86, 8)) + diff --git a/tests/baselines/reference/nodeModules1(module=node20).types b/tests/baselines/reference/nodeModules1(module=node20).types new file mode 100644 index 0000000000000..49631af15a8e8 --- /dev/null +++ b/tests/baselines/reference/nodeModules1(module=node20).types @@ -0,0 +1,1440 @@ +//// [tests/cases/conformance/node/nodeModules1.ts] //// + +=== subfolder/index.ts === +// cjs format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder/index.cts === +// cjs format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder/index.mts === +// esm format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder2/index.ts === +// cjs format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder2/index.cts === +// cjs format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder2/index.mts === +// esm format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder2/another/index.ts === +// esm format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder2/another/index.mts === +// esm format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder2/another/index.cts === +// cjs format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== index.mts === +import * as m1 from "./index.js"; +>m1 : typeof m1 +> : ^^^^^^^^^ + +import * as m2 from "./index.mjs"; +>m2 : typeof m2 +> : ^^^^^^^^^ + +import * as m3 from "./index.cjs"; +>m3 : typeof m3 +> : ^^^^^^^^^ + +import * as m4 from "./subfolder/index.js"; +>m4 : typeof m4 +> : ^^^^^^^^^ + +import * as m5 from "./subfolder/index.mjs"; +>m5 : typeof m5 +> : ^^^^^^^^^ + +import * as m6 from "./subfolder/index.cjs"; +>m6 : typeof m6 +> : ^^^^^^^^^ + +import * as m7 from "./subfolder2/index.js"; +>m7 : typeof m7 +> : ^^^^^^^^^ + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : typeof m8 +> : ^^^^^^^^^ + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : typeof m9 +> : ^^^^^^^^^ + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : typeof m10 +> : ^^^^^^^^^^ + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : typeof m11 +> : ^^^^^^^^^^ + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : typeof m12 +> : ^^^^^^^^^^ + +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : any +> : ^^^ + +import * as m14 from "./index"; +>m14 : any +> : ^^^ + +import * as m15 from "./subfolder"; +>m15 : any +> : ^^^ + +import * as m16 from "./subfolder/"; +>m16 : any +> : ^^^ + +import * as m17 from "./subfolder/index"; +>m17 : any +> : ^^^ + +import * as m18 from "./subfolder2"; +>m18 : any +> : ^^^ + +import * as m19 from "./subfolder2/"; +>m19 : any +> : ^^^ + +import * as m20 from "./subfolder2/index"; +>m20 : any +> : ^^^ + +import * as m21 from "./subfolder2/another"; +>m21 : any +> : ^^^ + +import * as m22 from "./subfolder2/another/"; +>m22 : any +> : ^^^ + +import * as m23 from "./subfolder2/another/index"; +>m23 : any +> : ^^^ + +void m1; +>void m1 : undefined +> : ^^^^^^^^^ +>m1 : typeof m1 +> : ^^^^^^^^^ + +void m2; +>void m2 : undefined +> : ^^^^^^^^^ +>m2 : typeof m2 +> : ^^^^^^^^^ + +void m3; +>void m3 : undefined +> : ^^^^^^^^^ +>m3 : typeof m3 +> : ^^^^^^^^^ + +void m4; +>void m4 : undefined +> : ^^^^^^^^^ +>m4 : typeof m4 +> : ^^^^^^^^^ + +void m5; +>void m5 : undefined +> : ^^^^^^^^^ +>m5 : typeof m5 +> : ^^^^^^^^^ + +void m6; +>void m6 : undefined +> : ^^^^^^^^^ +>m6 : typeof m6 +> : ^^^^^^^^^ + +void m7; +>void m7 : undefined +> : ^^^^^^^^^ +>m7 : typeof m7 +> : ^^^^^^^^^ + +void m8; +>void m8 : undefined +> : ^^^^^^^^^ +>m8 : typeof m8 +> : ^^^^^^^^^ + +void m9; +>void m9 : undefined +> : ^^^^^^^^^ +>m9 : typeof m9 +> : ^^^^^^^^^ + +void m10; +>void m10 : undefined +> : ^^^^^^^^^ +>m10 : typeof m10 +> : ^^^^^^^^^^ + +void m11; +>void m11 : undefined +> : ^^^^^^^^^ +>m11 : typeof m11 +> : ^^^^^^^^^^ + +void m12; +>void m12 : undefined +> : ^^^^^^^^^ +>m12 : typeof m12 +> : ^^^^^^^^^^ + +void m13; +>void m13 : undefined +> : ^^^^^^^^^ +>m13 : any +> : ^^^ + +void m14; +>void m14 : undefined +> : ^^^^^^^^^ +>m14 : any +> : ^^^ + +void m15; +>void m15 : undefined +> : ^^^^^^^^^ +>m15 : any +> : ^^^ + +void m16; +>void m16 : undefined +> : ^^^^^^^^^ +>m16 : any +> : ^^^ + +void m17; +>void m17 : undefined +> : ^^^^^^^^^ +>m17 : any +> : ^^^ + +void m18; +>void m18 : undefined +> : ^^^^^^^^^ +>m18 : any +> : ^^^ + +void m19; +>void m19 : undefined +> : ^^^^^^^^^ +>m19 : any +> : ^^^ + +void m20; +>void m20 : undefined +> : ^^^^^^^^^ +>m20 : any +> : ^^^ + +void m21; +>void m21 : undefined +> : ^^^^^^^^^ +>m21 : any +> : ^^^ + +void m22; +>void m22 : undefined +> : ^^^^^^^^^ +>m22 : any +> : ^^^ + +void m23; +>void m23 : undefined +> : ^^^^^^^^^ +>m23 : any +> : ^^^ + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : typeof m1 +> : ^^^^^^^^^ + +import m25 = require("./index"); +>m25 : typeof m1 +> : ^^^^^^^^^ + +import m26 = require("./subfolder"); +>m26 : typeof m26 +> : ^^^^^^^^^^ + +import m27 = require("./subfolder/"); +>m27 : typeof m26 +> : ^^^^^^^^^^ + +import m28 = require("./subfolder/index"); +>m28 : typeof m26 +> : ^^^^^^^^^^ + +import m29 = require("./subfolder2"); +>m29 : typeof m29 +> : ^^^^^^^^^^ + +import m30 = require("./subfolder2/"); +>m30 : typeof m29 +> : ^^^^^^^^^^ + +import m31 = require("./subfolder2/index"); +>m31 : typeof m29 +> : ^^^^^^^^^^ + +import m32 = require("./subfolder2/another"); +>m32 : typeof m10 +> : ^^^^^^^^^^ + +import m33 = require("./subfolder2/another/"); +>m33 : typeof m10 +> : ^^^^^^^^^^ + +import m34 = require("./subfolder2/another/index"); +>m34 : typeof m10 +> : ^^^^^^^^^^ + +void m24; +>void m24 : undefined +> : ^^^^^^^^^ +>m24 : typeof m1 +> : ^^^^^^^^^ + +void m25; +>void m25 : undefined +> : ^^^^^^^^^ +>m25 : typeof m1 +> : ^^^^^^^^^ + +void m26; +>void m26 : undefined +> : ^^^^^^^^^ +>m26 : typeof m26 +> : ^^^^^^^^^^ + +void m27; +>void m27 : undefined +> : ^^^^^^^^^ +>m27 : typeof m26 +> : ^^^^^^^^^^ + +void m28; +>void m28 : undefined +> : ^^^^^^^^^ +>m28 : typeof m26 +> : ^^^^^^^^^^ + +void m29; +>void m29 : undefined +> : ^^^^^^^^^ +>m29 : typeof m29 +> : ^^^^^^^^^^ + +void m30; +>void m30 : undefined +> : ^^^^^^^^^ +>m30 : typeof m29 +> : ^^^^^^^^^^ + +void m31; +>void m31 : undefined +> : ^^^^^^^^^ +>m31 : typeof m29 +> : ^^^^^^^^^^ + +void m32; +>void m32 : undefined +> : ^^^^^^^^^ +>m32 : typeof m10 +> : ^^^^^^^^^^ + +void m33; +>void m33 : undefined +> : ^^^^^^^^^ +>m33 : typeof m10 +> : ^^^^^^^^^^ + +void m34; +>void m34 : undefined +> : ^^^^^^^^^ +>m34 : typeof m10 +> : ^^^^^^^^^^ + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Promise +> : ^^^^^^^^^^^^ +>import("./") : Promise +> : ^^^^^^^^^^^^ +>"./" : "./" +> : ^^^^ + +const _m36 = import("./index"); +>_m36 : Promise +> : ^^^^^^^^^^^^ +>import("./index") : Promise +> : ^^^^^^^^^^^^ +>"./index" : "./index" +> : ^^^^^^^^^ + +const _m37 = import("./subfolder"); +>_m37 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder" : "./subfolder" +> : ^^^^^^^^^^^^^ + +const _m38 = import("./subfolder/"); +>_m38 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder/" : "./subfolder/" +> : ^^^^^^^^^^^^^^ + +const _m39 = import("./subfolder/index"); +>_m39 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder/index" : "./subfolder/index" +> : ^^^^^^^^^^^^^^^^^^^ + +const _m40 = import("./subfolder2"); +>_m40 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2" : "./subfolder2" +> : ^^^^^^^^^^^^^^ + +const _m41 = import("./subfolder2/"); +>_m41 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/" : "./subfolder2/" +> : ^^^^^^^^^^^^^^^ + +const _m42 = import("./subfolder2/index"); +>_m42 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/index" : "./subfolder2/index" +> : ^^^^^^^^^^^^^^^^^^^^ + +const _m43 = import("./subfolder2/another"); +>_m43 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another" : "./subfolder2/another" +> : ^^^^^^^^^^^^^^^^^^^^^^ + +const _m44 = import("./subfolder2/another/"); +>_m44 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another/" : "./subfolder2/another/" +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another/index" : "./subfolder2/another/index" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +// esm format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== index.cts === +// ESM-format imports below should issue errors +import * as m1 from "./index.js"; +>m1 : typeof m1 +> : ^^^^^^^^^ + +import * as m2 from "./index.mjs"; +>m2 : typeof m2 +> : ^^^^^^^^^ + +import * as m3 from "./index.cjs"; +>m3 : typeof m3 +> : ^^^^^^^^^ + +import * as m4 from "./subfolder/index.js"; +>m4 : typeof m4 +> : ^^^^^^^^^ + +import * as m5 from "./subfolder/index.mjs"; +>m5 : typeof m5 +> : ^^^^^^^^^ + +import * as m6 from "./subfolder/index.cjs"; +>m6 : typeof m6 +> : ^^^^^^^^^ + +import * as m7 from "./subfolder2/index.js"; +>m7 : typeof m7 +> : ^^^^^^^^^ + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : typeof m8 +> : ^^^^^^^^^ + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : typeof m9 +> : ^^^^^^^^^ + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : typeof m10 +> : ^^^^^^^^^^ + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : typeof m11 +> : ^^^^^^^^^^ + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : typeof m12 +> : ^^^^^^^^^^ + +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +import * as m13 from "./"; +>m13 : typeof m1 +> : ^^^^^^^^^ + +import * as m14 from "./index"; +>m14 : typeof m1 +> : ^^^^^^^^^ + +import * as m15 from "./subfolder"; +>m15 : typeof m4 +> : ^^^^^^^^^ + +import * as m16 from "./subfolder/"; +>m16 : typeof m4 +> : ^^^^^^^^^ + +import * as m17 from "./subfolder/index"; +>m17 : typeof m4 +> : ^^^^^^^^^ + +import * as m18 from "./subfolder2"; +>m18 : typeof m7 +> : ^^^^^^^^^ + +import * as m19 from "./subfolder2/"; +>m19 : typeof m7 +> : ^^^^^^^^^ + +import * as m20 from "./subfolder2/index"; +>m20 : typeof m7 +> : ^^^^^^^^^ + +import * as m21 from "./subfolder2/another"; +>m21 : typeof m10 +> : ^^^^^^^^^^ + +import * as m22 from "./subfolder2/another/"; +>m22 : typeof m10 +> : ^^^^^^^^^^ + +import * as m23 from "./subfolder2/another/index"; +>m23 : typeof m10 +> : ^^^^^^^^^^ + +void m1; +>void m1 : undefined +> : ^^^^^^^^^ +>m1 : typeof m1 +> : ^^^^^^^^^ + +void m2; +>void m2 : undefined +> : ^^^^^^^^^ +>m2 : typeof m2 +> : ^^^^^^^^^ + +void m3; +>void m3 : undefined +> : ^^^^^^^^^ +>m3 : typeof m3 +> : ^^^^^^^^^ + +void m4; +>void m4 : undefined +> : ^^^^^^^^^ +>m4 : typeof m4 +> : ^^^^^^^^^ + +void m5; +>void m5 : undefined +> : ^^^^^^^^^ +>m5 : typeof m5 +> : ^^^^^^^^^ + +void m6; +>void m6 : undefined +> : ^^^^^^^^^ +>m6 : typeof m6 +> : ^^^^^^^^^ + +void m7; +>void m7 : undefined +> : ^^^^^^^^^ +>m7 : typeof m7 +> : ^^^^^^^^^ + +void m8; +>void m8 : undefined +> : ^^^^^^^^^ +>m8 : typeof m8 +> : ^^^^^^^^^ + +void m9; +>void m9 : undefined +> : ^^^^^^^^^ +>m9 : typeof m9 +> : ^^^^^^^^^ + +void m10; +>void m10 : undefined +> : ^^^^^^^^^ +>m10 : typeof m10 +> : ^^^^^^^^^^ + +void m11; +>void m11 : undefined +> : ^^^^^^^^^ +>m11 : typeof m11 +> : ^^^^^^^^^^ + +void m12; +>void m12 : undefined +> : ^^^^^^^^^ +>m12 : typeof m12 +> : ^^^^^^^^^^ + +void m13; +>void m13 : undefined +> : ^^^^^^^^^ +>m13 : typeof m1 +> : ^^^^^^^^^ + +void m14; +>void m14 : undefined +> : ^^^^^^^^^ +>m14 : typeof m1 +> : ^^^^^^^^^ + +void m15; +>void m15 : undefined +> : ^^^^^^^^^ +>m15 : typeof m4 +> : ^^^^^^^^^ + +void m16; +>void m16 : undefined +> : ^^^^^^^^^ +>m16 : typeof m4 +> : ^^^^^^^^^ + +void m17; +>void m17 : undefined +> : ^^^^^^^^^ +>m17 : typeof m4 +> : ^^^^^^^^^ + +void m18; +>void m18 : undefined +> : ^^^^^^^^^ +>m18 : typeof m7 +> : ^^^^^^^^^ + +void m19; +>void m19 : undefined +> : ^^^^^^^^^ +>m19 : typeof m7 +> : ^^^^^^^^^ + +void m20; +>void m20 : undefined +> : ^^^^^^^^^ +>m20 : typeof m7 +> : ^^^^^^^^^ + +void m21; +>void m21 : undefined +> : ^^^^^^^^^ +>m21 : typeof m10 +> : ^^^^^^^^^^ + +void m22; +>void m22 : undefined +> : ^^^^^^^^^ +>m22 : typeof m10 +> : ^^^^^^^^^^ + +void m23; +>void m23 : undefined +> : ^^^^^^^^^ +>m23 : typeof m10 +> : ^^^^^^^^^^ + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : typeof m1 +> : ^^^^^^^^^ + +import m25 = require("./index"); +>m25 : typeof m1 +> : ^^^^^^^^^ + +import m26 = require("./subfolder"); +>m26 : typeof m4 +> : ^^^^^^^^^ + +import m27 = require("./subfolder/"); +>m27 : typeof m4 +> : ^^^^^^^^^ + +import m28 = require("./subfolder/index"); +>m28 : typeof m4 +> : ^^^^^^^^^ + +import m29 = require("./subfolder2"); +>m29 : typeof m7 +> : ^^^^^^^^^ + +import m30 = require("./subfolder2/"); +>m30 : typeof m7 +> : ^^^^^^^^^ + +import m31 = require("./subfolder2/index"); +>m31 : typeof m7 +> : ^^^^^^^^^ + +import m32 = require("./subfolder2/another"); +>m32 : typeof m10 +> : ^^^^^^^^^^ + +import m33 = require("./subfolder2/another/"); +>m33 : typeof m10 +> : ^^^^^^^^^^ + +import m34 = require("./subfolder2/another/index"); +>m34 : typeof m10 +> : ^^^^^^^^^^ + +void m24; +>void m24 : undefined +> : ^^^^^^^^^ +>m24 : typeof m1 +> : ^^^^^^^^^ + +void m25; +>void m25 : undefined +> : ^^^^^^^^^ +>m25 : typeof m1 +> : ^^^^^^^^^ + +void m26; +>void m26 : undefined +> : ^^^^^^^^^ +>m26 : typeof m4 +> : ^^^^^^^^^ + +void m27; +>void m27 : undefined +> : ^^^^^^^^^ +>m27 : typeof m4 +> : ^^^^^^^^^ + +void m28; +>void m28 : undefined +> : ^^^^^^^^^ +>m28 : typeof m4 +> : ^^^^^^^^^ + +void m29; +>void m29 : undefined +> : ^^^^^^^^^ +>m29 : typeof m7 +> : ^^^^^^^^^ + +void m30; +>void m30 : undefined +> : ^^^^^^^^^ +>m30 : typeof m7 +> : ^^^^^^^^^ + +void m31; +>void m31 : undefined +> : ^^^^^^^^^ +>m31 : typeof m7 +> : ^^^^^^^^^ + +void m32; +>void m32 : undefined +> : ^^^^^^^^^ +>m32 : typeof m10 +> : ^^^^^^^^^^ + +void m33; +>void m33 : undefined +> : ^^^^^^^^^ +>m33 : typeof m10 +> : ^^^^^^^^^^ + +void m34; +>void m34 : undefined +> : ^^^^^^^^^ +>m34 : typeof m10 +> : ^^^^^^^^^^ + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Promise +> : ^^^^^^^^^^^^ +>import("./") : Promise +> : ^^^^^^^^^^^^ +>"./" : "./" +> : ^^^^ + +const _m36 = import("./index"); +>_m36 : Promise +> : ^^^^^^^^^^^^ +>import("./index") : Promise +> : ^^^^^^^^^^^^ +>"./index" : "./index" +> : ^^^^^^^^^ + +const _m37 = import("./subfolder"); +>_m37 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder" : "./subfolder" +> : ^^^^^^^^^^^^^ + +const _m38 = import("./subfolder/"); +>_m38 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder/" : "./subfolder/" +> : ^^^^^^^^^^^^^^ + +const _m39 = import("./subfolder/index"); +>_m39 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder/index" : "./subfolder/index" +> : ^^^^^^^^^^^^^^^^^^^ + +const _m40 = import("./subfolder2"); +>_m40 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2" : "./subfolder2" +> : ^^^^^^^^^^^^^^ + +const _m41 = import("./subfolder2/"); +>_m41 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/" : "./subfolder2/" +> : ^^^^^^^^^^^^^^^ + +const _m42 = import("./subfolder2/index"); +>_m42 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/index" : "./subfolder2/index" +> : ^^^^^^^^^^^^^^^^^^^^ + +const _m43 = import("./subfolder2/another"); +>_m43 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another" : "./subfolder2/another" +> : ^^^^^^^^^^^^^^^^^^^^^^ + +const _m44 = import("./subfolder2/another/"); +>_m44 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another/" : "./subfolder2/another/" +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another/index" : "./subfolder2/another/index" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +// cjs format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== index.ts === +import * as m1 from "./index.js"; +>m1 : typeof m1 +> : ^^^^^^^^^ + +import * as m2 from "./index.mjs"; +>m2 : typeof m2 +> : ^^^^^^^^^ + +import * as m3 from "./index.cjs"; +>m3 : typeof m3 +> : ^^^^^^^^^ + +import * as m4 from "./subfolder/index.js"; +>m4 : typeof m4 +> : ^^^^^^^^^ + +import * as m5 from "./subfolder/index.mjs"; +>m5 : typeof m5 +> : ^^^^^^^^^ + +import * as m6 from "./subfolder/index.cjs"; +>m6 : typeof m6 +> : ^^^^^^^^^ + +import * as m7 from "./subfolder2/index.js"; +>m7 : typeof m7 +> : ^^^^^^^^^ + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : typeof m8 +> : ^^^^^^^^^ + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : typeof m9 +> : ^^^^^^^^^ + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : typeof m10 +> : ^^^^^^^^^^ + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : typeof m11 +> : ^^^^^^^^^^ + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : typeof m12 +> : ^^^^^^^^^^ + +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : any +> : ^^^ + +import * as m14 from "./index"; +>m14 : any +> : ^^^ + +import * as m15 from "./subfolder"; +>m15 : any +> : ^^^ + +import * as m16 from "./subfolder/"; +>m16 : any +> : ^^^ + +import * as m17 from "./subfolder/index"; +>m17 : any +> : ^^^ + +import * as m18 from "./subfolder2"; +>m18 : any +> : ^^^ + +import * as m19 from "./subfolder2/"; +>m19 : any +> : ^^^ + +import * as m20 from "./subfolder2/index"; +>m20 : any +> : ^^^ + +import * as m21 from "./subfolder2/another"; +>m21 : any +> : ^^^ + +import * as m22 from "./subfolder2/another/"; +>m22 : any +> : ^^^ + +import * as m23 from "./subfolder2/another/index"; +>m23 : any +> : ^^^ + +void m1; +>void m1 : undefined +> : ^^^^^^^^^ +>m1 : typeof m1 +> : ^^^^^^^^^ + +void m2; +>void m2 : undefined +> : ^^^^^^^^^ +>m2 : typeof m2 +> : ^^^^^^^^^ + +void m3; +>void m3 : undefined +> : ^^^^^^^^^ +>m3 : typeof m3 +> : ^^^^^^^^^ + +void m4; +>void m4 : undefined +> : ^^^^^^^^^ +>m4 : typeof m4 +> : ^^^^^^^^^ + +void m5; +>void m5 : undefined +> : ^^^^^^^^^ +>m5 : typeof m5 +> : ^^^^^^^^^ + +void m6; +>void m6 : undefined +> : ^^^^^^^^^ +>m6 : typeof m6 +> : ^^^^^^^^^ + +void m7; +>void m7 : undefined +> : ^^^^^^^^^ +>m7 : typeof m7 +> : ^^^^^^^^^ + +void m8; +>void m8 : undefined +> : ^^^^^^^^^ +>m8 : typeof m8 +> : ^^^^^^^^^ + +void m9; +>void m9 : undefined +> : ^^^^^^^^^ +>m9 : typeof m9 +> : ^^^^^^^^^ + +void m10; +>void m10 : undefined +> : ^^^^^^^^^ +>m10 : typeof m10 +> : ^^^^^^^^^^ + +void m11; +>void m11 : undefined +> : ^^^^^^^^^ +>m11 : typeof m11 +> : ^^^^^^^^^^ + +void m12; +>void m12 : undefined +> : ^^^^^^^^^ +>m12 : typeof m12 +> : ^^^^^^^^^^ + +void m13; +>void m13 : undefined +> : ^^^^^^^^^ +>m13 : any +> : ^^^ + +void m14; +>void m14 : undefined +> : ^^^^^^^^^ +>m14 : any +> : ^^^ + +void m15; +>void m15 : undefined +> : ^^^^^^^^^ +>m15 : any +> : ^^^ + +void m16; +>void m16 : undefined +> : ^^^^^^^^^ +>m16 : any +> : ^^^ + +void m17; +>void m17 : undefined +> : ^^^^^^^^^ +>m17 : any +> : ^^^ + +void m18; +>void m18 : undefined +> : ^^^^^^^^^ +>m18 : any +> : ^^^ + +void m19; +>void m19 : undefined +> : ^^^^^^^^^ +>m19 : any +> : ^^^ + +void m20; +>void m20 : undefined +> : ^^^^^^^^^ +>m20 : any +> : ^^^ + +void m21; +>void m21 : undefined +> : ^^^^^^^^^ +>m21 : any +> : ^^^ + +void m22; +>void m22 : undefined +> : ^^^^^^^^^ +>m22 : any +> : ^^^ + +void m23; +>void m23 : undefined +> : ^^^^^^^^^ +>m23 : any +> : ^^^ + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : typeof m1 +> : ^^^^^^^^^ + +import m25 = require("./index"); +>m25 : typeof m1 +> : ^^^^^^^^^ + +import m26 = require("./subfolder"); +>m26 : typeof m26 +> : ^^^^^^^^^^ + +import m27 = require("./subfolder/"); +>m27 : typeof m26 +> : ^^^^^^^^^^ + +import m28 = require("./subfolder/index"); +>m28 : typeof m26 +> : ^^^^^^^^^^ + +import m29 = require("./subfolder2"); +>m29 : typeof m29 +> : ^^^^^^^^^^ + +import m30 = require("./subfolder2/"); +>m30 : typeof m29 +> : ^^^^^^^^^^ + +import m31 = require("./subfolder2/index"); +>m31 : typeof m29 +> : ^^^^^^^^^^ + +import m32 = require("./subfolder2/another"); +>m32 : typeof m10 +> : ^^^^^^^^^^ + +import m33 = require("./subfolder2/another/"); +>m33 : typeof m10 +> : ^^^^^^^^^^ + +import m34 = require("./subfolder2/another/index"); +>m34 : typeof m10 +> : ^^^^^^^^^^ + +void m24; +>void m24 : undefined +> : ^^^^^^^^^ +>m24 : typeof m1 +> : ^^^^^^^^^ + +void m25; +>void m25 : undefined +> : ^^^^^^^^^ +>m25 : typeof m1 +> : ^^^^^^^^^ + +void m26; +>void m26 : undefined +> : ^^^^^^^^^ +>m26 : typeof m26 +> : ^^^^^^^^^^ + +void m27; +>void m27 : undefined +> : ^^^^^^^^^ +>m27 : typeof m26 +> : ^^^^^^^^^^ + +void m28; +>void m28 : undefined +> : ^^^^^^^^^ +>m28 : typeof m26 +> : ^^^^^^^^^^ + +void m29; +>void m29 : undefined +> : ^^^^^^^^^ +>m29 : typeof m29 +> : ^^^^^^^^^^ + +void m30; +>void m30 : undefined +> : ^^^^^^^^^ +>m30 : typeof m29 +> : ^^^^^^^^^^ + +void m31; +>void m31 : undefined +> : ^^^^^^^^^ +>m31 : typeof m29 +> : ^^^^^^^^^^ + +void m32; +>void m32 : undefined +> : ^^^^^^^^^ +>m32 : typeof m10 +> : ^^^^^^^^^^ + +void m33; +>void m33 : undefined +> : ^^^^^^^^^ +>m33 : typeof m10 +> : ^^^^^^^^^^ + +void m34; +>void m34 : undefined +> : ^^^^^^^^^ +>m34 : typeof m10 +> : ^^^^^^^^^^ + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Promise +> : ^^^^^^^^^^^^ +>import("./") : Promise +> : ^^^^^^^^^^^^ +>"./" : "./" +> : ^^^^ + +const _m36 = import("./index"); +>_m36 : Promise +> : ^^^^^^^^^^^^ +>import("./index") : Promise +> : ^^^^^^^^^^^^ +>"./index" : "./index" +> : ^^^^^^^^^ + +const _m37 = import("./subfolder"); +>_m37 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder" : "./subfolder" +> : ^^^^^^^^^^^^^ + +const _m38 = import("./subfolder/"); +>_m38 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder/" : "./subfolder/" +> : ^^^^^^^^^^^^^^ + +const _m39 = import("./subfolder/index"); +>_m39 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder/index" : "./subfolder/index" +> : ^^^^^^^^^^^^^^^^^^^ + +const _m40 = import("./subfolder2"); +>_m40 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2" : "./subfolder2" +> : ^^^^^^^^^^^^^^ + +const _m41 = import("./subfolder2/"); +>_m41 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/" : "./subfolder2/" +> : ^^^^^^^^^^^^^^^ + +const _m42 = import("./subfolder2/index"); +>_m42 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/index" : "./subfolder2/index" +> : ^^^^^^^^^^^^^^^^^^^^ + +const _m43 = import("./subfolder2/another"); +>_m43 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another" : "./subfolder2/another" +> : ^^^^^^^^^^^^^^^^^^^^^^ + +const _m44 = import("./subfolder2/another/"); +>_m44 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another/" : "./subfolder2/another/" +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another/index" : "./subfolder2/another/index" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +// esm format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJs1(module=node20).errors.txt new file mode 100644 index 0000000000000..ddbe7ecee4cb1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node20).errors.txt @@ -0,0 +1,585 @@ +index.cjs(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.cjs(52,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.cjs(53,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.cjs(54,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.cjs(55,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.cjs(56,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.cjs(57,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.cjs(58,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.cjs(59,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.cjs(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.cjs(61,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.cjs(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. +index.cjs(76,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +index.cjs(77,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.cjs(78,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.cjs(79,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +index.cjs(80,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.cjs(81,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.cjs(82,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +index.cjs(83,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.cjs(84,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.cjs(85,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +index.js(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. +index.js(15,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +index.js(16,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.js(17,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.js(18,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +index.js(19,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.js(20,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.js(21,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +index.js(22,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.js(23,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.js(24,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +index.js(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(52,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(53,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(54,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(55,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(56,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(57,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(58,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(59,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. +index.js(75,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +index.js(76,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.js(77,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.js(78,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +index.js(79,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.js(80,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.js(81,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +index.js(82,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.js(83,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.js(84,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +index.mjs(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. +index.mjs(15,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +index.mjs(16,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mjs(17,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mjs(18,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +index.mjs(19,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mjs(20,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mjs(21,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +index.mjs(22,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mjs(23,22): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mjs(24,22): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +index.mjs(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.mjs(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.mjs(52,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.mjs(53,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.mjs(54,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.mjs(55,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.mjs(56,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.mjs(57,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.mjs(58,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.mjs(59,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.mjs(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.mjs(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. +index.mjs(75,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +index.mjs(76,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mjs(77,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mjs(78,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +index.mjs(79,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mjs(80,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mjs(81,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +index.mjs(82,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mjs(83,21): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +index.mjs(84,21): error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + + +==== subfolder/index.js (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== subfolder/index.cjs (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== subfolder/index.mjs (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== subfolder2/index.js (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== subfolder2/index.cjs (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== subfolder2/index.mjs (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== subfolder2/another/index.js (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== subfolder2/another/index.cjs (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== subfolder2/another/index.mjs (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== index.js (33 errors) ==== + import * as m1 from "./index.js"; + import * as m2 from "./index.mjs"; + import * as m3 from "./index.cjs"; + import * as m4 from "./subfolder/index.js"; + import * as m5 from "./subfolder/index.mjs"; + import * as m6 from "./subfolder/index.cjs"; + import * as m7 from "./subfolder2/index.js"; + import * as m8 from "./subfolder2/index.mjs"; + import * as m9 from "./subfolder2/index.cjs"; + import * as m10 from "./subfolder2/another/index.js"; + import * as m11 from "./subfolder2/another/index.mjs"; + import * as m12 from "./subfolder2/another/index.cjs"; + // The next ones shouldn't all work - esm format files have no index resolution or extension resolution + import * as m13 from "./"; + ~~~~ +!!! 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + import * as m15 from "./subfolder"; + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + import * as m18 from "./subfolder2"; + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + import * as m21 from "./subfolder2/another"; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + void m1; + void m2; + void m3; + void m4; + void m5; + void m6; + void m7; + void m8; + void m9; + void m10; + void m11; + void m12; + void m13; + void m14; + void m15; + void m16; + void m17; + void m18; + void m19; + void m20; + void m21; + void m22; + void m23; + + // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) + import m24 = require("./"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m25 = require("./index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m26 = require("./subfolder"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m27 = require("./subfolder/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m28 = require("./subfolder/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m29 = require("./subfolder2"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m30 = require("./subfolder2/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m31 = require("./subfolder2/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m32 = require("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m33 = require("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m34 = require("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + void m24; + void m25; + void m26; + void m27; + void m28; + void m29; + void m30; + void m31; + void m32; + void m33; + void m34; + + // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution + const _m35 = import("./"); + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + const _m36 = import("./index"); + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + const _m37 = import("./subfolder"); + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m38 = import("./subfolder/"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + const _m40 = import("./subfolder2"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m41 = import("./subfolder2/"); + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + const _m43 = import("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + // esm format file + const x = 1; + export {x}; +==== index.cjs (22 errors) ==== + // ESM-format imports below should issue errors + import * as m1 from "./index.js"; + import * as m2 from "./index.mjs"; + import * as m3 from "./index.cjs"; + import * as m4 from "./subfolder/index.js"; + import * as m5 from "./subfolder/index.mjs"; + import * as m6 from "./subfolder/index.cjs"; + import * as m7 from "./subfolder2/index.js"; + import * as m8 from "./subfolder2/index.mjs"; + import * as m9 from "./subfolder2/index.cjs"; + import * as m10 from "./subfolder2/another/index.js"; + import * as m11 from "./subfolder2/another/index.mjs"; + import * as m12 from "./subfolder2/another/index.cjs"; + // The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) + import * as m13 from "./"; + import * as m14 from "./index"; + import * as m15 from "./subfolder"; + import * as m16 from "./subfolder/"; + import * as m17 from "./subfolder/index"; + import * as m18 from "./subfolder2"; + import * as m19 from "./subfolder2/"; + import * as m20 from "./subfolder2/index"; + import * as m21 from "./subfolder2/another"; + import * as m22 from "./subfolder2/another/"; + import * as m23 from "./subfolder2/another/index"; + void m1; + void m2; + void m3; + void m4; + void m5; + void m6; + void m7; + void m8; + void m9; + void m10; + void m11; + void m12; + void m13; + void m14; + void m15; + void m16; + void m17; + void m18; + void m19; + void m20; + void m21; + void m22; + void m23; + + // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) + import m24 = require("./"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m25 = require("./index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m26 = require("./subfolder"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m27 = require("./subfolder/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m28 = require("./subfolder/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m29 = require("./subfolder2"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m30 = require("./subfolder2/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m31 = require("./subfolder2/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m32 = require("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m33 = require("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m34 = require("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + void m24; + void m25; + void m26; + void m27; + void m28; + void m29; + void m30; + void m31; + void m32; + void m33; + void m34; + + // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution + const _m35 = import("./"); + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + const _m36 = import("./index"); + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + const _m37 = import("./subfolder"); + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m38 = import("./subfolder/"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + const _m40 = import("./subfolder2"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m41 = import("./subfolder2/"); + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + const _m43 = import("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + // cjs format file + const x = 1; + export {x}; +==== index.mjs (33 errors) ==== + import * as m1 from "./index.js"; + import * as m2 from "./index.mjs"; + import * as m3 from "./index.cjs"; + import * as m4 from "./subfolder/index.js"; + import * as m5 from "./subfolder/index.mjs"; + import * as m6 from "./subfolder/index.cjs"; + import * as m7 from "./subfolder2/index.js"; + import * as m8 from "./subfolder2/index.mjs"; + import * as m9 from "./subfolder2/index.cjs"; + import * as m10 from "./subfolder2/another/index.js"; + import * as m11 from "./subfolder2/another/index.mjs"; + import * as m12 from "./subfolder2/another/index.cjs"; + // The next ones should all fail - esm format files have no index resolution or extension resolution + import * as m13 from "./"; + ~~~~ +!!! 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + import * as m15 from "./subfolder"; + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + import * as m18 from "./subfolder2"; + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + import * as m21 from "./subfolder2/another"; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + void m1; + void m2; + void m3; + void m4; + void m5; + void m6; + void m7; + void m8; + void m9; + void m10; + void m11; + void m12; + void m13; + void m14; + void m15; + void m16; + void m17; + void m18; + void m19; + void m20; + void m21; + void m22; + void m23; + + // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) + import m24 = require("./"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m25 = require("./index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m26 = require("./subfolder"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m27 = require("./subfolder/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m28 = require("./subfolder/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m29 = require("./subfolder2"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m30 = require("./subfolder2/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m31 = require("./subfolder2/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m32 = require("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m33 = require("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m34 = require("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + void m24; + void m25; + void m26; + void m27; + void m28; + void m29; + void m30; + void m31; + void m32; + void m33; + void m34; + + // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution + const _m35 = import("./"); + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + const _m36 = import("./index"); + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + const _m37 = import("./subfolder"); + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m38 = import("./subfolder/"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + const _m40 = import("./subfolder2"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m41 = import("./subfolder2/"); + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + const _m43 = import("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' 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 ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + + // esm format file + const x = 1; + export {x}; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== subfolder2/package.json (0 errors) ==== + { + } +==== subfolder2/another/package.json (0 errors) ==== + { + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node20).js b/tests/baselines/reference/nodeModulesAllowJs1(module=node20).js new file mode 100644 index 0000000000000..4a63449d26383 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node20).js @@ -0,0 +1,698 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts] //// + +//// [index.js] +// cjs format file +const x = 1; +export {x}; +//// [index.cjs] +// cjs format file +const x = 1; +export {x}; +//// [index.mjs] +// esm format file +const x = 1; +export {x}; +//// [index.js] +// cjs format file +const x = 1; +export {x}; +//// [index.cjs] +// cjs format file +const x = 1; +export {x}; +//// [index.mjs] +// esm format file +const x = 1; +export {x}; +//// [index.js] +// esm format file +const x = 1; +export {x}; +//// [index.cjs] +// cjs format file +const x = 1; +export {x}; +//// [index.mjs] +// esm format file +const x = 1; +export {x}; +//// [index.js] +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +import m25 = require("./index"); +import m26 = require("./subfolder"); +import m27 = require("./subfolder/"); +import m28 = require("./subfolder/index"); +import m29 = require("./subfolder2"); +import m30 = require("./subfolder2/"); +import m31 = require("./subfolder2/index"); +import m32 = require("./subfolder2/another"); +import m33 = require("./subfolder2/another/"); +import m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// esm format file +const x = 1; +export {x}; +//// [index.cjs] +// ESM-format imports below should issue errors +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +import m25 = require("./index"); +import m26 = require("./subfolder"); +import m27 = require("./subfolder/"); +import m28 = require("./subfolder/index"); +import m29 = require("./subfolder2"); +import m30 = require("./subfolder2/"); +import m31 = require("./subfolder2/index"); +import m32 = require("./subfolder2/another"); +import m33 = require("./subfolder2/another/"); +import m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// cjs format file +const x = 1; +export {x}; +//// [index.mjs] +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +import m25 = require("./index"); +import m26 = require("./subfolder"); +import m27 = require("./subfolder/"); +import m28 = require("./subfolder/index"); +import m29 = require("./subfolder2"); +import m30 = require("./subfolder2/"); +import m31 = require("./subfolder2/index"); +import m32 = require("./subfolder2/another"); +import m33 = require("./subfolder2/another/"); +import m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); + +// esm format file +const x = 1; +export {x}; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [package.json] +{ +} +//// [package.json] +{ + "type": "module" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.mjs] +// esm format file +const x = 1; +export { x }; +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.mjs] +// esm format file +const x = 1; +export { x }; +//// [index.js] +// esm format file +const x = 1; +export { x }; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.mjs] +// esm format file +const x = 1; +export { x }; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// ESM-format imports below should issue errors +const m1 = __importStar(require("./index.js")); +const m2 = __importStar(require("./index.mjs")); +const m3 = __importStar(require("./index.cjs")); +const m4 = __importStar(require("./subfolder/index.js")); +const m5 = __importStar(require("./subfolder/index.mjs")); +const m6 = __importStar(require("./subfolder/index.cjs")); +const m7 = __importStar(require("./subfolder2/index.js")); +const m8 = __importStar(require("./subfolder2/index.mjs")); +const m9 = __importStar(require("./subfolder2/index.cjs")); +const m10 = __importStar(require("./subfolder2/another/index.js")); +const m11 = __importStar(require("./subfolder2/another/index.mjs")); +const m12 = __importStar(require("./subfolder2/another/index.cjs")); +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +const m13 = __importStar(require("./")); +const m14 = __importStar(require("./index")); +const m15 = __importStar(require("./subfolder")); +const m16 = __importStar(require("./subfolder/")); +const m17 = __importStar(require("./subfolder/index")); +const m18 = __importStar(require("./subfolder2")); +const m19 = __importStar(require("./subfolder2/")); +const m20 = __importStar(require("./subfolder2/index")); +const m21 = __importStar(require("./subfolder2/another")); +const m22 = __importStar(require("./subfolder2/another/")); +const m23 = __importStar(require("./subfolder2/another/index")); +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +const m24 = require("./"); +const m25 = require("./index"); +const m26 = require("./subfolder"); +const m27 = require("./subfolder/"); +const m28 = require("./subfolder/index"); +const m29 = require("./subfolder2"); +const m30 = require("./subfolder2/"); +const m31 = require("./subfolder2/index"); +const m32 = require("./subfolder2/another"); +const m33 = require("./subfolder2/another/"); +const m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// cjs format file +const x = 1; +exports.x = x; +//// [index.mjs] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +const m24 = __require("./"); +const m25 = __require("./index"); +const m26 = __require("./subfolder"); +const m27 = __require("./subfolder/"); +const m28 = __require("./subfolder/index"); +const m29 = __require("./subfolder2"); +const m30 = __require("./subfolder2/"); +const m31 = __require("./subfolder2/index"); +const m32 = __require("./subfolder2/another"); +const m33 = __require("./subfolder2/another/"); +const m34 = __require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// esm format file +const x = 1; +export { x }; +//// [index.js] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +const m24 = __require("./"); +const m25 = __require("./index"); +const m26 = __require("./subfolder"); +const m27 = __require("./subfolder/"); +const m28 = __require("./subfolder/index"); +const m29 = __require("./subfolder2"); +const m30 = __require("./subfolder2/"); +const m31 = __require("./subfolder2/index"); +const m32 = __require("./subfolder2/another"); +const m33 = __require("./subfolder2/another/"); +const m34 = __require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// esm format file +const x = 1; +export { x }; + + +//// [index.d.ts] +export const x: 1; +//// [index.d.cts] +export const x: 1; +//// [index.d.mts] +export const x: 1; +//// [index.d.ts] +export const x: 1; +//// [index.d.cts] +export const x: 1; +//// [index.d.mts] +export const x: 1; +//// [index.d.ts] +export const x: 1; +//// [index.d.cts] +export const x: 1; +//// [index.d.mts] +export const x: 1; +//// [index.d.cts] +export const x: 1; +//// [index.d.mts] +export const x: 1; +//// [index.d.ts] +export const x: 1; diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJs1(module=node20).symbols new file mode 100644 index 0000000000000..1d24c14a43ea7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node20).symbols @@ -0,0 +1,819 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts] //// + +=== subfolder/index.js === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.js, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.js, 2, 8)) + +=== subfolder/index.cjs === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cjs, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.cjs, 2, 8)) + +=== subfolder/index.mjs === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mjs, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.mjs, 2, 8)) + +=== subfolder2/index.js === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.js, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.js, 2, 8)) + +=== subfolder2/index.cjs === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cjs, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.cjs, 2, 8)) + +=== subfolder2/index.mjs === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mjs, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.mjs, 2, 8)) + +=== subfolder2/another/index.js === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.js, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.js, 2, 8)) + +=== subfolder2/another/index.cjs === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cjs, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.cjs, 2, 8)) + +=== subfolder2/another/index.mjs === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mjs, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.mjs, 2, 8)) + +=== index.js === +import * as m1 from "./index.js"; +>m1 : Symbol(m1, Decl(index.js, 0, 6)) + +import * as m2 from "./index.mjs"; +>m2 : Symbol(m2, Decl(index.js, 1, 6)) + +import * as m3 from "./index.cjs"; +>m3 : Symbol(m3, Decl(index.js, 2, 6)) + +import * as m4 from "./subfolder/index.js"; +>m4 : Symbol(m4, Decl(index.js, 3, 6)) + +import * as m5 from "./subfolder/index.mjs"; +>m5 : Symbol(m5, Decl(index.js, 4, 6)) + +import * as m6 from "./subfolder/index.cjs"; +>m6 : Symbol(m6, Decl(index.js, 5, 6)) + +import * as m7 from "./subfolder2/index.js"; +>m7 : Symbol(m7, Decl(index.js, 6, 6)) + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : Symbol(m8, Decl(index.js, 7, 6)) + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : Symbol(m9, Decl(index.js, 8, 6)) + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : Symbol(m10, Decl(index.js, 9, 6)) + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : Symbol(m11, Decl(index.js, 10, 6)) + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : Symbol(m12, Decl(index.js, 11, 6)) + +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : Symbol(m13, Decl(index.js, 13, 6)) + +import * as m14 from "./index"; +>m14 : Symbol(m14, Decl(index.js, 14, 6)) + +import * as m15 from "./subfolder"; +>m15 : Symbol(m15, Decl(index.js, 15, 6)) + +import * as m16 from "./subfolder/"; +>m16 : Symbol(m16, Decl(index.js, 16, 6)) + +import * as m17 from "./subfolder/index"; +>m17 : Symbol(m17, Decl(index.js, 17, 6)) + +import * as m18 from "./subfolder2"; +>m18 : Symbol(m18, Decl(index.js, 18, 6)) + +import * as m19 from "./subfolder2/"; +>m19 : Symbol(m19, Decl(index.js, 19, 6)) + +import * as m20 from "./subfolder2/index"; +>m20 : Symbol(m20, Decl(index.js, 20, 6)) + +import * as m21 from "./subfolder2/another"; +>m21 : Symbol(m21, Decl(index.js, 21, 6)) + +import * as m22 from "./subfolder2/another/"; +>m22 : Symbol(m22, Decl(index.js, 22, 6)) + +import * as m23 from "./subfolder2/another/index"; +>m23 : Symbol(m23, Decl(index.js, 23, 6)) + +void m1; +>m1 : Symbol(m1, Decl(index.js, 0, 6)) + +void m2; +>m2 : Symbol(m2, Decl(index.js, 1, 6)) + +void m3; +>m3 : Symbol(m3, Decl(index.js, 2, 6)) + +void m4; +>m4 : Symbol(m4, Decl(index.js, 3, 6)) + +void m5; +>m5 : Symbol(m5, Decl(index.js, 4, 6)) + +void m6; +>m6 : Symbol(m6, Decl(index.js, 5, 6)) + +void m7; +>m7 : Symbol(m7, Decl(index.js, 6, 6)) + +void m8; +>m8 : Symbol(m8, Decl(index.js, 7, 6)) + +void m9; +>m9 : Symbol(m9, Decl(index.js, 8, 6)) + +void m10; +>m10 : Symbol(m10, Decl(index.js, 9, 6)) + +void m11; +>m11 : Symbol(m11, Decl(index.js, 10, 6)) + +void m12; +>m12 : Symbol(m12, Decl(index.js, 11, 6)) + +void m13; +>m13 : Symbol(m13, Decl(index.js, 13, 6)) + +void m14; +>m14 : Symbol(m14, Decl(index.js, 14, 6)) + +void m15; +>m15 : Symbol(m15, Decl(index.js, 15, 6)) + +void m16; +>m16 : Symbol(m16, Decl(index.js, 16, 6)) + +void m17; +>m17 : Symbol(m17, Decl(index.js, 17, 6)) + +void m18; +>m18 : Symbol(m18, Decl(index.js, 18, 6)) + +void m19; +>m19 : Symbol(m19, Decl(index.js, 19, 6)) + +void m20; +>m20 : Symbol(m20, Decl(index.js, 20, 6)) + +void m21; +>m21 : Symbol(m21, Decl(index.js, 21, 6)) + +void m22; +>m22 : Symbol(m22, Decl(index.js, 22, 6)) + +void m23; +>m23 : Symbol(m23, Decl(index.js, 23, 6)) + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : Symbol(m24, Decl(index.js, 46, 9)) + +import m25 = require("./index"); +>m25 : Symbol(m25, Decl(index.js, 49, 27)) + +import m26 = require("./subfolder"); +>m26 : Symbol(m26, Decl(index.js, 50, 32)) + +import m27 = require("./subfolder/"); +>m27 : Symbol(m27, Decl(index.js, 51, 36)) + +import m28 = require("./subfolder/index"); +>m28 : Symbol(m28, Decl(index.js, 52, 37)) + +import m29 = require("./subfolder2"); +>m29 : Symbol(m29, Decl(index.js, 53, 42)) + +import m30 = require("./subfolder2/"); +>m30 : Symbol(m30, Decl(index.js, 54, 37)) + +import m31 = require("./subfolder2/index"); +>m31 : Symbol(m31, Decl(index.js, 55, 38)) + +import m32 = require("./subfolder2/another"); +>m32 : Symbol(m32, Decl(index.js, 56, 43)) + +import m33 = require("./subfolder2/another/"); +>m33 : Symbol(m33, Decl(index.js, 57, 45)) + +import m34 = require("./subfolder2/another/index"); +>m34 : Symbol(m34, Decl(index.js, 58, 46)) + +void m24; +>m24 : Symbol(m24, Decl(index.js, 46, 9)) + +void m25; +>m25 : Symbol(m25, Decl(index.js, 49, 27)) + +void m26; +>m26 : Symbol(m26, Decl(index.js, 50, 32)) + +void m27; +>m27 : Symbol(m27, Decl(index.js, 51, 36)) + +void m28; +>m28 : Symbol(m28, Decl(index.js, 52, 37)) + +void m29; +>m29 : Symbol(m29, Decl(index.js, 53, 42)) + +void m30; +>m30 : Symbol(m30, Decl(index.js, 54, 37)) + +void m31; +>m31 : Symbol(m31, Decl(index.js, 55, 38)) + +void m32; +>m32 : Symbol(m32, Decl(index.js, 56, 43)) + +void m33; +>m33 : Symbol(m33, Decl(index.js, 57, 45)) + +void m34; +>m34 : Symbol(m34, Decl(index.js, 58, 46)) + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Symbol(_m35, Decl(index.js, 73, 5)) + +const _m36 = import("./index"); +>_m36 : Symbol(_m36, Decl(index.js, 74, 5)) + +const _m37 = import("./subfolder"); +>_m37 : Symbol(_m37, Decl(index.js, 75, 5)) + +const _m38 = import("./subfolder/"); +>_m38 : Symbol(_m38, Decl(index.js, 76, 5)) + +const _m39 = import("./subfolder/index"); +>_m39 : Symbol(_m39, Decl(index.js, 77, 5)) + +const _m40 = import("./subfolder2"); +>_m40 : Symbol(_m40, Decl(index.js, 78, 5)) + +const _m41 = import("./subfolder2/"); +>_m41 : Symbol(_m41, Decl(index.js, 79, 5)) + +const _m42 = import("./subfolder2/index"); +>_m42 : Symbol(_m42, Decl(index.js, 80, 5)) + +const _m43 = import("./subfolder2/another"); +>_m43 : Symbol(_m43, Decl(index.js, 81, 5)) + +const _m44 = import("./subfolder2/another/"); +>_m44 : Symbol(_m44, Decl(index.js, 82, 5)) + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Symbol(_m45, Decl(index.js, 83, 5)) + +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.js, 85, 5)) + +export {x}; +>x : Symbol(m1.x, Decl(index.js, 86, 8)) + +=== index.cjs === +// ESM-format imports below should issue errors +import * as m1 from "./index.js"; +>m1 : Symbol(m1, Decl(index.cjs, 1, 6)) + +import * as m2 from "./index.mjs"; +>m2 : Symbol(m2, Decl(index.cjs, 2, 6)) + +import * as m3 from "./index.cjs"; +>m3 : Symbol(m3, Decl(index.cjs, 3, 6)) + +import * as m4 from "./subfolder/index.js"; +>m4 : Symbol(m4, Decl(index.cjs, 4, 6)) + +import * as m5 from "./subfolder/index.mjs"; +>m5 : Symbol(m5, Decl(index.cjs, 5, 6)) + +import * as m6 from "./subfolder/index.cjs"; +>m6 : Symbol(m6, Decl(index.cjs, 6, 6)) + +import * as m7 from "./subfolder2/index.js"; +>m7 : Symbol(m7, Decl(index.cjs, 7, 6)) + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : Symbol(m8, Decl(index.cjs, 8, 6)) + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : Symbol(m9, Decl(index.cjs, 9, 6)) + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : Symbol(m10, Decl(index.cjs, 10, 6)) + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : Symbol(m11, Decl(index.cjs, 11, 6)) + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : Symbol(m12, Decl(index.cjs, 12, 6)) + +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +import * as m13 from "./"; +>m13 : Symbol(m13, Decl(index.cjs, 14, 6)) + +import * as m14 from "./index"; +>m14 : Symbol(m14, Decl(index.cjs, 15, 6)) + +import * as m15 from "./subfolder"; +>m15 : Symbol(m15, Decl(index.cjs, 16, 6)) + +import * as m16 from "./subfolder/"; +>m16 : Symbol(m16, Decl(index.cjs, 17, 6)) + +import * as m17 from "./subfolder/index"; +>m17 : Symbol(m17, Decl(index.cjs, 18, 6)) + +import * as m18 from "./subfolder2"; +>m18 : Symbol(m18, Decl(index.cjs, 19, 6)) + +import * as m19 from "./subfolder2/"; +>m19 : Symbol(m19, Decl(index.cjs, 20, 6)) + +import * as m20 from "./subfolder2/index"; +>m20 : Symbol(m20, Decl(index.cjs, 21, 6)) + +import * as m21 from "./subfolder2/another"; +>m21 : Symbol(m21, Decl(index.cjs, 22, 6)) + +import * as m22 from "./subfolder2/another/"; +>m22 : Symbol(m22, Decl(index.cjs, 23, 6)) + +import * as m23 from "./subfolder2/another/index"; +>m23 : Symbol(m23, Decl(index.cjs, 24, 6)) + +void m1; +>m1 : Symbol(m1, Decl(index.cjs, 1, 6)) + +void m2; +>m2 : Symbol(m2, Decl(index.cjs, 2, 6)) + +void m3; +>m3 : Symbol(m3, Decl(index.cjs, 3, 6)) + +void m4; +>m4 : Symbol(m4, Decl(index.cjs, 4, 6)) + +void m5; +>m5 : Symbol(m5, Decl(index.cjs, 5, 6)) + +void m6; +>m6 : Symbol(m6, Decl(index.cjs, 6, 6)) + +void m7; +>m7 : Symbol(m7, Decl(index.cjs, 7, 6)) + +void m8; +>m8 : Symbol(m8, Decl(index.cjs, 8, 6)) + +void m9; +>m9 : Symbol(m9, Decl(index.cjs, 9, 6)) + +void m10; +>m10 : Symbol(m10, Decl(index.cjs, 10, 6)) + +void m11; +>m11 : Symbol(m11, Decl(index.cjs, 11, 6)) + +void m12; +>m12 : Symbol(m12, Decl(index.cjs, 12, 6)) + +void m13; +>m13 : Symbol(m13, Decl(index.cjs, 14, 6)) + +void m14; +>m14 : Symbol(m14, Decl(index.cjs, 15, 6)) + +void m15; +>m15 : Symbol(m15, Decl(index.cjs, 16, 6)) + +void m16; +>m16 : Symbol(m16, Decl(index.cjs, 17, 6)) + +void m17; +>m17 : Symbol(m17, Decl(index.cjs, 18, 6)) + +void m18; +>m18 : Symbol(m18, Decl(index.cjs, 19, 6)) + +void m19; +>m19 : Symbol(m19, Decl(index.cjs, 20, 6)) + +void m20; +>m20 : Symbol(m20, Decl(index.cjs, 21, 6)) + +void m21; +>m21 : Symbol(m21, Decl(index.cjs, 22, 6)) + +void m22; +>m22 : Symbol(m22, Decl(index.cjs, 23, 6)) + +void m23; +>m23 : Symbol(m23, Decl(index.cjs, 24, 6)) + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : Symbol(m24, Decl(index.cjs, 47, 9)) + +import m25 = require("./index"); +>m25 : Symbol(m25, Decl(index.cjs, 50, 27)) + +import m26 = require("./subfolder"); +>m26 : Symbol(m26, Decl(index.cjs, 51, 32)) + +import m27 = require("./subfolder/"); +>m27 : Symbol(m27, Decl(index.cjs, 52, 36)) + +import m28 = require("./subfolder/index"); +>m28 : Symbol(m28, Decl(index.cjs, 53, 37)) + +import m29 = require("./subfolder2"); +>m29 : Symbol(m29, Decl(index.cjs, 54, 42)) + +import m30 = require("./subfolder2/"); +>m30 : Symbol(m30, Decl(index.cjs, 55, 37)) + +import m31 = require("./subfolder2/index"); +>m31 : Symbol(m31, Decl(index.cjs, 56, 38)) + +import m32 = require("./subfolder2/another"); +>m32 : Symbol(m32, Decl(index.cjs, 57, 43)) + +import m33 = require("./subfolder2/another/"); +>m33 : Symbol(m33, Decl(index.cjs, 58, 45)) + +import m34 = require("./subfolder2/another/index"); +>m34 : Symbol(m34, Decl(index.cjs, 59, 46)) + +void m24; +>m24 : Symbol(m24, Decl(index.cjs, 47, 9)) + +void m25; +>m25 : Symbol(m25, Decl(index.cjs, 50, 27)) + +void m26; +>m26 : Symbol(m26, Decl(index.cjs, 51, 32)) + +void m27; +>m27 : Symbol(m27, Decl(index.cjs, 52, 36)) + +void m28; +>m28 : Symbol(m28, Decl(index.cjs, 53, 37)) + +void m29; +>m29 : Symbol(m29, Decl(index.cjs, 54, 42)) + +void m30; +>m30 : Symbol(m30, Decl(index.cjs, 55, 37)) + +void m31; +>m31 : Symbol(m31, Decl(index.cjs, 56, 38)) + +void m32; +>m32 : Symbol(m32, Decl(index.cjs, 57, 43)) + +void m33; +>m33 : Symbol(m33, Decl(index.cjs, 58, 45)) + +void m34; +>m34 : Symbol(m34, Decl(index.cjs, 59, 46)) + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Symbol(_m35, Decl(index.cjs, 74, 5)) + +const _m36 = import("./index"); +>_m36 : Symbol(_m36, Decl(index.cjs, 75, 5)) + +const _m37 = import("./subfolder"); +>_m37 : Symbol(_m37, Decl(index.cjs, 76, 5)) + +const _m38 = import("./subfolder/"); +>_m38 : Symbol(_m38, Decl(index.cjs, 77, 5)) + +const _m39 = import("./subfolder/index"); +>_m39 : Symbol(_m39, Decl(index.cjs, 78, 5)) + +const _m40 = import("./subfolder2"); +>_m40 : Symbol(_m40, Decl(index.cjs, 79, 5)) + +const _m41 = import("./subfolder2/"); +>_m41 : Symbol(_m41, Decl(index.cjs, 80, 5)) + +const _m42 = import("./subfolder2/index"); +>_m42 : Symbol(_m42, Decl(index.cjs, 81, 5)) + +const _m43 = import("./subfolder2/another"); +>_m43 : Symbol(_m43, Decl(index.cjs, 82, 5)) + +const _m44 = import("./subfolder2/another/"); +>_m44 : Symbol(_m44, Decl(index.cjs, 83, 5)) + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Symbol(_m45, Decl(index.cjs, 84, 5)) + +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cjs, 86, 5)) + +export {x}; +>x : Symbol(m3.x, Decl(index.cjs, 87, 8)) + +=== index.mjs === +import * as m1 from "./index.js"; +>m1 : Symbol(m1, Decl(index.mjs, 0, 6)) + +import * as m2 from "./index.mjs"; +>m2 : Symbol(m2, Decl(index.mjs, 1, 6)) + +import * as m3 from "./index.cjs"; +>m3 : Symbol(m3, Decl(index.mjs, 2, 6)) + +import * as m4 from "./subfolder/index.js"; +>m4 : Symbol(m4, Decl(index.mjs, 3, 6)) + +import * as m5 from "./subfolder/index.mjs"; +>m5 : Symbol(m5, Decl(index.mjs, 4, 6)) + +import * as m6 from "./subfolder/index.cjs"; +>m6 : Symbol(m6, Decl(index.mjs, 5, 6)) + +import * as m7 from "./subfolder2/index.js"; +>m7 : Symbol(m7, Decl(index.mjs, 6, 6)) + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : Symbol(m8, Decl(index.mjs, 7, 6)) + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : Symbol(m9, Decl(index.mjs, 8, 6)) + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : Symbol(m10, Decl(index.mjs, 9, 6)) + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : Symbol(m11, Decl(index.mjs, 10, 6)) + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : Symbol(m12, Decl(index.mjs, 11, 6)) + +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : Symbol(m13, Decl(index.mjs, 13, 6)) + +import * as m14 from "./index"; +>m14 : Symbol(m14, Decl(index.mjs, 14, 6)) + +import * as m15 from "./subfolder"; +>m15 : Symbol(m15, Decl(index.mjs, 15, 6)) + +import * as m16 from "./subfolder/"; +>m16 : Symbol(m16, Decl(index.mjs, 16, 6)) + +import * as m17 from "./subfolder/index"; +>m17 : Symbol(m17, Decl(index.mjs, 17, 6)) + +import * as m18 from "./subfolder2"; +>m18 : Symbol(m18, Decl(index.mjs, 18, 6)) + +import * as m19 from "./subfolder2/"; +>m19 : Symbol(m19, Decl(index.mjs, 19, 6)) + +import * as m20 from "./subfolder2/index"; +>m20 : Symbol(m20, Decl(index.mjs, 20, 6)) + +import * as m21 from "./subfolder2/another"; +>m21 : Symbol(m21, Decl(index.mjs, 21, 6)) + +import * as m22 from "./subfolder2/another/"; +>m22 : Symbol(m22, Decl(index.mjs, 22, 6)) + +import * as m23 from "./subfolder2/another/index"; +>m23 : Symbol(m23, Decl(index.mjs, 23, 6)) + +void m1; +>m1 : Symbol(m1, Decl(index.mjs, 0, 6)) + +void m2; +>m2 : Symbol(m2, Decl(index.mjs, 1, 6)) + +void m3; +>m3 : Symbol(m3, Decl(index.mjs, 2, 6)) + +void m4; +>m4 : Symbol(m4, Decl(index.mjs, 3, 6)) + +void m5; +>m5 : Symbol(m5, Decl(index.mjs, 4, 6)) + +void m6; +>m6 : Symbol(m6, Decl(index.mjs, 5, 6)) + +void m7; +>m7 : Symbol(m7, Decl(index.mjs, 6, 6)) + +void m8; +>m8 : Symbol(m8, Decl(index.mjs, 7, 6)) + +void m9; +>m9 : Symbol(m9, Decl(index.mjs, 8, 6)) + +void m10; +>m10 : Symbol(m10, Decl(index.mjs, 9, 6)) + +void m11; +>m11 : Symbol(m11, Decl(index.mjs, 10, 6)) + +void m12; +>m12 : Symbol(m12, Decl(index.mjs, 11, 6)) + +void m13; +>m13 : Symbol(m13, Decl(index.mjs, 13, 6)) + +void m14; +>m14 : Symbol(m14, Decl(index.mjs, 14, 6)) + +void m15; +>m15 : Symbol(m15, Decl(index.mjs, 15, 6)) + +void m16; +>m16 : Symbol(m16, Decl(index.mjs, 16, 6)) + +void m17; +>m17 : Symbol(m17, Decl(index.mjs, 17, 6)) + +void m18; +>m18 : Symbol(m18, Decl(index.mjs, 18, 6)) + +void m19; +>m19 : Symbol(m19, Decl(index.mjs, 19, 6)) + +void m20; +>m20 : Symbol(m20, Decl(index.mjs, 20, 6)) + +void m21; +>m21 : Symbol(m21, Decl(index.mjs, 21, 6)) + +void m22; +>m22 : Symbol(m22, Decl(index.mjs, 22, 6)) + +void m23; +>m23 : Symbol(m23, Decl(index.mjs, 23, 6)) + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : Symbol(m24, Decl(index.mjs, 46, 9)) + +import m25 = require("./index"); +>m25 : Symbol(m25, Decl(index.mjs, 49, 27)) + +import m26 = require("./subfolder"); +>m26 : Symbol(m26, Decl(index.mjs, 50, 32)) + +import m27 = require("./subfolder/"); +>m27 : Symbol(m27, Decl(index.mjs, 51, 36)) + +import m28 = require("./subfolder/index"); +>m28 : Symbol(m28, Decl(index.mjs, 52, 37)) + +import m29 = require("./subfolder2"); +>m29 : Symbol(m29, Decl(index.mjs, 53, 42)) + +import m30 = require("./subfolder2/"); +>m30 : Symbol(m30, Decl(index.mjs, 54, 37)) + +import m31 = require("./subfolder2/index"); +>m31 : Symbol(m31, Decl(index.mjs, 55, 38)) + +import m32 = require("./subfolder2/another"); +>m32 : Symbol(m32, Decl(index.mjs, 56, 43)) + +import m33 = require("./subfolder2/another/"); +>m33 : Symbol(m33, Decl(index.mjs, 57, 45)) + +import m34 = require("./subfolder2/another/index"); +>m34 : Symbol(m34, Decl(index.mjs, 58, 46)) + +void m24; +>m24 : Symbol(m24, Decl(index.mjs, 46, 9)) + +void m25; +>m25 : Symbol(m25, Decl(index.mjs, 49, 27)) + +void m26; +>m26 : Symbol(m26, Decl(index.mjs, 50, 32)) + +void m27; +>m27 : Symbol(m27, Decl(index.mjs, 51, 36)) + +void m28; +>m28 : Symbol(m28, Decl(index.mjs, 52, 37)) + +void m29; +>m29 : Symbol(m29, Decl(index.mjs, 53, 42)) + +void m30; +>m30 : Symbol(m30, Decl(index.mjs, 54, 37)) + +void m31; +>m31 : Symbol(m31, Decl(index.mjs, 55, 38)) + +void m32; +>m32 : Symbol(m32, Decl(index.mjs, 56, 43)) + +void m33; +>m33 : Symbol(m33, Decl(index.mjs, 57, 45)) + +void m34; +>m34 : Symbol(m34, Decl(index.mjs, 58, 46)) + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Symbol(_m35, Decl(index.mjs, 73, 5)) + +const _m36 = import("./index"); +>_m36 : Symbol(_m36, Decl(index.mjs, 74, 5)) + +const _m37 = import("./subfolder"); +>_m37 : Symbol(_m37, Decl(index.mjs, 75, 5)) + +const _m38 = import("./subfolder/"); +>_m38 : Symbol(_m38, Decl(index.mjs, 76, 5)) + +const _m39 = import("./subfolder/index"); +>_m39 : Symbol(_m39, Decl(index.mjs, 77, 5)) + +const _m40 = import("./subfolder2"); +>_m40 : Symbol(_m40, Decl(index.mjs, 78, 5)) + +const _m41 = import("./subfolder2/"); +>_m41 : Symbol(_m41, Decl(index.mjs, 79, 5)) + +const _m42 = import("./subfolder2/index"); +>_m42 : Symbol(_m42, Decl(index.mjs, 80, 5)) + +const _m43 = import("./subfolder2/another"); +>_m43 : Symbol(_m43, Decl(index.mjs, 81, 5)) + +const _m44 = import("./subfolder2/another/"); +>_m44 : Symbol(_m44, Decl(index.mjs, 82, 5)) + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Symbol(_m45, Decl(index.mjs, 83, 5)) + +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mjs, 86, 5)) + +export {x}; +>x : Symbol(m2.x, Decl(index.mjs, 87, 8)) + diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node20).types b/tests/baselines/reference/nodeModulesAllowJs1(module=node20).types new file mode 100644 index 0000000000000..672e1a9c81b16 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node20).types @@ -0,0 +1,1440 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts] //// + +=== subfolder/index.js === +// cjs format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder/index.cjs === +// cjs format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder/index.mjs === +// esm format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder2/index.js === +// cjs format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder2/index.cjs === +// cjs format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder2/index.mjs === +// esm format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder2/another/index.js === +// esm format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder2/another/index.cjs === +// cjs format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== subfolder2/another/index.mjs === +// esm format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== index.js === +import * as m1 from "./index.js"; +>m1 : typeof m1 +> : ^^^^^^^^^ + +import * as m2 from "./index.mjs"; +>m2 : typeof m2 +> : ^^^^^^^^^ + +import * as m3 from "./index.cjs"; +>m3 : typeof m3 +> : ^^^^^^^^^ + +import * as m4 from "./subfolder/index.js"; +>m4 : typeof m4 +> : ^^^^^^^^^ + +import * as m5 from "./subfolder/index.mjs"; +>m5 : typeof m5 +> : ^^^^^^^^^ + +import * as m6 from "./subfolder/index.cjs"; +>m6 : typeof m6 +> : ^^^^^^^^^ + +import * as m7 from "./subfolder2/index.js"; +>m7 : typeof m7 +> : ^^^^^^^^^ + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : typeof m8 +> : ^^^^^^^^^ + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : typeof m9 +> : ^^^^^^^^^ + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : typeof m10 +> : ^^^^^^^^^^ + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : typeof m11 +> : ^^^^^^^^^^ + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : typeof m12 +> : ^^^^^^^^^^ + +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : any +> : ^^^ + +import * as m14 from "./index"; +>m14 : any +> : ^^^ + +import * as m15 from "./subfolder"; +>m15 : any +> : ^^^ + +import * as m16 from "./subfolder/"; +>m16 : any +> : ^^^ + +import * as m17 from "./subfolder/index"; +>m17 : any +> : ^^^ + +import * as m18 from "./subfolder2"; +>m18 : any +> : ^^^ + +import * as m19 from "./subfolder2/"; +>m19 : any +> : ^^^ + +import * as m20 from "./subfolder2/index"; +>m20 : any +> : ^^^ + +import * as m21 from "./subfolder2/another"; +>m21 : any +> : ^^^ + +import * as m22 from "./subfolder2/another/"; +>m22 : any +> : ^^^ + +import * as m23 from "./subfolder2/another/index"; +>m23 : any +> : ^^^ + +void m1; +>void m1 : undefined +> : ^^^^^^^^^ +>m1 : typeof m1 +> : ^^^^^^^^^ + +void m2; +>void m2 : undefined +> : ^^^^^^^^^ +>m2 : typeof m2 +> : ^^^^^^^^^ + +void m3; +>void m3 : undefined +> : ^^^^^^^^^ +>m3 : typeof m3 +> : ^^^^^^^^^ + +void m4; +>void m4 : undefined +> : ^^^^^^^^^ +>m4 : typeof m4 +> : ^^^^^^^^^ + +void m5; +>void m5 : undefined +> : ^^^^^^^^^ +>m5 : typeof m5 +> : ^^^^^^^^^ + +void m6; +>void m6 : undefined +> : ^^^^^^^^^ +>m6 : typeof m6 +> : ^^^^^^^^^ + +void m7; +>void m7 : undefined +> : ^^^^^^^^^ +>m7 : typeof m7 +> : ^^^^^^^^^ + +void m8; +>void m8 : undefined +> : ^^^^^^^^^ +>m8 : typeof m8 +> : ^^^^^^^^^ + +void m9; +>void m9 : undefined +> : ^^^^^^^^^ +>m9 : typeof m9 +> : ^^^^^^^^^ + +void m10; +>void m10 : undefined +> : ^^^^^^^^^ +>m10 : typeof m10 +> : ^^^^^^^^^^ + +void m11; +>void m11 : undefined +> : ^^^^^^^^^ +>m11 : typeof m11 +> : ^^^^^^^^^^ + +void m12; +>void m12 : undefined +> : ^^^^^^^^^ +>m12 : typeof m12 +> : ^^^^^^^^^^ + +void m13; +>void m13 : undefined +> : ^^^^^^^^^ +>m13 : any +> : ^^^ + +void m14; +>void m14 : undefined +> : ^^^^^^^^^ +>m14 : any +> : ^^^ + +void m15; +>void m15 : undefined +> : ^^^^^^^^^ +>m15 : any +> : ^^^ + +void m16; +>void m16 : undefined +> : ^^^^^^^^^ +>m16 : any +> : ^^^ + +void m17; +>void m17 : undefined +> : ^^^^^^^^^ +>m17 : any +> : ^^^ + +void m18; +>void m18 : undefined +> : ^^^^^^^^^ +>m18 : any +> : ^^^ + +void m19; +>void m19 : undefined +> : ^^^^^^^^^ +>m19 : any +> : ^^^ + +void m20; +>void m20 : undefined +> : ^^^^^^^^^ +>m20 : any +> : ^^^ + +void m21; +>void m21 : undefined +> : ^^^^^^^^^ +>m21 : any +> : ^^^ + +void m22; +>void m22 : undefined +> : ^^^^^^^^^ +>m22 : any +> : ^^^ + +void m23; +>void m23 : undefined +> : ^^^^^^^^^ +>m23 : any +> : ^^^ + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : typeof m1 +> : ^^^^^^^^^ + +import m25 = require("./index"); +>m25 : typeof m1 +> : ^^^^^^^^^ + +import m26 = require("./subfolder"); +>m26 : typeof m26 +> : ^^^^^^^^^^ + +import m27 = require("./subfolder/"); +>m27 : typeof m26 +> : ^^^^^^^^^^ + +import m28 = require("./subfolder/index"); +>m28 : typeof m26 +> : ^^^^^^^^^^ + +import m29 = require("./subfolder2"); +>m29 : typeof m29 +> : ^^^^^^^^^^ + +import m30 = require("./subfolder2/"); +>m30 : typeof m29 +> : ^^^^^^^^^^ + +import m31 = require("./subfolder2/index"); +>m31 : typeof m29 +> : ^^^^^^^^^^ + +import m32 = require("./subfolder2/another"); +>m32 : typeof m10 +> : ^^^^^^^^^^ + +import m33 = require("./subfolder2/another/"); +>m33 : typeof m10 +> : ^^^^^^^^^^ + +import m34 = require("./subfolder2/another/index"); +>m34 : typeof m10 +> : ^^^^^^^^^^ + +void m24; +>void m24 : undefined +> : ^^^^^^^^^ +>m24 : typeof m1 +> : ^^^^^^^^^ + +void m25; +>void m25 : undefined +> : ^^^^^^^^^ +>m25 : typeof m1 +> : ^^^^^^^^^ + +void m26; +>void m26 : undefined +> : ^^^^^^^^^ +>m26 : typeof m26 +> : ^^^^^^^^^^ + +void m27; +>void m27 : undefined +> : ^^^^^^^^^ +>m27 : typeof m26 +> : ^^^^^^^^^^ + +void m28; +>void m28 : undefined +> : ^^^^^^^^^ +>m28 : typeof m26 +> : ^^^^^^^^^^ + +void m29; +>void m29 : undefined +> : ^^^^^^^^^ +>m29 : typeof m29 +> : ^^^^^^^^^^ + +void m30; +>void m30 : undefined +> : ^^^^^^^^^ +>m30 : typeof m29 +> : ^^^^^^^^^^ + +void m31; +>void m31 : undefined +> : ^^^^^^^^^ +>m31 : typeof m29 +> : ^^^^^^^^^^ + +void m32; +>void m32 : undefined +> : ^^^^^^^^^ +>m32 : typeof m10 +> : ^^^^^^^^^^ + +void m33; +>void m33 : undefined +> : ^^^^^^^^^ +>m33 : typeof m10 +> : ^^^^^^^^^^ + +void m34; +>void m34 : undefined +> : ^^^^^^^^^ +>m34 : typeof m10 +> : ^^^^^^^^^^ + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Promise +> : ^^^^^^^^^^^^ +>import("./") : Promise +> : ^^^^^^^^^^^^ +>"./" : "./" +> : ^^^^ + +const _m36 = import("./index"); +>_m36 : Promise +> : ^^^^^^^^^^^^ +>import("./index") : Promise +> : ^^^^^^^^^^^^ +>"./index" : "./index" +> : ^^^^^^^^^ + +const _m37 = import("./subfolder"); +>_m37 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder" : "./subfolder" +> : ^^^^^^^^^^^^^ + +const _m38 = import("./subfolder/"); +>_m38 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder/" : "./subfolder/" +> : ^^^^^^^^^^^^^^ + +const _m39 = import("./subfolder/index"); +>_m39 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder/index" : "./subfolder/index" +> : ^^^^^^^^^^^^^^^^^^^ + +const _m40 = import("./subfolder2"); +>_m40 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2" : "./subfolder2" +> : ^^^^^^^^^^^^^^ + +const _m41 = import("./subfolder2/"); +>_m41 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/" : "./subfolder2/" +> : ^^^^^^^^^^^^^^^ + +const _m42 = import("./subfolder2/index"); +>_m42 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/index" : "./subfolder2/index" +> : ^^^^^^^^^^^^^^^^^^^^ + +const _m43 = import("./subfolder2/another"); +>_m43 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another" : "./subfolder2/another" +> : ^^^^^^^^^^^^^^^^^^^^^^ + +const _m44 = import("./subfolder2/another/"); +>_m44 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another/" : "./subfolder2/another/" +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another/index" : "./subfolder2/another/index" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +// esm format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== index.cjs === +// ESM-format imports below should issue errors +import * as m1 from "./index.js"; +>m1 : typeof m1 +> : ^^^^^^^^^ + +import * as m2 from "./index.mjs"; +>m2 : typeof m2 +> : ^^^^^^^^^ + +import * as m3 from "./index.cjs"; +>m3 : typeof m3 +> : ^^^^^^^^^ + +import * as m4 from "./subfolder/index.js"; +>m4 : typeof m4 +> : ^^^^^^^^^ + +import * as m5 from "./subfolder/index.mjs"; +>m5 : typeof m5 +> : ^^^^^^^^^ + +import * as m6 from "./subfolder/index.cjs"; +>m6 : typeof m6 +> : ^^^^^^^^^ + +import * as m7 from "./subfolder2/index.js"; +>m7 : typeof m7 +> : ^^^^^^^^^ + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : typeof m8 +> : ^^^^^^^^^ + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : typeof m9 +> : ^^^^^^^^^ + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : typeof m10 +> : ^^^^^^^^^^ + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : typeof m11 +> : ^^^^^^^^^^ + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : typeof m12 +> : ^^^^^^^^^^ + +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +import * as m13 from "./"; +>m13 : typeof m1 +> : ^^^^^^^^^ + +import * as m14 from "./index"; +>m14 : typeof m1 +> : ^^^^^^^^^ + +import * as m15 from "./subfolder"; +>m15 : typeof m4 +> : ^^^^^^^^^ + +import * as m16 from "./subfolder/"; +>m16 : typeof m4 +> : ^^^^^^^^^ + +import * as m17 from "./subfolder/index"; +>m17 : typeof m4 +> : ^^^^^^^^^ + +import * as m18 from "./subfolder2"; +>m18 : typeof m7 +> : ^^^^^^^^^ + +import * as m19 from "./subfolder2/"; +>m19 : typeof m7 +> : ^^^^^^^^^ + +import * as m20 from "./subfolder2/index"; +>m20 : typeof m7 +> : ^^^^^^^^^ + +import * as m21 from "./subfolder2/another"; +>m21 : typeof m10 +> : ^^^^^^^^^^ + +import * as m22 from "./subfolder2/another/"; +>m22 : typeof m10 +> : ^^^^^^^^^^ + +import * as m23 from "./subfolder2/another/index"; +>m23 : typeof m10 +> : ^^^^^^^^^^ + +void m1; +>void m1 : undefined +> : ^^^^^^^^^ +>m1 : typeof m1 +> : ^^^^^^^^^ + +void m2; +>void m2 : undefined +> : ^^^^^^^^^ +>m2 : typeof m2 +> : ^^^^^^^^^ + +void m3; +>void m3 : undefined +> : ^^^^^^^^^ +>m3 : typeof m3 +> : ^^^^^^^^^ + +void m4; +>void m4 : undefined +> : ^^^^^^^^^ +>m4 : typeof m4 +> : ^^^^^^^^^ + +void m5; +>void m5 : undefined +> : ^^^^^^^^^ +>m5 : typeof m5 +> : ^^^^^^^^^ + +void m6; +>void m6 : undefined +> : ^^^^^^^^^ +>m6 : typeof m6 +> : ^^^^^^^^^ + +void m7; +>void m7 : undefined +> : ^^^^^^^^^ +>m7 : typeof m7 +> : ^^^^^^^^^ + +void m8; +>void m8 : undefined +> : ^^^^^^^^^ +>m8 : typeof m8 +> : ^^^^^^^^^ + +void m9; +>void m9 : undefined +> : ^^^^^^^^^ +>m9 : typeof m9 +> : ^^^^^^^^^ + +void m10; +>void m10 : undefined +> : ^^^^^^^^^ +>m10 : typeof m10 +> : ^^^^^^^^^^ + +void m11; +>void m11 : undefined +> : ^^^^^^^^^ +>m11 : typeof m11 +> : ^^^^^^^^^^ + +void m12; +>void m12 : undefined +> : ^^^^^^^^^ +>m12 : typeof m12 +> : ^^^^^^^^^^ + +void m13; +>void m13 : undefined +> : ^^^^^^^^^ +>m13 : typeof m1 +> : ^^^^^^^^^ + +void m14; +>void m14 : undefined +> : ^^^^^^^^^ +>m14 : typeof m1 +> : ^^^^^^^^^ + +void m15; +>void m15 : undefined +> : ^^^^^^^^^ +>m15 : typeof m4 +> : ^^^^^^^^^ + +void m16; +>void m16 : undefined +> : ^^^^^^^^^ +>m16 : typeof m4 +> : ^^^^^^^^^ + +void m17; +>void m17 : undefined +> : ^^^^^^^^^ +>m17 : typeof m4 +> : ^^^^^^^^^ + +void m18; +>void m18 : undefined +> : ^^^^^^^^^ +>m18 : typeof m7 +> : ^^^^^^^^^ + +void m19; +>void m19 : undefined +> : ^^^^^^^^^ +>m19 : typeof m7 +> : ^^^^^^^^^ + +void m20; +>void m20 : undefined +> : ^^^^^^^^^ +>m20 : typeof m7 +> : ^^^^^^^^^ + +void m21; +>void m21 : undefined +> : ^^^^^^^^^ +>m21 : typeof m10 +> : ^^^^^^^^^^ + +void m22; +>void m22 : undefined +> : ^^^^^^^^^ +>m22 : typeof m10 +> : ^^^^^^^^^^ + +void m23; +>void m23 : undefined +> : ^^^^^^^^^ +>m23 : typeof m10 +> : ^^^^^^^^^^ + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : typeof m1 +> : ^^^^^^^^^ + +import m25 = require("./index"); +>m25 : typeof m1 +> : ^^^^^^^^^ + +import m26 = require("./subfolder"); +>m26 : typeof m4 +> : ^^^^^^^^^ + +import m27 = require("./subfolder/"); +>m27 : typeof m4 +> : ^^^^^^^^^ + +import m28 = require("./subfolder/index"); +>m28 : typeof m4 +> : ^^^^^^^^^ + +import m29 = require("./subfolder2"); +>m29 : typeof m7 +> : ^^^^^^^^^ + +import m30 = require("./subfolder2/"); +>m30 : typeof m7 +> : ^^^^^^^^^ + +import m31 = require("./subfolder2/index"); +>m31 : typeof m7 +> : ^^^^^^^^^ + +import m32 = require("./subfolder2/another"); +>m32 : typeof m10 +> : ^^^^^^^^^^ + +import m33 = require("./subfolder2/another/"); +>m33 : typeof m10 +> : ^^^^^^^^^^ + +import m34 = require("./subfolder2/another/index"); +>m34 : typeof m10 +> : ^^^^^^^^^^ + +void m24; +>void m24 : undefined +> : ^^^^^^^^^ +>m24 : typeof m1 +> : ^^^^^^^^^ + +void m25; +>void m25 : undefined +> : ^^^^^^^^^ +>m25 : typeof m1 +> : ^^^^^^^^^ + +void m26; +>void m26 : undefined +> : ^^^^^^^^^ +>m26 : typeof m4 +> : ^^^^^^^^^ + +void m27; +>void m27 : undefined +> : ^^^^^^^^^ +>m27 : typeof m4 +> : ^^^^^^^^^ + +void m28; +>void m28 : undefined +> : ^^^^^^^^^ +>m28 : typeof m4 +> : ^^^^^^^^^ + +void m29; +>void m29 : undefined +> : ^^^^^^^^^ +>m29 : typeof m7 +> : ^^^^^^^^^ + +void m30; +>void m30 : undefined +> : ^^^^^^^^^ +>m30 : typeof m7 +> : ^^^^^^^^^ + +void m31; +>void m31 : undefined +> : ^^^^^^^^^ +>m31 : typeof m7 +> : ^^^^^^^^^ + +void m32; +>void m32 : undefined +> : ^^^^^^^^^ +>m32 : typeof m10 +> : ^^^^^^^^^^ + +void m33; +>void m33 : undefined +> : ^^^^^^^^^ +>m33 : typeof m10 +> : ^^^^^^^^^^ + +void m34; +>void m34 : undefined +> : ^^^^^^^^^ +>m34 : typeof m10 +> : ^^^^^^^^^^ + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Promise +> : ^^^^^^^^^^^^ +>import("./") : Promise +> : ^^^^^^^^^^^^ +>"./" : "./" +> : ^^^^ + +const _m36 = import("./index"); +>_m36 : Promise +> : ^^^^^^^^^^^^ +>import("./index") : Promise +> : ^^^^^^^^^^^^ +>"./index" : "./index" +> : ^^^^^^^^^ + +const _m37 = import("./subfolder"); +>_m37 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder" : "./subfolder" +> : ^^^^^^^^^^^^^ + +const _m38 = import("./subfolder/"); +>_m38 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder/" : "./subfolder/" +> : ^^^^^^^^^^^^^^ + +const _m39 = import("./subfolder/index"); +>_m39 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder/index" : "./subfolder/index" +> : ^^^^^^^^^^^^^^^^^^^ + +const _m40 = import("./subfolder2"); +>_m40 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2" : "./subfolder2" +> : ^^^^^^^^^^^^^^ + +const _m41 = import("./subfolder2/"); +>_m41 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/" : "./subfolder2/" +> : ^^^^^^^^^^^^^^^ + +const _m42 = import("./subfolder2/index"); +>_m42 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/index" : "./subfolder2/index" +> : ^^^^^^^^^^^^^^^^^^^^ + +const _m43 = import("./subfolder2/another"); +>_m43 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another" : "./subfolder2/another" +> : ^^^^^^^^^^^^^^^^^^^^^^ + +const _m44 = import("./subfolder2/another/"); +>_m44 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another/" : "./subfolder2/another/" +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another/index" : "./subfolder2/another/index" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +// cjs format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +=== index.mjs === +import * as m1 from "./index.js"; +>m1 : typeof m1 +> : ^^^^^^^^^ + +import * as m2 from "./index.mjs"; +>m2 : typeof m2 +> : ^^^^^^^^^ + +import * as m3 from "./index.cjs"; +>m3 : typeof m3 +> : ^^^^^^^^^ + +import * as m4 from "./subfolder/index.js"; +>m4 : typeof m4 +> : ^^^^^^^^^ + +import * as m5 from "./subfolder/index.mjs"; +>m5 : typeof m5 +> : ^^^^^^^^^ + +import * as m6 from "./subfolder/index.cjs"; +>m6 : typeof m6 +> : ^^^^^^^^^ + +import * as m7 from "./subfolder2/index.js"; +>m7 : typeof m7 +> : ^^^^^^^^^ + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : typeof m8 +> : ^^^^^^^^^ + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : typeof m9 +> : ^^^^^^^^^ + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : typeof m10 +> : ^^^^^^^^^^ + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : typeof m11 +> : ^^^^^^^^^^ + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : typeof m12 +> : ^^^^^^^^^^ + +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : any +> : ^^^ + +import * as m14 from "./index"; +>m14 : any +> : ^^^ + +import * as m15 from "./subfolder"; +>m15 : any +> : ^^^ + +import * as m16 from "./subfolder/"; +>m16 : any +> : ^^^ + +import * as m17 from "./subfolder/index"; +>m17 : any +> : ^^^ + +import * as m18 from "./subfolder2"; +>m18 : any +> : ^^^ + +import * as m19 from "./subfolder2/"; +>m19 : any +> : ^^^ + +import * as m20 from "./subfolder2/index"; +>m20 : any +> : ^^^ + +import * as m21 from "./subfolder2/another"; +>m21 : any +> : ^^^ + +import * as m22 from "./subfolder2/another/"; +>m22 : any +> : ^^^ + +import * as m23 from "./subfolder2/another/index"; +>m23 : any +> : ^^^ + +void m1; +>void m1 : undefined +> : ^^^^^^^^^ +>m1 : typeof m1 +> : ^^^^^^^^^ + +void m2; +>void m2 : undefined +> : ^^^^^^^^^ +>m2 : typeof m2 +> : ^^^^^^^^^ + +void m3; +>void m3 : undefined +> : ^^^^^^^^^ +>m3 : typeof m3 +> : ^^^^^^^^^ + +void m4; +>void m4 : undefined +> : ^^^^^^^^^ +>m4 : typeof m4 +> : ^^^^^^^^^ + +void m5; +>void m5 : undefined +> : ^^^^^^^^^ +>m5 : typeof m5 +> : ^^^^^^^^^ + +void m6; +>void m6 : undefined +> : ^^^^^^^^^ +>m6 : typeof m6 +> : ^^^^^^^^^ + +void m7; +>void m7 : undefined +> : ^^^^^^^^^ +>m7 : typeof m7 +> : ^^^^^^^^^ + +void m8; +>void m8 : undefined +> : ^^^^^^^^^ +>m8 : typeof m8 +> : ^^^^^^^^^ + +void m9; +>void m9 : undefined +> : ^^^^^^^^^ +>m9 : typeof m9 +> : ^^^^^^^^^ + +void m10; +>void m10 : undefined +> : ^^^^^^^^^ +>m10 : typeof m10 +> : ^^^^^^^^^^ + +void m11; +>void m11 : undefined +> : ^^^^^^^^^ +>m11 : typeof m11 +> : ^^^^^^^^^^ + +void m12; +>void m12 : undefined +> : ^^^^^^^^^ +>m12 : typeof m12 +> : ^^^^^^^^^^ + +void m13; +>void m13 : undefined +> : ^^^^^^^^^ +>m13 : any +> : ^^^ + +void m14; +>void m14 : undefined +> : ^^^^^^^^^ +>m14 : any +> : ^^^ + +void m15; +>void m15 : undefined +> : ^^^^^^^^^ +>m15 : any +> : ^^^ + +void m16; +>void m16 : undefined +> : ^^^^^^^^^ +>m16 : any +> : ^^^ + +void m17; +>void m17 : undefined +> : ^^^^^^^^^ +>m17 : any +> : ^^^ + +void m18; +>void m18 : undefined +> : ^^^^^^^^^ +>m18 : any +> : ^^^ + +void m19; +>void m19 : undefined +> : ^^^^^^^^^ +>m19 : any +> : ^^^ + +void m20; +>void m20 : undefined +> : ^^^^^^^^^ +>m20 : any +> : ^^^ + +void m21; +>void m21 : undefined +> : ^^^^^^^^^ +>m21 : any +> : ^^^ + +void m22; +>void m22 : undefined +> : ^^^^^^^^^ +>m22 : any +> : ^^^ + +void m23; +>void m23 : undefined +> : ^^^^^^^^^ +>m23 : any +> : ^^^ + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : typeof m1 +> : ^^^^^^^^^ + +import m25 = require("./index"); +>m25 : typeof m1 +> : ^^^^^^^^^ + +import m26 = require("./subfolder"); +>m26 : typeof m26 +> : ^^^^^^^^^^ + +import m27 = require("./subfolder/"); +>m27 : typeof m26 +> : ^^^^^^^^^^ + +import m28 = require("./subfolder/index"); +>m28 : typeof m26 +> : ^^^^^^^^^^ + +import m29 = require("./subfolder2"); +>m29 : typeof m29 +> : ^^^^^^^^^^ + +import m30 = require("./subfolder2/"); +>m30 : typeof m29 +> : ^^^^^^^^^^ + +import m31 = require("./subfolder2/index"); +>m31 : typeof m29 +> : ^^^^^^^^^^ + +import m32 = require("./subfolder2/another"); +>m32 : typeof m10 +> : ^^^^^^^^^^ + +import m33 = require("./subfolder2/another/"); +>m33 : typeof m10 +> : ^^^^^^^^^^ + +import m34 = require("./subfolder2/another/index"); +>m34 : typeof m10 +> : ^^^^^^^^^^ + +void m24; +>void m24 : undefined +> : ^^^^^^^^^ +>m24 : typeof m1 +> : ^^^^^^^^^ + +void m25; +>void m25 : undefined +> : ^^^^^^^^^ +>m25 : typeof m1 +> : ^^^^^^^^^ + +void m26; +>void m26 : undefined +> : ^^^^^^^^^ +>m26 : typeof m26 +> : ^^^^^^^^^^ + +void m27; +>void m27 : undefined +> : ^^^^^^^^^ +>m27 : typeof m26 +> : ^^^^^^^^^^ + +void m28; +>void m28 : undefined +> : ^^^^^^^^^ +>m28 : typeof m26 +> : ^^^^^^^^^^ + +void m29; +>void m29 : undefined +> : ^^^^^^^^^ +>m29 : typeof m29 +> : ^^^^^^^^^^ + +void m30; +>void m30 : undefined +> : ^^^^^^^^^ +>m30 : typeof m29 +> : ^^^^^^^^^^ + +void m31; +>void m31 : undefined +> : ^^^^^^^^^ +>m31 : typeof m29 +> : ^^^^^^^^^^ + +void m32; +>void m32 : undefined +> : ^^^^^^^^^ +>m32 : typeof m10 +> : ^^^^^^^^^^ + +void m33; +>void m33 : undefined +> : ^^^^^^^^^ +>m33 : typeof m10 +> : ^^^^^^^^^^ + +void m34; +>void m34 : undefined +> : ^^^^^^^^^ +>m34 : typeof m10 +> : ^^^^^^^^^^ + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Promise +> : ^^^^^^^^^^^^ +>import("./") : Promise +> : ^^^^^^^^^^^^ +>"./" : "./" +> : ^^^^ + +const _m36 = import("./index"); +>_m36 : Promise +> : ^^^^^^^^^^^^ +>import("./index") : Promise +> : ^^^^^^^^^^^^ +>"./index" : "./index" +> : ^^^^^^^^^ + +const _m37 = import("./subfolder"); +>_m37 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder" : "./subfolder" +> : ^^^^^^^^^^^^^ + +const _m38 = import("./subfolder/"); +>_m38 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder/" : "./subfolder/" +> : ^^^^^^^^^^^^^^ + +const _m39 = import("./subfolder/index"); +>_m39 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder/index" : "./subfolder/index" +> : ^^^^^^^^^^^^^^^^^^^ + +const _m40 = import("./subfolder2"); +>_m40 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2" : "./subfolder2" +> : ^^^^^^^^^^^^^^ + +const _m41 = import("./subfolder2/"); +>_m41 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/" : "./subfolder2/" +> : ^^^^^^^^^^^^^^^ + +const _m42 = import("./subfolder2/index"); +>_m42 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/index" : "./subfolder2/index" +> : ^^^^^^^^^^^^^^^^^^^^ + +const _m43 = import("./subfolder2/another"); +>_m43 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another" : "./subfolder2/another" +> : ^^^^^^^^^^^^^^^^^^^^^^ + +const _m44 = import("./subfolder2/another/"); +>_m44 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another/") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another/" : "./subfolder2/another/" +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Promise +> : ^^^^^^^^^^^^ +>import("./subfolder2/another/index") : Promise +> : ^^^^^^^^^^^^ +>"./subfolder2/another/index" : "./subfolder2/another/index" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +// esm format file +const x = 1; +>x : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + diff --git a/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node20).symbols new file mode 100644 index 0000000000000..b855f772f99f4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node20).symbols @@ -0,0 +1,17 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts] //// + +=== foo.cjs === +exports.foo = "foo" +>exports.foo : Symbol(foo, Decl(foo.cjs, 0, 0)) +>exports : Symbol(foo, Decl(foo.cjs, 0, 0)) +>foo : Symbol(foo, Decl(foo.cjs, 0, 0)) + +=== bar.ts === +import foo from "./foo.cjs" +>foo : Symbol(foo, Decl(bar.ts, 0, 6)) + +foo.foo; +>foo.foo : Symbol(foo.foo, Decl(foo.cjs, 0, 0)) +>foo : Symbol(foo, Decl(bar.ts, 0, 6)) +>foo : Symbol(foo.foo, Decl(foo.cjs, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node20).types new file mode 100644 index 0000000000000..ec9c59e5c8a9b --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node20).types @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts] //// + +=== foo.cjs === +exports.foo = "foo" +>exports.foo = "foo" : "foo" +> : ^^^^^ +>exports.foo : "foo" +> : ^^^^^ +>exports : typeof import("foo") +> : ^^^^^^^^^^^^^^^^^^^^ +>foo : "foo" +> : ^^^^^ +>"foo" : "foo" +> : ^^^^^ + +=== bar.ts === +import foo from "./foo.cjs" +>foo : typeof foo +> : ^^^^^^^^^^ + +foo.foo; +>foo.foo : "foo" +> : ^^^^^ +>foo : typeof foo +> : ^^^^^^^^^^ +>foo : "foo" +> : ^^^^^ + diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node20).errors.txt new file mode 100644 index 0000000000000..643335c38309c --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node20).errors.txt @@ -0,0 +1,131 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. +node_modules/inner/index.d.mts(2,13): error TS2303: Circular definition of import alias 'cjs'. +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. + + +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. +==== index.js (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/a"; + import * as mjsi from "inner/b"; + import * as typei from "inner"; + import * as ts from "inner/types"; + cjsi.mjsSource; + mjsi.mjsSource; + typei.mjsSource; + ts.mjsSource; +==== index.mjs (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/a"; + import * as mjsi from "inner/b"; + import * as typei from "inner"; + import * as ts from "inner/types"; + cjsi.mjsSource; + mjsi.mjsSource; + typei.mjsSource; + ts.mjsSource; +==== index.cjs (0 errors) ==== + // cjs format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/a"; + import * as mjsi from "inner/b"; + import * as typei from "inner"; + import * as ts from "inner/types"; + cjsi.cjsSource; + mjsi.cjsSource; + typei.implicitCjsSource; + ts.cjsSource; +==== node_modules/inner/index.d.ts (1 errors) ==== + // cjs format file + import * as cjs from "inner/a"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/b"; + import * as type from "inner"; + import * as ts from "inner/types"; + export { cjs }; + export { mjs }; + export { type }; + export { ts }; + export const implicitCjsSource = true; +==== node_modules/inner/index.d.mts (1 errors) ==== + // esm format file + import * as cjs from "inner/a"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/b"; + import * as type from "inner"; + import * as ts from "inner/types"; + export { cjs }; + export { mjs }; + export { type }; + export { ts }; + export const mjsSource = true; +==== node_modules/inner/index.d.cts (0 errors) ==== + // cjs format file + import * as cjs from "inner/a"; + import * as mjs from "inner/b"; + import * as type from "inner"; + import * as ts from "inner/types"; + export { cjs }; + export { mjs }; + export { type }; + export { ts }; + export const cjsSource = true; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./a": { + "require": "./index.cjs", + "node": "./index.mjs" + }, + "./b": { + "import": "./index.mjs", + "node": "./index.cjs" + }, + ".": { + "import": "./index.mjs", + "node": "./index.js" + }, + "./types": { + "types": { + "import": "./index.d.mts", + "require": "./index.d.cts", + }, + "node": { + "import": "./index.mjs", + "require": "./index.cjs" + } + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node20).js new file mode 100644 index 0000000000000..89094051db9df --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node20).js @@ -0,0 +1,215 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsConditionalPackageExports.ts] //// + +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; +//// [index.mjs] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; +//// [index.cjs] +// cjs format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.cjsSource; +mjsi.cjsSource; +typei.implicitCjsSource; +ts.cjsSource; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/a"; +import * as mjs from "inner/b"; +import * as type from "inner"; +import * as ts from "inner/types"; +export { cjs }; +export { mjs }; +export { type }; +export { ts }; +export const implicitCjsSource = true; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/a"; +import * as mjs from "inner/b"; +import * as type from "inner"; +import * as ts from "inner/types"; +export { cjs }; +export { mjs }; +export { type }; +export { ts }; +export const mjsSource = true; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/a"; +import * as mjs from "inner/b"; +import * as type from "inner"; +import * as ts from "inner/types"; +export { cjs }; +export { mjs }; +export { type }; +export { ts }; +export const cjsSource = true; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./a": { + "require": "./index.cjs", + "node": "./index.mjs" + }, + "./b": { + "import": "./index.mjs", + "node": "./index.cjs" + }, + ".": { + "import": "./index.mjs", + "node": "./index.js" + }, + "./types": { + "types": { + "import": "./index.d.mts", + "require": "./index.d.cts", + }, + "node": { + "import": "./index.mjs", + "require": "./index.cjs" + } + } + } +} + +//// [index.mjs] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjs = __importStar(require("package/cjs")); +const mjs = __importStar(require("package/mjs")); +const type = __importStar(require("package")); +cjs; +mjs; +type; +const cjsi = __importStar(require("inner/a")); +const mjsi = __importStar(require("inner/b")); +const typei = __importStar(require("inner")); +const ts = __importStar(require("inner/types")); +cjsi.cjsSource; +mjsi.cjsSource; +typei.implicitCjsSource; +ts.cjsSource; +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; + + +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node20).symbols new file mode 100644 index 0000000000000..6ac785d10279f --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node20).symbols @@ -0,0 +1,245 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsConditionalPackageExports.ts] //// + +=== index.js === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.js, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.js, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.js, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.js, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.js, 2, 6)) + +type; +>type : Symbol(type, Decl(index.js, 3, 6)) + +import * as cjsi from "inner/a"; +>cjsi : Symbol(cjsi, Decl(index.js, 7, 6)) + +import * as mjsi from "inner/b"; +>mjsi : Symbol(mjsi, Decl(index.js, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.js, 9, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.js, 10, 6)) + +cjsi.mjsSource; +>cjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>cjsi : Symbol(cjsi, Decl(index.js, 7, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +mjsi.mjsSource; +>mjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>mjsi : Symbol(mjsi, Decl(index.js, 8, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +typei.mjsSource; +>typei.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>typei : Symbol(typei, Decl(index.js, 9, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +ts.mjsSource; +>ts.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>ts : Symbol(ts, Decl(index.js, 10, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +=== index.mjs === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.mjs, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) + +type; +>type : Symbol(type, Decl(index.mjs, 3, 6)) + +import * as cjsi from "inner/a"; +>cjsi : Symbol(cjsi, Decl(index.mjs, 7, 6)) + +import * as mjsi from "inner/b"; +>mjsi : Symbol(mjsi, Decl(index.mjs, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.mjs, 9, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.mjs, 10, 6)) + +cjsi.mjsSource; +>cjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>cjsi : Symbol(cjsi, Decl(index.mjs, 7, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +mjsi.mjsSource; +>mjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>mjsi : Symbol(mjsi, Decl(index.mjs, 8, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +typei.mjsSource; +>typei.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>typei : Symbol(typei, Decl(index.mjs, 9, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +ts.mjsSource; +>ts.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>ts : Symbol(ts, Decl(index.mjs, 10, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +=== index.cjs === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.cjs, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) + +type; +>type : Symbol(type, Decl(index.cjs, 3, 6)) + +import * as cjsi from "inner/a"; +>cjsi : Symbol(cjsi, Decl(index.cjs, 7, 6)) + +import * as mjsi from "inner/b"; +>mjsi : Symbol(mjsi, Decl(index.cjs, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.cjs, 9, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.cjs, 10, 6)) + +cjsi.cjsSource; +>cjsi.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) +>cjsi : Symbol(cjsi, Decl(index.cjs, 7, 6)) +>cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) + +mjsi.cjsSource; +>mjsi.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) +>mjsi : Symbol(mjsi, Decl(index.cjs, 8, 6)) +>cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) + +typei.implicitCjsSource; +>typei.implicitCjsSource : Symbol(cjsi.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) +>typei : Symbol(typei, Decl(index.cjs, 9, 6)) +>implicitCjsSource : Symbol(cjsi.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) + +ts.cjsSource; +>ts.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) +>ts : Symbol(ts, Decl(index.cjs, 10, 6)) +>cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/b"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.d.ts, 4, 6)) + +export { cjs }; +>cjs : Symbol(mjs.type.cjs, Decl(index.d.ts, 5, 8)) + +export { mjs }; +>mjs : Symbol(mjs.type.mjs, Decl(index.d.ts, 6, 8)) + +export { type }; +>type : Symbol(mjs.type.type, Decl(index.d.ts, 7, 8)) + +export { ts }; +>ts : Symbol(mjs.type.ts, Decl(index.d.ts, 8, 8)) + +export const implicitCjsSource = true; +>implicitCjsSource : Symbol(mjs.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/a"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/b"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.d.mts, 4, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs, Decl(index.d.mts, 5, 8)) + +export { mjs }; +>mjs : Symbol(mjs.mjs, Decl(index.d.mts, 6, 8)) + +export { type }; +>type : Symbol(mjs.type, Decl(index.d.mts, 7, 8)) + +export { ts }; +>ts : Symbol(mjs.ts, Decl(index.d.mts, 8, 8)) + +export const mjsSource = true; +>mjsSource : Symbol(mjs.mjsSource, Decl(index.d.mts, 9, 12)) + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/b"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.d.cts, 4, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 5, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 6, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 7, 8)) + +export { ts }; +>ts : Symbol(cjs.ts, Decl(index.d.cts, 8, 8)) + +export const cjsSource = true; +>cjsSource : Symbol(cjs.cjsSource, Decl(index.d.cts, 9, 12)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node20).types new file mode 100644 index 0000000000000..bfa4914e21fe9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node20).types @@ -0,0 +1,344 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsConditionalPackageExports.ts] //// + +=== index.js === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "package/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "package"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +import * as cjsi from "inner/a"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/b"; +>mjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as typei from "inner"; +>typei : typeof cjsi +> : ^^^^^^^^^^^ + +import * as ts from "inner/types"; +>ts : typeof cjsi +> : ^^^^^^^^^^^ + +cjsi.mjsSource; +>cjsi.mjsSource : true +> : ^^^^ +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +mjsi.mjsSource; +>mjsi.mjsSource : true +> : ^^^^ +>mjsi : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +typei.mjsSource; +>typei.mjsSource : true +> : ^^^^ +>typei : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +ts.mjsSource; +>ts.mjsSource : true +> : ^^^^ +>ts : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +=== index.mjs === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "package/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "package"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +import * as cjsi from "inner/a"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/b"; +>mjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as typei from "inner"; +>typei : typeof cjsi +> : ^^^^^^^^^^^ + +import * as ts from "inner/types"; +>ts : typeof cjsi +> : ^^^^^^^^^^^ + +cjsi.mjsSource; +>cjsi.mjsSource : true +> : ^^^^ +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +mjsi.mjsSource; +>mjsi.mjsSource : true +> : ^^^^ +>mjsi : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +typei.mjsSource; +>typei.mjsSource : true +> : ^^^^ +>typei : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +ts.mjsSource; +>ts.mjsSource : true +> : ^^^^ +>ts : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +=== index.cjs === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "package/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "package"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +import * as cjsi from "inner/a"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/b"; +>mjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as typei from "inner"; +>typei : typeof cjsi.type +> : ^^^^^^^^^^^^^^^^ + +import * as ts from "inner/types"; +>ts : typeof cjsi +> : ^^^^^^^^^^^ + +cjsi.cjsSource; +>cjsi.cjsSource : true +> : ^^^^ +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ +>cjsSource : true +> : ^^^^ + +mjsi.cjsSource; +>mjsi.cjsSource : true +> : ^^^^ +>mjsi : typeof cjsi +> : ^^^^^^^^^^^ +>cjsSource : true +> : ^^^^ + +typei.implicitCjsSource; +>typei.implicitCjsSource : true +> : ^^^^ +>typei : typeof cjsi.type +> : ^^^^^^^^^^^^^^^^ +>implicitCjsSource : true +> : ^^^^ + +ts.cjsSource; +>ts.cjsSource : true +> : ^^^^ +>ts : typeof cjsi +> : ^^^^^^^^^^^ +>cjsSource : true +> : ^^^^ + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/b"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "inner"; +>type : typeof mjs.type +> : ^^^^^^^^^^^^^^^ + +import * as ts from "inner/types"; +>ts : typeof mjs +> : ^^^^^^^^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +export { type }; +>type : typeof mjs.type +> : ^^^^^^^^^^^^^^^ + +export { ts }; +>ts : typeof mjs +> : ^^^^^^^^^^ + +export const implicitCjsSource = true; +>implicitCjsSource : true +> : ^^^^ +>true : true +> : ^^^^ + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/a"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/b"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "inner"; +>type : typeof mjs +> : ^^^^^^^^^^ + +import * as ts from "inner/types"; +>ts : typeof mjs +> : ^^^^^^^^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +export { type }; +>type : typeof mjs +> : ^^^^^^^^^^ + +export { ts }; +>ts : typeof mjs +> : ^^^^^^^^^^ + +export const mjsSource = true; +>mjsSource : true +> : ^^^^ +>true : true +> : ^^^^ + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/b"; +>mjs : typeof cjs +> : ^^^^^^^^^^ + +import * as type from "inner"; +>type : typeof cjs.type +> : ^^^^^^^^^^^^^^^ + +import * as ts from "inner/types"; +>ts : typeof cjs +> : ^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs +> : ^^^^^^^^^^ + +export { type }; +>type : typeof cjs.type +> : ^^^^^^^^^^^^^^^ + +export { ts }; +>ts : typeof cjs +> : ^^^^^^^^^^ + +export const cjsSource = true; +>cjsSource : true +> : ^^^^ +>true : true +> : ^^^^ + diff --git a/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node20).js new file mode 100644 index 0000000000000..ac43e11733d77 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node20).js @@ -0,0 +1,44 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts] //// + +//// [index.js] +// cjs format file +export async function main() { + const { readFile } = await import("fs"); +} +//// [index.js] +// esm format file +export async function main() { + const { readFile } = await import("fs"); +} +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.main = main; +// cjs format file +async function main() { + const { readFile } = await import("fs"); +} +//// [index.js] +// esm format file +export async function main() { + const { readFile } = await import("fs"); +} + + +//// [index.d.ts] +export function main(): Promise; +//// [index.d.ts] +export function main(): Promise; diff --git a/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node20).symbols new file mode 100644 index 0000000000000..eabf1117f687d --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node20).symbols @@ -0,0 +1,24 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts] //// + +=== subfolder/index.js === +// cjs format file +export async function main() { +>main : Symbol(main, Decl(index.js, 0, 0)) + + const { readFile } = await import("fs"); +>readFile : Symbol(readFile, Decl(index.js, 2, 11)) +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) +} +=== index.js === +// esm format file +export async function main() { +>main : Symbol(main, Decl(index.js, 0, 0)) + + const { readFile } = await import("fs"); +>readFile : Symbol(readFile, Decl(index.js, 2, 11)) +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) +} +=== types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node20).types new file mode 100644 index 0000000000000..8689b18a720f7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node20).types @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts] //// + +=== subfolder/index.js === +// cjs format file +export async function main() { +>main : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + + const { readFile } = await import("fs"); +>readFile : any +> : ^^^ +>await import("fs") : any +>import("fs") : Promise +> : ^^^^^^^^^^^^ +>"fs" : "fs" +> : ^^^^ +} +=== index.js === +// esm format file +export async function main() { +>main : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + + const { readFile } = await import("fs"); +>readFile : any +> : ^^^ +>await import("fs") : any +>import("fs") : Promise +> : ^^^^^^^^^^^^ +>"fs" : "fs" +> : ^^^^ +} +=== types.d.ts === +declare module "fs"; +>"fs" : any + diff --git a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node20).errors.txt new file mode 100644 index 0000000000000..15bd70e4c2e9d --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node20).errors.txt @@ -0,0 +1,41 @@ +file.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. +index.js(3,1): error TS8003: 'export =' can only be used in TypeScript files. +subfolder/index.js(3,1): error TS8003: 'export =' can only be used in TypeScript files. + + +==== subfolder/index.js (1 errors) ==== + // cjs format file + const a = {}; + export = a; + ~~~~~~~~~~~ +!!! error TS8003: 'export =' can only be used in TypeScript files. +==== subfolder/file.js (0 errors) ==== + // cjs format file + const a = {}; + module.exports = a; +==== index.js (2 errors) ==== + // esm format file + const a = {}; + export = a; + ~~~~~~~~~~~ +!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. + ~~~~~~~~~~~ +!!! error TS8003: 'export =' can only be used in TypeScript files. +==== file.js (1 errors) ==== + // esm format file + import "fs"; + const a = {}; + module.exports = a; + ~~~~~~ +!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node20).js new file mode 100644 index 0000000000000..92ecb7eacddd7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node20).js @@ -0,0 +1,62 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportAssignment.ts] //// + +//// [index.js] +// cjs format file +const a = {}; +export = a; +//// [file.js] +// cjs format file +const a = {}; +module.exports = a; +//// [index.js] +// esm format file +const a = {}; +export = a; +//// [file.js] +// esm format file +import "fs"; +const a = {}; +module.exports = a; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +// cjs format file +const a = {}; +module.exports = a; +//// [file.js] +"use strict"; +// cjs format file +const a = {}; +module.exports = a; +//// [index.js] +// esm format file +const a = {}; +export {}; +//// [file.js] +// esm format file +import "fs"; +const a = {}; +module.exports = a; + + +//// [index.d.ts] +export = a; +declare const a: {}; +//// [file.d.ts] +export = a; +declare const a: {}; +//// [index.d.ts] +export = a; +declare const a: {}; +//// [file.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node20).symbols new file mode 100644 index 0000000000000..0e6aa57c8289b --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node20).symbols @@ -0,0 +1,38 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportAssignment.ts] //// + +=== subfolder/index.js === +// cjs format file +const a = {}; +>a : Symbol(a, Decl(index.js, 1, 5)) + +export = a; +>a : Symbol(a, Decl(index.js, 1, 5)) + +=== subfolder/file.js === +// cjs format file +const a = {}; +>a : Symbol(a, Decl(file.js, 1, 5)) + +module.exports = a; +>module.exports : Symbol(module.exports, Decl(file.js, 0, 0)) +>module : Symbol(export=, Decl(file.js, 1, 13)) +>exports : Symbol(export=, Decl(file.js, 1, 13)) +>a : Symbol(a, Decl(file.js, 1, 5)) + +=== index.js === +// esm format file +const a = {}; +>a : Symbol(a, Decl(index.js, 1, 5)) + +export = a; +>a : Symbol(a, Decl(index.js, 1, 5)) + +=== file.js === +// esm format file +import "fs"; +const a = {}; +>a : Symbol(a, Decl(file.js, 2, 5)) + +module.exports = a; +>a : Symbol(a, Decl(file.js, 2, 5)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node20).types new file mode 100644 index 0000000000000..b860b335a2df8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node20).types @@ -0,0 +1,67 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportAssignment.ts] //// + +=== subfolder/index.js === +// cjs format file +const a = {}; +>a : {} +> : ^^ +>{} : {} +> : ^^ + +export = a; +>a : {} +> : ^^ + +=== subfolder/file.js === +// cjs format file +const a = {}; +>a : {} +> : ^^ +>{} : {} +> : ^^ + +module.exports = a; +>module.exports = a : {} +> : ^^ +>module.exports : {} +> : ^^ +>module : { exports: {}; } +> : ^^^^^^^^^^^^^^^^ +>exports : {} +> : ^^ +>a : {} +> : ^^ + +=== index.js === +// esm format file +const a = {}; +>a : {} +> : ^^ +>{} : {} +> : ^^ + +export = a; +>a : {} +> : ^^ + +=== file.js === +// esm format file +import "fs"; +const a = {}; +>a : {} +> : ^^ +>{} : {} +> : ^^ + +module.exports = a; +>module.exports = a : any +> : ^^^ +>module.exports : any +> : ^^^ +>module : any +> : ^^^ +>exports : any +> : ^^^ +>a : {} +> : ^^ + diff --git a/tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node20).js new file mode 100644 index 0000000000000..e3ca6368e77fb --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node20).js @@ -0,0 +1,13 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportlessJsModuleDetectionAuto.ts] //// + +//// [foo.cjs] +// this file is a module despite having no imports +//// [bar.js] +// however this file is _not_ a module + +//// [foo.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// this file is a module despite having no imports +//// [bar.js] +// however this file is _not_ a module diff --git a/tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node20).symbols new file mode 100644 index 0000000000000..38a5ad1bc4e01 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node20).symbols @@ -0,0 +1,8 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportlessJsModuleDetectionAuto.ts] //// + +=== foo.cjs === + +// this file is a module despite having no imports +=== bar.js === + +// however this file is _not_ a module diff --git a/tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node20).types new file mode 100644 index 0000000000000..38a5ad1bc4e01 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node20).types @@ -0,0 +1,8 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportlessJsModuleDetectionAuto.ts] //// + +=== foo.cjs === + +// this file is a module despite having no imports +=== bar.js === + +// however this file is _not_ a module diff --git a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node20).errors.txt new file mode 100644 index 0000000000000..1a2f05e108cc8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node20).errors.txt @@ -0,0 +1,38 @@ +subfolder/index.js(2,10): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. +subfolder/index.js(3,7): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. +subfolder/index.js(4,7): error TS2725: Class name cannot be 'Object' when targeting ES5 with module Node20. +subfolder/index.js(5,14): error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. + + +==== subfolder/index.js (4 errors) ==== + // cjs format file + function require() {} + ~~~~~~~ +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. + const exports = {}; + ~~~~~~~ +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. + class Object {} + ~~~~~~ +!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module Node20. + export const __esModule = false; + ~~~~~~~~~~ +!!! error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. + export {require, exports, Object}; +==== index.js (0 errors) ==== + // esm format file + function require() {} + const exports = {}; + class Object {} + export const __esModule = false; + export {require, exports, Object}; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node20).js new file mode 100644 index 0000000000000..30926a25ccde1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node20).js @@ -0,0 +1,62 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsGeneratedNameCollisions.ts] //// + +//// [index.js] +// cjs format file +function require() {} +const exports = {}; +class Object {} +export const __esModule = false; +export {require, exports, Object}; +//// [index.js] +// esm format file +function require() {} +const exports = {}; +class Object {} +export const __esModule = false; +export {require, exports, Object}; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Object = exports.exports = exports.__esModule = void 0; +exports.require = require; +// cjs format file +function require() { } +const exports = {}; +exports.exports = exports; +class Object { +} +exports.Object = Object; +exports.__esModule = false; +//// [index.js] +// esm format file +function require() { } +const exports = {}; +class Object { +} +export const __esModule = false; +export { require, exports, Object }; + + +//// [index.d.ts] +export const __esModule: false; +export function require(): void; +export const exports: {}; +export class Object { +} +//// [index.d.ts] +export const __esModule: false; +export function require(): void; +export const exports: {}; +export class Object { +} diff --git a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node20).symbols new file mode 100644 index 0000000000000..f68efe37918e7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node20).symbols @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsGeneratedNameCollisions.ts] //// + +=== subfolder/index.js === +// cjs format file +function require() {} +>require : Symbol(require, Decl(index.js, 0, 0)) + +const exports = {}; +>exports : Symbol(exports, Decl(index.js, 2, 5)) + +class Object {} +>Object : Symbol(Object, Decl(index.js, 2, 19)) + +export const __esModule = false; +>__esModule : Symbol(__esModule, Decl(index.js, 4, 12)) + +export {require, exports, Object}; +>require : Symbol(require, Decl(index.js, 5, 8)) +>exports : Symbol(exports, Decl(index.js, 5, 16)) +>Object : Symbol(Object, Decl(index.js, 5, 25)) + +=== index.js === +// esm format file +function require() {} +>require : Symbol(require, Decl(index.js, 0, 0)) + +const exports = {}; +>exports : Symbol(exports, Decl(index.js, 2, 5)) + +class Object {} +>Object : Symbol(Object, Decl(index.js, 2, 19)) + +export const __esModule = false; +>__esModule : Symbol(__esModule, Decl(index.js, 4, 12)) + +export {require, exports, Object}; +>require : Symbol(require, Decl(index.js, 5, 8)) +>exports : Symbol(exports, Decl(index.js, 5, 16)) +>Object : Symbol(Object, Decl(index.js, 5, 25)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node20).types new file mode 100644 index 0000000000000..fd07e237a77db --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node20).types @@ -0,0 +1,62 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsGeneratedNameCollisions.ts] //// + +=== subfolder/index.js === +// cjs format file +function require() {} +>require : () => void +> : ^^^^^^^^^^ + +const exports = {}; +>exports : {} +> : ^^ +>{} : {} +> : ^^ + +class Object {} +>Object : Object +> : ^^^^^^ + +export const __esModule = false; +>__esModule : false +> : ^^^^^ +>false : false +> : ^^^^^ + +export {require, exports, Object}; +>require : () => void +> : ^^^^^^^^^^ +>exports : {} +> : ^^ +>Object : typeof Object +> : ^^^^^^^^^^^^^ + +=== index.js === +// esm format file +function require() {} +>require : () => void +> : ^^^^^^^^^^ + +const exports = {}; +>exports : {} +> : ^^ +>{} : {} +> : ^^ + +class Object {} +>Object : Object +> : ^^^^^^ + +export const __esModule = false; +>__esModule : false +> : ^^^^^ +>false : false +> : ^^^^^ + +export {require, exports, Object}; +>require : () => void +> : ^^^^^^^^^^ +>exports : {} +> : ^^ +>Object : typeof Object +> : ^^^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node20).errors.txt new file mode 100644 index 0000000000000..476c47f703e37 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node20).errors.txt @@ -0,0 +1,49 @@ +file.js(4,1): error TS8002: 'import ... =' can only be used in TypeScript files. +file.js(6,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(2,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(4,1): error TS8002: 'import ... =' can only be used in TypeScript files. +subfolder/index.js(2,1): error TS8002: 'import ... =' can only be used in TypeScript files. +subfolder/index.js(4,1): error TS8002: 'import ... =' can only be used in TypeScript files. + + +==== subfolder/index.js (2 errors) ==== + // cjs format file + import fs = require("fs"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + fs.readFile; + export import fs2 = require("fs"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. +==== index.js (2 errors) ==== + // esm format file + import fs = require("fs"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + fs.readFile; + export import fs2 = require("fs"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. +==== file.js (2 errors) ==== + // esm format file + const __require = null; + const _createRequire = null; + import fs = require("fs"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + fs.readFile; + export import fs2 = require("fs"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== types.d.ts (0 errors) ==== + declare module "fs"; \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node20).js new file mode 100644 index 0000000000000..ee161c309e871 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node20).js @@ -0,0 +1,65 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportAssignment.ts] //// + +//// [index.js] +// cjs format file +import fs = require("fs"); +fs.readFile; +export import fs2 = require("fs"); +//// [index.js] +// esm format file +import fs = require("fs"); +fs.readFile; +export import fs2 = require("fs"); +//// [file.js] +// esm format file +const __require = null; +const _createRequire = null; +import fs = require("fs"); +fs.readFile; +export import fs2 = require("fs"); +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const fs = require("fs"); +fs.readFile; +exports.fs2 = require("fs"); +//// [index.js] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +// esm format file +const fs = __require("fs"); +fs.readFile; +const fs2 = __require("fs"); +export { fs2 }; +//// [file.js] +import { createRequire as _createRequire_1 } from "module"; +const __require_1 = _createRequire_1(import.meta.url); +// esm format file +const __require = null; +const _createRequire = null; +const fs = __require_1("fs"); +fs.readFile; +const fs2 = __require_1("fs"); +export { fs2 }; + + +//// [index.d.ts] +import fs2 = require("fs"); +//// [index.d.ts] +import fs2 = require("fs"); +//// [file.d.ts] +import fs2 = require("fs"); diff --git a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node20).symbols new file mode 100644 index 0000000000000..6ceddec39de76 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node20).symbols @@ -0,0 +1,45 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportAssignment.ts] //// + +=== subfolder/index.js === +// cjs format file +import fs = require("fs"); +>fs : Symbol(fs, Decl(index.js, 0, 0)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.js, 0, 0)) + +export import fs2 = require("fs"); +>fs2 : Symbol(fs2, Decl(index.js, 2, 12)) + +=== index.js === +// esm format file +import fs = require("fs"); +>fs : Symbol(fs, Decl(index.js, 0, 0)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.js, 0, 0)) + +export import fs2 = require("fs"); +>fs2 : Symbol(fs2, Decl(index.js, 2, 12)) + +=== file.js === +// esm format file +const __require = null; +>__require : Symbol(__require, Decl(file.js, 1, 5)) + +const _createRequire = null; +>_createRequire : Symbol(_createRequire, Decl(file.js, 2, 5)) + +import fs = require("fs"); +>fs : Symbol(fs, Decl(file.js, 2, 28)) + +fs.readFile; +>fs : Symbol(fs, Decl(file.js, 2, 28)) + +export import fs2 = require("fs"); +>fs2 : Symbol(fs2, Decl(file.js, 4, 12)) + +=== types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node20).types new file mode 100644 index 0000000000000..daea59c9155d4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node20).types @@ -0,0 +1,69 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportAssignment.ts] //// + +=== subfolder/index.js === +// cjs format file +import fs = require("fs"); +>fs : any +> : ^^^ + +fs.readFile; +>fs.readFile : any +> : ^^^ +>fs : any +> : ^^^ +>readFile : any +> : ^^^ + +export import fs2 = require("fs"); +>fs2 : any +> : ^^^ + +=== index.js === +// esm format file +import fs = require("fs"); +>fs : any +> : ^^^ + +fs.readFile; +>fs.readFile : any +> : ^^^ +>fs : any +> : ^^^ +>readFile : any +> : ^^^ + +export import fs2 = require("fs"); +>fs2 : any +> : ^^^ + +=== file.js === +// esm format file +const __require = null; +>__require : any +> : ^^^ + +const _createRequire = null; +>_createRequire : any +> : ^^^ + +import fs = require("fs"); +>fs : any +> : ^^^ + +fs.readFile; +>fs.readFile : any +> : ^^^ +>fs : any +> : ^^^ +>readFile : any +> : ^^^ + +export import fs2 = require("fs"); +>fs2 : any +> : ^^^ + +=== types.d.ts === +declare module "fs"; +>"fs" : any +> : ^^^ + diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node20).errors.txt new file mode 100644 index 0000000000000..17c99081b2e70 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node20).errors.txt @@ -0,0 +1,36 @@ +subfolder/index.js(2,9): error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. +subfolder/index.js(4,1): error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + + +==== subfolder/index.js (2 errors) ==== + // cjs format file + import {default as _fs} from "fs"; + ~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + _fs.readFile; + import * as fs from "fs"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + fs.readFile; +==== index.js (0 errors) ==== + // esm format file + import {default as _fs} from "fs"; + _fs.readFile; + import * as fs from "fs"; + fs.readFile; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== types.d.ts (0 errors) ==== + declare module "fs"; + declare module "tslib" { + export {}; + // intentionally missing all helpers + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node20).js new file mode 100644 index 0000000000000..a30d220227f20 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node20).js @@ -0,0 +1,52 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions1.ts] //// + +//// [index.js] +// cjs format file +import {default as _fs} from "fs"; +_fs.readFile; +import * as fs from "fs"; +fs.readFile; +//// [index.js] +// esm format file +import {default as _fs} from "fs"; +_fs.readFile; +import * as fs from "fs"; +fs.readFile; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; +declare module "tslib" { + export {}; + // intentionally missing all helpers +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +// cjs format file +const fs_1 = tslib_1.__importDefault(require("fs")); +fs_1.default.readFile; +const fs = tslib_1.__importStar(require("fs")); +fs.readFile; +//// [index.js] +// esm format file +import { default as _fs } from "fs"; +_fs.readFile; +import * as fs from "fs"; +fs.readFile; + + +//// [index.d.ts] +export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node20).symbols new file mode 100644 index 0000000000000..223fb64bb63dd --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node20).symbols @@ -0,0 +1,42 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions1.ts] //// + +=== subfolder/index.js === +// cjs format file +import {default as _fs} from "fs"; +>default : Symbol(_fs, Decl(types.d.ts, 0, 0)) +>_fs : Symbol(_fs, Decl(index.js, 1, 8)) + +_fs.readFile; +>_fs : Symbol(_fs, Decl(index.js, 1, 8)) + +import * as fs from "fs"; +>fs : Symbol(fs, Decl(index.js, 3, 6)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.js, 3, 6)) + +=== index.js === +// esm format file +import {default as _fs} from "fs"; +>default : Symbol(_fs, Decl(types.d.ts, 0, 0)) +>_fs : Symbol(_fs, Decl(index.js, 1, 8)) + +_fs.readFile; +>_fs : Symbol(_fs, Decl(index.js, 1, 8)) + +import * as fs from "fs"; +>fs : Symbol(fs, Decl(index.js, 3, 6)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.js, 3, 6)) + +=== types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + +declare module "tslib" { +>"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node20).types new file mode 100644 index 0000000000000..b9184a9515937 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node20).types @@ -0,0 +1,70 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions1.ts] //// + +=== subfolder/index.js === +// cjs format file +import {default as _fs} from "fs"; +>default : any +> : ^^^ +>_fs : any +> : ^^^ + +_fs.readFile; +>_fs.readFile : any +> : ^^^ +>_fs : any +> : ^^^ +>readFile : any +> : ^^^ + +import * as fs from "fs"; +>fs : any +> : ^^^ + +fs.readFile; +>fs.readFile : any +> : ^^^ +>fs : any +> : ^^^ +>readFile : any +> : ^^^ + +=== index.js === +// esm format file +import {default as _fs} from "fs"; +>default : any +> : ^^^ +>_fs : any +> : ^^^ + +_fs.readFile; +>_fs.readFile : any +> : ^^^ +>_fs : any +> : ^^^ +>readFile : any +> : ^^^ + +import * as fs from "fs"; +>fs : any +> : ^^^ + +fs.readFile; +>fs.readFile : any +> : ^^^ +>fs : any +> : ^^^ +>readFile : any +> : ^^^ + +=== types.d.ts === +declare module "fs"; +>"fs" : any +> : ^^^ + +declare module "tslib" { +>"tslib" : typeof import("tslib") +> : ^^^^^^^^^^^^^^^^^^^^^^ + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node20).errors.txt new file mode 100644 index 0000000000000..78bd927d81fe8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node20).errors.txt @@ -0,0 +1,32 @@ +subfolder/index.ts(2,1): error TS2343: This syntax requires an imported helper named '__exportStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. +subfolder/index.ts(3,1): error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + + +==== subfolder/index.ts (2 errors) ==== + // cjs format file + export * from "fs"; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__exportStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + export * as fs from "fs"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. +==== index.js (0 errors) ==== + // esm format file + export * from "fs"; + export * as fs from "fs"; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== types.d.ts (0 errors) ==== + declare module "fs"; + declare module "tslib" { + export {}; + // intentionally missing all helpers + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node20).js new file mode 100644 index 0000000000000..1960ba0103e95 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node20).js @@ -0,0 +1,47 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions2.ts] //// + +//// [index.ts] +// cjs format file +export * from "fs"; +export * as fs from "fs"; +//// [index.js] +// esm format file +export * from "fs"; +export * as fs from "fs"; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; +declare module "tslib" { + export {}; + // intentionally missing all helpers +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fs = void 0; +const tslib_1 = require("tslib"); +// cjs format file +tslib_1.__exportStar(require("fs"), exports); +exports.fs = tslib_1.__importStar(require("fs")); +//// [index.js] +// esm format file +export * from "fs"; +export * as fs from "fs"; + + +//// [index.d.ts] +export * from "fs"; +export * as fs from "fs"; +//// [index.d.ts] +export * from "fs"; +export * as fs from "fs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node20).symbols new file mode 100644 index 0000000000000..f8442eecea2a9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node20).symbols @@ -0,0 +1,24 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions2.ts] //// + +=== subfolder/index.ts === +// cjs format file +export * from "fs"; +export * as fs from "fs"; +>fs : Symbol(fs, Decl(index.ts, 2, 6)) + +=== index.js === +// esm format file +export * from "fs"; +export * as fs from "fs"; +>fs : Symbol(fs, Decl(index.js, 2, 6)) + +=== types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + +declare module "tslib" { +>"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node20).types new file mode 100644 index 0000000000000..f27b3f021b897 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node20).types @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions2.ts] //// + +=== subfolder/index.ts === +// cjs format file +export * from "fs"; +export * as fs from "fs"; +>fs : any +> : ^^^ + +=== index.js === +// esm format file +export * from "fs"; +export * as fs from "fs"; +>fs : any +> : ^^^ + +=== types.d.ts === +declare module "fs"; +>"fs" : any +> : ^^^ + +declare module "tslib" { +>"tslib" : typeof import("tslib") +> : ^^^^^^^^^^^^^^^^^^^^^^ + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node20).errors.txt new file mode 100644 index 0000000000000..f1e751aeb0f1f --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node20).errors.txt @@ -0,0 +1,31 @@ +subfolder/index.js(2,9): error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + + +==== subfolder/index.js (1 errors) ==== + // cjs format file + export {default} from "fs"; + ~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + export {default as foo} from "fs"; + export {bar as baz} from "fs"; +==== index.js (0 errors) ==== + // esm format file + export {default} from "fs"; + export {default as foo} from "fs"; + export {bar as baz} from "fs"; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== types.d.ts (0 errors) ==== + declare module "fs"; + declare module "tslib" { + export {}; + // intentionally missing all helpers + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node20).js new file mode 100644 index 0000000000000..8fefc3d2d6b56 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node20).js @@ -0,0 +1,52 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions3.ts] //// + +//// [index.js] +// cjs format file +export {default} from "fs"; +export {default as foo} from "fs"; +export {bar as baz} from "fs"; +//// [index.js] +// esm format file +export {default} from "fs"; +export {default as foo} from "fs"; +export {bar as baz} from "fs"; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; +declare module "tslib" { + export {}; + // intentionally missing all helpers +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.baz = exports.foo = exports.default = void 0; +var tslib_1 = require("tslib"); +// cjs format file +var fs_1 = require("fs"); +Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(fs_1).default; } }); +var fs_2 = require("fs"); +Object.defineProperty(exports, "foo", { enumerable: true, get: function () { return tslib_1.__importDefault(fs_2).default; } }); +var fs_3 = require("fs"); +Object.defineProperty(exports, "baz", { enumerable: true, get: function () { return fs_3.bar; } }); +//// [index.js] +// esm format file +export { default } from "fs"; +export { default as foo } from "fs"; +export { bar as baz } from "fs"; + + +//// [index.d.ts] +export { default, default as foo, bar as baz } from "fs"; +//// [index.d.ts] +export { default, default as foo, bar as baz } from "fs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node20).symbols new file mode 100644 index 0000000000000..ac8f12eb28526 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node20).symbols @@ -0,0 +1,38 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions3.ts] //// + +=== subfolder/index.js === +// cjs format file +export {default} from "fs"; +>default : Symbol(default, Decl(index.js, 1, 8)) + +export {default as foo} from "fs"; +>default : Symbol("fs", Decl(types.d.ts, 0, 0)) +>foo : Symbol(foo, Decl(index.js, 2, 8)) + +export {bar as baz} from "fs"; +>bar : Symbol("fs", Decl(types.d.ts, 0, 0)) +>baz : Symbol(baz, Decl(index.js, 3, 8)) + +=== index.js === +// esm format file +export {default} from "fs"; +>default : Symbol(default, Decl(index.js, 1, 8)) + +export {default as foo} from "fs"; +>default : Symbol("fs", Decl(types.d.ts, 0, 0)) +>foo : Symbol(foo, Decl(index.js, 2, 8)) + +export {bar as baz} from "fs"; +>bar : Symbol("fs", Decl(types.d.ts, 0, 0)) +>baz : Symbol(baz, Decl(index.js, 3, 8)) + +=== types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + +declare module "tslib" { +>"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node20).types new file mode 100644 index 0000000000000..f610358647cd1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node20).types @@ -0,0 +1,50 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions3.ts] //// + +=== subfolder/index.js === +// cjs format file +export {default} from "fs"; +>default : any +> : ^^^ + +export {default as foo} from "fs"; +>default : any +> : ^^^ +>foo : any +> : ^^^ + +export {bar as baz} from "fs"; +>bar : any +> : ^^^ +>baz : any +> : ^^^ + +=== index.js === +// esm format file +export {default} from "fs"; +>default : any +> : ^^^ + +export {default as foo} from "fs"; +>default : any +> : ^^^ +>foo : any +> : ^^^ + +export {bar as baz} from "fs"; +>bar : any +> : ^^^ +>baz : any +> : ^^^ + +=== types.d.ts === +declare module "fs"; +>"fs" : any +> : ^^^ + +declare module "tslib" { +>"tslib" : typeof import("tslib") +> : ^^^^^^^^^^^^^^^^^^^^^^ + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node20).errors.txt new file mode 100644 index 0000000000000..28110ed339d18 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node20).errors.txt @@ -0,0 +1,23 @@ +subfolder/index.js(2,11): error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. + + +==== subfolder/index.js (1 errors) ==== + // cjs format file + const x = import.meta.url; + ~~~~~~~~~~~ +!!! error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. + export {x}; +==== index.js (0 errors) ==== + // esm format file + const x = import.meta.url; + export {x}; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node20).js new file mode 100644 index 0000000000000..7e6d01b7daf2a --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node20).js @@ -0,0 +1,38 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportMeta.ts] //// + +//// [index.js] +// cjs format file +const x = import.meta.url; +export {x}; +//// [index.js] +// esm format file +const x = import.meta.url; +export {x}; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = import.meta.url; +exports.x = x; +//// [index.js] +// esm format file +const x = import.meta.url; +export { x }; + + +//// [index.d.ts] +export const x: string; +//// [index.d.ts] +export const x: string; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node20).symbols new file mode 100644 index 0000000000000..b5fd6d2a740db --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node20).symbols @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportMeta.ts] //// + +=== subfolder/index.js === +// cjs format file +const x = import.meta.url; +>x : Symbol(x, Decl(index.js, 1, 5)) +>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) +>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) +>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) + +export {x}; +>x : Symbol(x, Decl(index.js, 2, 8)) + +=== index.js === +// esm format file +const x = import.meta.url; +>x : Symbol(x, Decl(index.js, 1, 5)) +>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) +>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) +>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) + +export {x}; +>x : Symbol(x, Decl(index.js, 2, 8)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node20).types new file mode 100644 index 0000000000000..c4fb0b6d2595f --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node20).types @@ -0,0 +1,38 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportMeta.ts] //// + +=== subfolder/index.js === +// cjs format file +const x = import.meta.url; +>x : string +> : ^^^^^^ +>import.meta.url : string +> : ^^^^^^ +>import.meta : ImportMeta +> : ^^^^^^^^^^ +>meta : ImportMeta +> : ^^^^^^^^^^ +>url : string +> : ^^^^^^ + +export {x}; +>x : string +> : ^^^^^^ + +=== index.js === +// esm format file +const x = import.meta.url; +>x : string +> : ^^^^^^ +>import.meta.url : string +> : ^^^^^^ +>import.meta : ImportMeta +> : ^^^^^^^^^^ +>meta : ImportMeta +> : ^^^^^^^^^^ +>url : string +> : ^^^^^^ + +export {x}; +>x : string +> : ^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node20).errors.txt new file mode 100644 index 0000000000000..36f24f2759974 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node20).errors.txt @@ -0,0 +1,94 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. + + +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. +==== index.js (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + import * as typei from "inner"; + cjsi; + mjsi; + typei; +==== index.mjs (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + import * as typei from "inner"; + cjsi; + mjsi; + typei; +==== index.cjs (0 errors) ==== + // cjs format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + import * as typei from "inner"; + cjsi; + mjsi; + typei; +==== node_modules/inner/index.d.ts (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/mjs"; + import * as type from "inner"; + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + import * as type from "inner"; + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/index.d.cts (0 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + import * as type from "inner"; + export { cjs }; + export { mjs }; + export { type }; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node20).js new file mode 100644 index 0000000000000..208b7a1a36fde --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node20).js @@ -0,0 +1,175 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageExports.ts] //// + +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.cjs] +// cjs format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +export { cjs }; +export { mjs }; +export { type }; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} + +//// [index.mjs] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjs = __importStar(require("package/cjs")); +const mjs = __importStar(require("package/mjs")); +const type = __importStar(require("package")); +cjs; +mjs; +type; +const cjsi = __importStar(require("inner/cjs")); +const mjsi = __importStar(require("inner/mjs")); +const typei = __importStar(require("inner")); +cjsi; +mjsi; +typei; +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; + + +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node20).symbols new file mode 100644 index 0000000000000..9fe0e570a7061 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node20).symbols @@ -0,0 +1,176 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageExports.ts] //// + +=== index.js === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.js, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.js, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.js, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.js, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.js, 2, 6)) + +type; +>type : Symbol(type, Decl(index.js, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.js, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.js, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.js, 9, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.js, 7, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.js, 8, 6)) + +typei; +>typei : Symbol(typei, Decl(index.js, 9, 6)) + +=== index.mjs === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.mjs, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) + +type; +>type : Symbol(type, Decl(index.mjs, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.mjs, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.mjs, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.mjs, 9, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.mjs, 7, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.mjs, 8, 6)) + +typei; +>typei : Symbol(typei, Decl(index.mjs, 9, 6)) + +=== index.cjs === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.cjs, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) + +type; +>type : Symbol(type, Decl(index.cjs, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.cjs, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.cjs, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.cjs, 9, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.cjs, 7, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.cjs, 8, 6)) + +typei; +>typei : Symbol(typei, Decl(index.cjs, 9, 6)) + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) + +export { type }; +>type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) + +export { type }; +>type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node20).types new file mode 100644 index 0000000000000..4a54afca62898 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node20).types @@ -0,0 +1,230 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageExports.ts] //// + +=== index.js === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "package/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "package"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs"; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +import * as typei from "inner"; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +typei; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +=== index.mjs === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "package/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "package"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs"; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +import * as typei from "inner"; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +typei; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +=== index.cjs === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "package/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "package"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs"; +>mjsi : typeof cjsi.mjs +> : ^^^^^^^^^^^^^^^ + +import * as typei from "inner"; +>typei : typeof cjsi.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.mjs +> : ^^^^^^^^^^^^^^^ + +typei; +>typei : typeof cjsi.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "inner"; +>type : typeof mjs.cjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +export { type }; +>type : typeof mjs.cjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs"; +>mjs : typeof cjs.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^ + +import * as type from "inner"; +>type : typeof cjs.cjs.mjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^ + +export { type }; +>type : typeof cjs.cjs.mjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs"; +>mjs : typeof cjs.mjs +> : ^^^^^^^^^^^^^^ + +import * as type from "inner"; +>type : typeof cjs.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs.mjs +> : ^^^^^^^^^^^^^^ + +export { type }; +>type : typeof cjs.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node20).errors.txt new file mode 100644 index 0000000000000..ebcc53aeb3f1a --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node20).errors.txt @@ -0,0 +1,40 @@ +error TS2210: The project root is ambiguous, but is required to resolve import map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. + + +!!! error TS2210: The project root is ambiguous, but is required to resolve import map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. +==== index.js (0 errors) ==== + // esm format file + import * as cjs from "#cjs"; + import * as mjs from "#mjs"; + import * as type from "#type"; + cjs; + mjs; + type; +==== index.mjs (0 errors) ==== + // esm format file + import * as cjs from "#cjs"; + import * as mjs from "#mjs"; + import * as type from "#type"; + cjs; + mjs; + type; +==== index.cjs (0 errors) ==== + // esm format file + import * as cjs from "#cjs"; + import * as mjs from "#mjs"; + import * as type from "#type"; + cjs; + mjs; + type; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js", + "imports": { + "#cjs": "./index.cjs", + "#mjs": "./index.mjs", + "#type": "./index.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node20).js new file mode 100644 index 0000000000000..510e6b7128c79 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node20).js @@ -0,0 +1,106 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageImports.ts] //// + +//// [index.js] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [index.mjs] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [index.cjs] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js", + "imports": { + "#cjs": "./index.cjs", + "#mjs": "./index.mjs", + "#type": "./index.js" + } +} + +//// [index.mjs] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// esm format file +const cjs = __importStar(require("#cjs")); +const mjs = __importStar(require("#mjs")); +const type = __importStar(require("#type")); +cjs; +mjs; +type; +//// [index.js] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; + + +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node20).symbols new file mode 100644 index 0000000000000..356904544fb5d --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node20).symbols @@ -0,0 +1,62 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageImports.ts] //// + +=== index.js === +// esm format file +import * as cjs from "#cjs"; +>cjs : Symbol(cjs, Decl(index.js, 1, 6)) + +import * as mjs from "#mjs"; +>mjs : Symbol(mjs, Decl(index.js, 2, 6)) + +import * as type from "#type"; +>type : Symbol(type, Decl(index.js, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.js, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.js, 2, 6)) + +type; +>type : Symbol(type, Decl(index.js, 3, 6)) + +=== index.mjs === +// esm format file +import * as cjs from "#cjs"; +>cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) + +import * as mjs from "#mjs"; +>mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) + +import * as type from "#type"; +>type : Symbol(type, Decl(index.mjs, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) + +type; +>type : Symbol(type, Decl(index.mjs, 3, 6)) + +=== index.cjs === +// esm format file +import * as cjs from "#cjs"; +>cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) + +import * as mjs from "#mjs"; +>mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) + +import * as type from "#type"; +>type : Symbol(type, Decl(index.cjs, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) + +type; +>type : Symbol(type, Decl(index.cjs, 3, 6)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node20).types new file mode 100644 index 0000000000000..4557791be394f --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node20).types @@ -0,0 +1,80 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageImports.ts] //// + +=== index.js === +// esm format file +import * as cjs from "#cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "#mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "#type"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +=== index.mjs === +// esm format file +import * as cjs from "#cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "#mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "#type"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +=== index.cjs === +// esm format file +import * as cjs from "#cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "#mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "#type"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node20).errors.txt new file mode 100644 index 0000000000000..ec89adcd2ffb3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node20).errors.txt @@ -0,0 +1,69 @@ +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. + + +==== index.js (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index"; + import * as mjsi from "inner/mjs/index"; + import * as typei from "inner/js/index"; + cjsi; + mjsi; + typei; +==== index.mjs (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index"; + import * as mjsi from "inner/mjs/index"; + import * as typei from "inner/js/index"; + cjsi; + mjsi; + typei; +==== index.cjs (0 errors) ==== + // cjs format file + import * as cjsi from "inner/cjs/index"; + import * as mjsi from "inner/mjs/index"; + import * as typei from "inner/js/index"; + cjsi; + mjsi; + typei; +==== node_modules/inner/index.d.ts (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/mjs/index"; + import * as type from "inner/js/index"; + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + import * as cjs from "inner/cjs/index"; + import * as mjs from "inner/mjs/index"; + import * as type from "inner/js/index"; + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/index.d.cts (0 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index"; + import * as mjs from "inner/mjs/index"; + import * as type from "inner/js/index"; + export { cjs }; + export { mjs }; + export { type }; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs/*": "./*.cjs", + "./mjs/*": "./*.mjs", + "./js/*": "./*.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node20).js new file mode 100644 index 0000000000000..79669dc7d4da8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node20).js @@ -0,0 +1,134 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts] //// + +//// [index.js] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.cjs] +// cjs format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs/index"; +import * as mjs from "inner/mjs/index"; +import * as type from "inner/js/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs/index"; +import * as mjs from "inner/mjs/index"; +import * as type from "inner/js/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs/index"; +import * as mjs from "inner/mjs/index"; +import * as type from "inner/js/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs/*": "./*.cjs", + "./mjs/*": "./*.mjs", + "./js/*": "./*.js" + } +} + +//// [index.js] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjsi = __importStar(require("inner/cjs/index")); +const mjsi = __importStar(require("inner/mjs/index")); +const typei = __importStar(require("inner/js/index")); +cjsi; +mjsi; +typei; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node20).symbols new file mode 100644 index 0000000000000..d6dea7356d738 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node20).symbols @@ -0,0 +1,122 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts] //// + +=== index.js === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : Symbol(cjsi, Decl(index.js, 1, 6)) + +import * as mjsi from "inner/mjs/index"; +>mjsi : Symbol(mjsi, Decl(index.js, 2, 6)) + +import * as typei from "inner/js/index"; +>typei : Symbol(typei, Decl(index.js, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.js, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.js, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.js, 3, 6)) + +=== index.mjs === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : Symbol(cjsi, Decl(index.mjs, 1, 6)) + +import * as mjsi from "inner/mjs/index"; +>mjsi : Symbol(mjsi, Decl(index.mjs, 2, 6)) + +import * as typei from "inner/js/index"; +>typei : Symbol(typei, Decl(index.mjs, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.mjs, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.mjs, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.mjs, 3, 6)) + +=== index.cjs === +// cjs format file +import * as cjsi from "inner/cjs/index"; +>cjsi : Symbol(cjsi, Decl(index.cjs, 1, 6)) + +import * as mjsi from "inner/mjs/index"; +>mjsi : Symbol(mjsi, Decl(index.cjs, 2, 6)) + +import * as typei from "inner/js/index"; +>typei : Symbol(typei, Decl(index.cjs, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.cjs, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.cjs, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.cjs, 3, 6)) + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs/index"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner/js/index"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) + +export { type }; +>type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs/index"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner/js/index"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) + +export { type }; +>type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs/index"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner/js/index"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node20).types new file mode 100644 index 0000000000000..ab36a515a18bd --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node20).types @@ -0,0 +1,158 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts] //// + +=== index.js === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs/index"; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +import * as typei from "inner/js/index"; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +typei; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +=== index.mjs === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs/index"; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +import * as typei from "inner/js/index"; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +typei; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +=== index.cjs === +// cjs format file +import * as cjsi from "inner/cjs/index"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs/index"; +>mjsi : typeof cjsi.mjs +> : ^^^^^^^^^^^^^^^ + +import * as typei from "inner/js/index"; +>typei : typeof cjsi.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.mjs +> : ^^^^^^^^^^^^^^^ + +typei; +>typei : typeof cjsi.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/mjs/index"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "inner/js/index"; +>type : typeof mjs.cjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +export { type }; +>type : typeof mjs.cjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs/index"; +>mjs : typeof cjs.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^ + +import * as type from "inner/js/index"; +>type : typeof cjs.cjs.mjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^ + +export { type }; +>type : typeof cjs.cjs.mjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs/index"; +>mjs : typeof cjs.mjs +> : ^^^^^^^^^^^^^^ + +import * as type from "inner/js/index"; +>type : typeof cjs.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs.mjs +> : ^^^^^^^^^^^^^^ + +export { type }; +>type : typeof cjs.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node20).errors.txt new file mode 100644 index 0000000000000..44e51033d1cc7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node20).errors.txt @@ -0,0 +1,123 @@ +index.cjs(2,23): error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. +index.cjs(3,23): error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. +index.cjs(4,24): error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. +index.js(2,23): error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. +index.js(3,23): error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. +index.js(4,24): error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. +index.mjs(2,23): error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. +index.mjs(3,23): error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. +index.mjs(4,24): error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.cts(2,22): error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.cts(3,22): error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.cts(4,23): error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.mts(2,22): error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.mts(3,22): error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.mts(4,23): error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.ts(2,22): error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.ts(3,22): error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.ts(4,23): error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. + + +==== index.js (3 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. + import * as mjsi from "inner/mjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. + import * as typei from "inner/js/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. + cjsi; + mjsi; + typei; +==== index.mjs (3 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. + import * as mjsi from "inner/mjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. + import * as typei from "inner/js/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. + cjsi; + mjsi; + typei; +==== index.cjs (3 errors) ==== + // cjs format file + import * as cjsi from "inner/cjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. + import * as mjsi from "inner/mjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. + import * as typei from "inner/js/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. + cjsi; + mjsi; + typei; +==== node_modules/inner/exclude/index.d.ts (3 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. + import * as mjs from "inner/mjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. + import * as type from "inner/js/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/exclude/index.d.mts (3 errors) ==== + // esm format file + import * as cjs from "inner/cjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. + import * as mjs from "inner/mjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. + import * as type from "inner/js/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/exclude/index.d.cts (3 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. + import * as mjs from "inner/mjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. + import * as type from "inner/js/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. + export { cjs }; + export { mjs }; + export { type }; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs/*": "./*.cjs", + "./cjs/exclude/*": null, + "./mjs/*": "./*.mjs", + "./mjs/exclude/*": null, + "./js/*": "./*.js", + "./js/exclude/*": null + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node20).js new file mode 100644 index 0000000000000..3ba5fbbce0406 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node20).js @@ -0,0 +1,137 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsExclude.ts] //// + +//// [index.js] +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +import * as mjsi from "inner/mjs/exclude/index"; +import * as typei from "inner/js/exclude/index"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +import * as mjsi from "inner/mjs/exclude/index"; +import * as typei from "inner/js/exclude/index"; +cjsi; +mjsi; +typei; +//// [index.cjs] +// cjs format file +import * as cjsi from "inner/cjs/exclude/index"; +import * as mjsi from "inner/mjs/exclude/index"; +import * as typei from "inner/js/exclude/index"; +cjsi; +mjsi; +typei; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs/exclude/index"; +import * as mjs from "inner/mjs/exclude/index"; +import * as type from "inner/js/exclude/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs/exclude/index"; +import * as mjs from "inner/mjs/exclude/index"; +import * as type from "inner/js/exclude/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs/exclude/index"; +import * as mjs from "inner/mjs/exclude/index"; +import * as type from "inner/js/exclude/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs/*": "./*.cjs", + "./cjs/exclude/*": null, + "./mjs/*": "./*.mjs", + "./mjs/exclude/*": null, + "./js/*": "./*.js", + "./js/exclude/*": null + } +} + +//// [index.js] +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +import * as mjsi from "inner/mjs/exclude/index"; +import * as typei from "inner/js/exclude/index"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +import * as mjsi from "inner/mjs/exclude/index"; +import * as typei from "inner/js/exclude/index"; +cjsi; +mjsi; +typei; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjsi = __importStar(require("inner/cjs/exclude/index")); +const mjsi = __importStar(require("inner/mjs/exclude/index")); +const typei = __importStar(require("inner/js/exclude/index")); +cjsi; +mjsi; +typei; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node20).symbols new file mode 100644 index 0000000000000..53db76dc4d204 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node20).symbols @@ -0,0 +1,122 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsExclude.ts] //// + +=== index.js === +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +>cjsi : Symbol(cjsi, Decl(index.js, 1, 6)) + +import * as mjsi from "inner/mjs/exclude/index"; +>mjsi : Symbol(mjsi, Decl(index.js, 2, 6)) + +import * as typei from "inner/js/exclude/index"; +>typei : Symbol(typei, Decl(index.js, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.js, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.js, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.js, 3, 6)) + +=== index.mjs === +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +>cjsi : Symbol(cjsi, Decl(index.mjs, 1, 6)) + +import * as mjsi from "inner/mjs/exclude/index"; +>mjsi : Symbol(mjsi, Decl(index.mjs, 2, 6)) + +import * as typei from "inner/js/exclude/index"; +>typei : Symbol(typei, Decl(index.mjs, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.mjs, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.mjs, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.mjs, 3, 6)) + +=== index.cjs === +// cjs format file +import * as cjsi from "inner/cjs/exclude/index"; +>cjsi : Symbol(cjsi, Decl(index.cjs, 1, 6)) + +import * as mjsi from "inner/mjs/exclude/index"; +>mjsi : Symbol(mjsi, Decl(index.cjs, 2, 6)) + +import * as typei from "inner/js/exclude/index"; +>typei : Symbol(typei, Decl(index.cjs, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.cjs, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.cjs, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.cjs, 3, 6)) + +=== node_modules/inner/exclude/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/exclude/index"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs/exclude/index"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner/js/exclude/index"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs, Decl(index.d.ts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs, Decl(index.d.ts, 5, 8)) + +export { type }; +>type : Symbol(type, Decl(index.d.ts, 6, 8)) + +=== node_modules/inner/exclude/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/exclude/index"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs/exclude/index"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner/js/exclude/index"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs, Decl(index.d.mts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs, Decl(index.d.mts, 5, 8)) + +export { type }; +>type : Symbol(type, Decl(index.d.mts, 6, 8)) + +=== node_modules/inner/exclude/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/exclude/index"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs/exclude/index"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner/js/exclude/index"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs, Decl(index.d.cts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs, Decl(index.d.cts, 5, 8)) + +export { type }; +>type : Symbol(type, Decl(index.d.cts, 6, 8)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node20).types new file mode 100644 index 0000000000000..6e33ef99da8fd --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node20).types @@ -0,0 +1,158 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsExclude.ts] //// + +=== index.js === +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +>cjsi : any +> : ^^^ + +import * as mjsi from "inner/mjs/exclude/index"; +>mjsi : any +> : ^^^ + +import * as typei from "inner/js/exclude/index"; +>typei : any +> : ^^^ + +cjsi; +>cjsi : any +> : ^^^ + +mjsi; +>mjsi : any +> : ^^^ + +typei; +>typei : any +> : ^^^ + +=== index.mjs === +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +>cjsi : any +> : ^^^ + +import * as mjsi from "inner/mjs/exclude/index"; +>mjsi : any +> : ^^^ + +import * as typei from "inner/js/exclude/index"; +>typei : any +> : ^^^ + +cjsi; +>cjsi : any +> : ^^^ + +mjsi; +>mjsi : any +> : ^^^ + +typei; +>typei : any +> : ^^^ + +=== index.cjs === +// cjs format file +import * as cjsi from "inner/cjs/exclude/index"; +>cjsi : any +> : ^^^ + +import * as mjsi from "inner/mjs/exclude/index"; +>mjsi : any +> : ^^^ + +import * as typei from "inner/js/exclude/index"; +>typei : any +> : ^^^ + +cjsi; +>cjsi : any +> : ^^^ + +mjsi; +>mjsi : any +> : ^^^ + +typei; +>typei : any +> : ^^^ + +=== node_modules/inner/exclude/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/exclude/index"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/mjs/exclude/index"; +>mjs : any +> : ^^^ + +import * as type from "inner/js/exclude/index"; +>type : any +> : ^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : any +> : ^^^ + +export { type }; +>type : any +> : ^^^ + +=== node_modules/inner/exclude/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/exclude/index"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/mjs/exclude/index"; +>mjs : any +> : ^^^ + +import * as type from "inner/js/exclude/index"; +>type : any +> : ^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : any +> : ^^^ + +export { type }; +>type : any +> : ^^^ + +=== node_modules/inner/exclude/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/exclude/index"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/mjs/exclude/index"; +>mjs : any +> : ^^^ + +import * as type from "inner/js/exclude/index"; +>type : any +> : ^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : any +> : ^^^ + +export { type }; +>type : any +> : ^^^ + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node20).errors.txt new file mode 100644 index 0000000000000..6c025f4ba773b --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node20).errors.txt @@ -0,0 +1,69 @@ +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. + + +==== index.js (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index.cjs"; + import * as mjsi from "inner/mjs/index.mjs"; + import * as typei from "inner/js/index.js"; + cjsi; + mjsi; + typei; +==== index.mjs (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index.cjs"; + import * as mjsi from "inner/mjs/index.mjs"; + import * as typei from "inner/js/index.js"; + cjsi; + mjsi; + typei; +==== index.cjs (0 errors) ==== + // cjs format file + import * as cjsi from "inner/cjs/index.cjs"; + import * as mjsi from "inner/mjs/index.mjs"; + import * as typei from "inner/js/index.js"; + cjsi; + mjsi; + typei; +==== node_modules/inner/index.d.ts (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index.cjs"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/mjs/index.mjs"; + import * as type from "inner/js/index.js"; + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + import * as cjs from "inner/cjs/index.cjs"; + import * as mjs from "inner/mjs/index.mjs"; + import * as type from "inner/js/index.js"; + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/index.d.cts (0 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index.cjs"; + import * as mjs from "inner/mjs/index.mjs"; + import * as type from "inner/js/index.js"; + export { cjs }; + export { mjs }; + export { type }; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs/*.cjs": "./*.cjs", + "./mjs/*.mjs": "./*.mjs", + "./js/*.js": "./*.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node20).js new file mode 100644 index 0000000000000..b23d73a88c0e9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node20).js @@ -0,0 +1,134 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts] //// + +//// [index.js] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.cjs] +// cjs format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +import * as mjs from "inner/mjs/index.mjs"; +import * as type from "inner/js/index.js"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs/index.cjs"; +import * as mjs from "inner/mjs/index.mjs"; +import * as type from "inner/js/index.js"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +import * as mjs from "inner/mjs/index.mjs"; +import * as type from "inner/js/index.js"; +export { cjs }; +export { mjs }; +export { type }; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs/*.cjs": "./*.cjs", + "./mjs/*.mjs": "./*.mjs", + "./js/*.js": "./*.js" + } +} + +//// [index.js] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjsi = __importStar(require("inner/cjs/index.cjs")); +const mjsi = __importStar(require("inner/mjs/index.mjs")); +const typei = __importStar(require("inner/js/index.js")); +cjsi; +mjsi; +typei; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node20).symbols new file mode 100644 index 0000000000000..5dd3851cacbbc --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node20).symbols @@ -0,0 +1,122 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts] //// + +=== index.js === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : Symbol(cjsi, Decl(index.js, 1, 6)) + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : Symbol(mjsi, Decl(index.js, 2, 6)) + +import * as typei from "inner/js/index.js"; +>typei : Symbol(typei, Decl(index.js, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.js, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.js, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.js, 3, 6)) + +=== index.mjs === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : Symbol(cjsi, Decl(index.mjs, 1, 6)) + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : Symbol(mjsi, Decl(index.mjs, 2, 6)) + +import * as typei from "inner/js/index.js"; +>typei : Symbol(typei, Decl(index.mjs, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.mjs, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.mjs, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.mjs, 3, 6)) + +=== index.cjs === +// cjs format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : Symbol(cjsi, Decl(index.cjs, 1, 6)) + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : Symbol(mjsi, Decl(index.cjs, 2, 6)) + +import * as typei from "inner/js/index.js"; +>typei : Symbol(typei, Decl(index.cjs, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.cjs, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.cjs, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.cjs, 3, 6)) + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner/js/index.js"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) + +export { type }; +>type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner/js/index.js"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) + +export { type }; +>type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner/js/index.js"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node20).types new file mode 100644 index 0000000000000..8aec22f2cab84 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node20).types @@ -0,0 +1,158 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts] //// + +=== index.js === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +import * as typei from "inner/js/index.js"; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +typei; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +=== index.mjs === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +import * as typei from "inner/js/index.js"; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +typei; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +=== index.cjs === +// cjs format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : typeof cjsi.mjs +> : ^^^^^^^^^^^^^^^ + +import * as typei from "inner/js/index.js"; +>typei : typeof cjsi.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.mjs +> : ^^^^^^^^^^^^^^^ + +typei; +>typei : typeof cjsi.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "inner/js/index.js"; +>type : typeof mjs.cjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +export { type }; +>type : typeof mjs.cjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : typeof cjs.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^ + +import * as type from "inner/js/index.js"; +>type : typeof cjs.cjs.mjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^ + +export { type }; +>type : typeof cjs.cjs.mjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : typeof cjs.mjs +> : ^^^^^^^^^^^^^^ + +import * as type from "inner/js/index.js"; +>type : typeof cjs.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs.mjs +> : ^^^^^^^^^^^^^^ + +export { type }; +>type : typeof cjs.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node20).errors.txt new file mode 100644 index 0000000000000..2a46b9875db6e --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node20).errors.txt @@ -0,0 +1,46 @@ +index.js(3,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(5,1): error TS8002: 'import ... =' can only be used in TypeScript files. +subfolder/index.js(3,1): error TS8002: 'import ... =' can only be used in TypeScript files. +subfolder/index.js(5,1): error TS8002: 'import ... =' can only be used in TypeScript files. + + +==== subfolder/index.js (2 errors) ==== + // cjs format file + import {h} from "../index.js"; + import mod = require("../index.js"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import {f as _f} from "./index.js"; + import mod2 = require("./index.js"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + export async function f() { + const mod3 = await import ("../index.js"); + const mod4 = await import ("./index.js"); + h(); + } +==== index.js (2 errors) ==== + // esm format file + import {h as _h} from "./index.js"; + import mod = require("./index.js"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import {f} from "./subfolder/index.js"; + import mod2 = require("./subfolder/index.js"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + export async function h() { + const mod3 = await import ("./index.js"); + const mod4 = await import ("./subfolder/index.js"); + f(); + } +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node20).js new file mode 100644 index 0000000000000..bb91ae6ef3a60 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node20).js @@ -0,0 +1,68 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts] //// + +//// [index.js] +// cjs format file +import {h} from "../index.js"; +import mod = require("../index.js"); +import {f as _f} from "./index.js"; +import mod2 = require("./index.js"); +export async function f() { + const mod3 = await import ("../index.js"); + const mod4 = await import ("./index.js"); + h(); +} +//// [index.js] +// esm format file +import {h as _h} from "./index.js"; +import mod = require("./index.js"); +import {f} from "./subfolder/index.js"; +import mod2 = require("./subfolder/index.js"); +export async function h() { + const mod3 = await import ("./index.js"); + const mod4 = await import ("./subfolder/index.js"); + f(); +} +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +// esm format file +import { h as _h } from "./index.js"; +const mod = __require("./index.js"); +import { f } from "./subfolder/index.js"; +const mod2 = __require("./subfolder/index.js"); +export async function h() { + const mod3 = await import("./index.js"); + const mod4 = await import("./subfolder/index.js"); + f(); +} +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.f = f; +// cjs format file +const index_js_1 = require("../index.js"); +const mod = require("../index.js"); +const index_js_2 = require("./index.js"); +const mod2 = require("./index.js"); +async function f() { + const mod3 = await import("../index.js"); + const mod4 = await import("./index.js"); + (0, index_js_1.h)(); +} + + +//// [index.d.ts] +export function h(): Promise; +//// [index.d.ts] +export function f(): Promise; diff --git a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node20).symbols new file mode 100644 index 0000000000000..4c498167184c4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node20).symbols @@ -0,0 +1,60 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts] //// + +=== subfolder/index.js === +// cjs format file +import {h} from "../index.js"; +>h : Symbol(h, Decl(index.js, 1, 8)) + +import mod = require("../index.js"); +>mod : Symbol(mod, Decl(index.js, 1, 30)) + +import {f as _f} from "./index.js"; +>f : Symbol(f, Decl(index.js, 4, 36)) +>_f : Symbol(_f, Decl(index.js, 3, 8)) + +import mod2 = require("./index.js"); +>mod2 : Symbol(mod2, Decl(index.js, 3, 35)) + +export async function f() { +>f : Symbol(f, Decl(index.js, 4, 36)) + + const mod3 = await import ("../index.js"); +>mod3 : Symbol(mod3, Decl(index.js, 6, 9)) +>"../index.js" : Symbol(mod, Decl(index.js, 0, 0)) + + const mod4 = await import ("./index.js"); +>mod4 : Symbol(mod4, Decl(index.js, 7, 9)) +>"./index.js" : Symbol(mod2, Decl(index.js, 0, 0)) + + h(); +>h : Symbol(h, Decl(index.js, 1, 8)) +} +=== index.js === +// esm format file +import {h as _h} from "./index.js"; +>h : Symbol(h, Decl(index.js, 4, 46)) +>_h : Symbol(_h, Decl(index.js, 1, 8)) + +import mod = require("./index.js"); +>mod : Symbol(mod, Decl(index.js, 1, 35)) + +import {f} from "./subfolder/index.js"; +>f : Symbol(f, Decl(index.js, 3, 8)) + +import mod2 = require("./subfolder/index.js"); +>mod2 : Symbol(mod2, Decl(index.js, 3, 39)) + +export async function h() { +>h : Symbol(h, Decl(index.js, 4, 46)) + + const mod3 = await import ("./index.js"); +>mod3 : Symbol(mod3, Decl(index.js, 6, 9)) +>"./index.js" : Symbol(mod, Decl(index.js, 0, 0)) + + const mod4 = await import ("./subfolder/index.js"); +>mod4 : Symbol(mod4, Decl(index.js, 7, 9)) +>"./subfolder/index.js" : Symbol(mod2, Decl(index.js, 0, 0)) + + f(); +>f : Symbol(f, Decl(index.js, 3, 8)) +} diff --git a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node20).types new file mode 100644 index 0000000000000..e10d1bf1c8370 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node20).types @@ -0,0 +1,102 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts] //// + +=== subfolder/index.js === +// cjs format file +import {h} from "../index.js"; +>h : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + +import mod = require("../index.js"); +>mod : typeof mod +> : ^^^^^^^^^^ + +import {f as _f} from "./index.js"; +>f : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +>_f : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + +import mod2 = require("./index.js"); +>mod2 : typeof mod2 +> : ^^^^^^^^^^^ + +export async function f() { +>f : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + + const mod3 = await import ("../index.js"); +>mod3 : typeof mod +> : ^^^^^^^^^^ +>await import ("../index.js") : typeof mod +> : ^^^^^^^^^^ +>import ("../index.js") : Promise +> : ^^^^^^^^^^^^^^^^^^^ +>"../index.js" : "../index.js" +> : ^^^^^^^^^^^^^ + + const mod4 = await import ("./index.js"); +>mod4 : { default: typeof mod2; f(): Promise; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>await import ("./index.js") : { default: typeof mod2; f(): Promise; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import ("./index.js") : Promise<{ default: typeof mod2; f(): Promise; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"./index.js" : "./index.js" +> : ^^^^^^^^^^^^ + + h(); +>h() : Promise +> : ^^^^^^^^^^^^^ +>h : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +} +=== index.js === +// esm format file +import {h as _h} from "./index.js"; +>h : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +>_h : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + +import mod = require("./index.js"); +>mod : typeof mod +> : ^^^^^^^^^^ + +import {f} from "./subfolder/index.js"; +>f : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + +import mod2 = require("./subfolder/index.js"); +>mod2 : typeof mod2 +> : ^^^^^^^^^^^ + +export async function h() { +>h : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + + const mod3 = await import ("./index.js"); +>mod3 : typeof mod +> : ^^^^^^^^^^ +>await import ("./index.js") : typeof mod +> : ^^^^^^^^^^ +>import ("./index.js") : Promise +> : ^^^^^^^^^^^^^^^^^^^ +>"./index.js" : "./index.js" +> : ^^^^^^^^^^^^ + + const mod4 = await import ("./subfolder/index.js"); +>mod4 : { default: typeof mod2; f(): Promise; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>await import ("./subfolder/index.js") : { default: typeof mod2; f(): Promise; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import ("./subfolder/index.js") : Promise<{ default: typeof mod2; f(): Promise; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"./subfolder/index.js" : "./subfolder/index.js" +> : ^^^^^^^^^^^^^^^^^^^^^^ + + f(); +>f() : Promise +> : ^^^^^^^^^^^^^ +>f : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +} diff --git a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node20).errors.txt b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node20).errors.txt new file mode 100644 index 0000000000000..78c93edaa0624 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node20).errors.txt @@ -0,0 +1,28 @@ +subfolder/index.js(2,11): error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. +subfolder/index.js(4,5): error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. + + +==== subfolder/index.js (2 errors) ==== + // cjs format file + const x = await 1; + ~~~~~ +!!! error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. + export {x}; + for await (const y of []) {} + ~~~~~ +!!! error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. +==== index.js (0 errors) ==== + // esm format file + const x = await 1; + export {x}; + for await (const y of []) {} +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node20).js b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node20).js new file mode 100644 index 0000000000000..354fe725f0960 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node20).js @@ -0,0 +1,42 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsTopLevelAwait.ts] //// + +//// [index.js] +// cjs format file +const x = await 1; +export {x}; +for await (const y of []) {} +//// [index.js] +// esm format file +const x = await 1; +export {x}; +for await (const y of []) {} +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = await 1; +exports.x = x; +for await (const y of []) { } +//// [index.js] +// esm format file +const x = await 1; +export { x }; +for await (const y of []) { } + + +//// [index.d.ts] +export const x: 1; +//// [index.d.ts] +export const x: 1; diff --git a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node20).symbols b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node20).symbols new file mode 100644 index 0000000000000..7eb982a9c7609 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node20).symbols @@ -0,0 +1,24 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsTopLevelAwait.ts] //// + +=== subfolder/index.js === +// cjs format file +const x = await 1; +>x : Symbol(x, Decl(index.js, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.js, 2, 8)) + +for await (const y of []) {} +>y : Symbol(y, Decl(index.js, 3, 16)) + +=== index.js === +// esm format file +const x = await 1; +>x : Symbol(x, Decl(index.js, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.js, 2, 8)) + +for await (const y of []) {} +>y : Symbol(y, Decl(index.js, 3, 16)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node20).types b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node20).types new file mode 100644 index 0000000000000..f3dc5e0e62a34 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node20).types @@ -0,0 +1,42 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsTopLevelAwait.ts] //// + +=== subfolder/index.js === +// cjs format file +const x = await 1; +>x : 1 +> : ^ +>await 1 : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +for await (const y of []) {} +>y : any +> : ^^^ +>[] : undefined[] +> : ^^^^^^^^^^^ + +=== index.js === +// esm format file +const x = await 1; +>x : 1 +> : ^ +>await 1 : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +for await (const y of []) {} +>y : any +> : ^^^ +>[] : undefined[] +> : ^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesCJSEmit1(module=node20).errors.txt b/tests/baselines/reference/nodeModulesCJSEmit1(module=node20).errors.txt new file mode 100644 index 0000000000000..5e3604d311b92 --- /dev/null +++ b/tests/baselines/reference/nodeModulesCJSEmit1(module=node20).errors.txt @@ -0,0 +1,27 @@ +/3.cjs(2,1): error TS2304: Cannot find name 'exports'. +/5.cjs(2,8): error TS1192: Module '"/3"' has no default export. + + +==== /1.cjs (0 errors) ==== + module.exports = {}; + +==== /2.cjs (0 errors) ==== + exports.foo = 0; + +==== /3.cjs (1 errors) ==== + import "foo"; + exports.foo = {}; + ~~~~~~~ +!!! error TS2304: Cannot find name 'exports'. + +==== /4.cjs (0 errors) ==== + ; + +==== /5.cjs (1 errors) ==== + import two from "./2.cjs"; // ok + import three from "./3.cjs"; // error + ~~~~~ +!!! error TS1192: Module '"/3"' has no default export. + two.foo; + three.foo; + \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesCJSEmit1(module=node20).js b/tests/baselines/reference/nodeModulesCJSEmit1(module=node20).js new file mode 100644 index 0000000000000..5918985c97426 --- /dev/null +++ b/tests/baselines/reference/nodeModulesCJSEmit1(module=node20).js @@ -0,0 +1,47 @@ +//// [tests/cases/conformance/node/nodeModulesCJSEmit1.ts] //// + +//// [1.cjs] +module.exports = {}; + +//// [2.cjs] +exports.foo = 0; + +//// [3.cjs] +import "foo"; +exports.foo = {}; + +//// [4.cjs] +; + +//// [5.cjs] +import two from "./2.cjs"; // ok +import three from "./3.cjs"; // error +two.foo; +three.foo; + + +//// [1.cjs] +"use strict"; +module.exports = {}; +//// [2.cjs] +"use strict"; +exports.foo = 0; +//// [3.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +require("foo"); +exports.foo = {}; +//// [4.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +; +//// [5.cjs] +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const _2_cjs_1 = __importDefault(require("./2.cjs")); // ok +const _3_cjs_1 = __importDefault(require("./3.cjs")); // error +_2_cjs_1.default.foo; +_3_cjs_1.default.foo; diff --git a/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node20).js b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node20).js new file mode 100644 index 0000000000000..f0c9198a51305 --- /dev/null +++ b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node20).js @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts] //// + +//// [index.ts] +// cjs format file +export const a = 1; +//// [index.ts] +// esm format file +import mod from "./subfolder/index.js"; +mod; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +// cjs format file +exports.a = 1; +//// [index.js] +// esm format file +import mod from "./subfolder/index.js"; +mod; + + +//// [index.d.ts] +export declare const a = 1; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node20).symbols b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node20).symbols new file mode 100644 index 0000000000000..44ba4c0a68a46 --- /dev/null +++ b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node20).symbols @@ -0,0 +1,15 @@ +//// [tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts] //// + +=== subfolder/index.ts === +// cjs format file +export const a = 1; +>a : Symbol(a, Decl(index.ts, 1, 12)) + +=== index.ts === +// esm format file +import mod from "./subfolder/index.js"; +>mod : Symbol(mod, Decl(index.ts, 1, 6)) + +mod; +>mod : Symbol(mod, Decl(index.ts, 1, 6)) + diff --git a/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node20).types b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node20).types new file mode 100644 index 0000000000000..1ae92add000d0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node20).types @@ -0,0 +1,20 @@ +//// [tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts] //// + +=== subfolder/index.ts === +// cjs format file +export const a = 1; +>a : 1 +> : ^ +>1 : 1 +> : ^ + +=== index.ts === +// esm format file +import mod from "./subfolder/index.js"; +>mod : typeof mod +> : ^^^^^^^^^^ + +mod; +>mod : typeof mod +> : ^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node20).errors.txt b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node20).errors.txt new file mode 100644 index 0000000000000..d078baf601f70 --- /dev/null +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node20).errors.txt @@ -0,0 +1,131 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. +node_modules/inner/index.d.mts(2,13): error TS2303: Circular definition of import alias 'cjs'. +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. + + +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. +==== index.ts (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/a"; + import * as mjsi from "inner/b"; + import * as typei from "inner"; + import * as ts from "inner/types"; + cjsi.mjsSource; + mjsi.mjsSource; + typei.mjsSource; + ts.mjsSource; +==== index.mts (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/a"; + import * as mjsi from "inner/b"; + import * as typei from "inner"; + import * as ts from "inner/types"; + cjsi.mjsSource; + mjsi.mjsSource; + typei.mjsSource; + ts.mjsSource; +==== index.cts (0 errors) ==== + // cjs format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/a"; + import * as mjsi from "inner/b"; + import * as typei from "inner"; + import * as ts from "inner/types"; + cjsi.cjsSource; + mjsi.cjsSource; + typei.implicitCjsSource; + ts.cjsSource; +==== node_modules/inner/index.d.ts (1 errors) ==== + // cjs format file + import * as cjs from "inner/a"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/b"; + import * as type from "inner"; + import * as ts from "inner/types"; + export { cjs }; + export { mjs }; + export { type }; + export { ts }; + export const implicitCjsSource = true; +==== node_modules/inner/index.d.mts (1 errors) ==== + // esm format file + import * as cjs from "inner/a"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/b"; + import * as type from "inner"; + import * as ts from "inner/types"; + export { cjs }; + export { mjs }; + export { type }; + export { ts }; + export const mjsSource = true; +==== node_modules/inner/index.d.cts (0 errors) ==== + // cjs format file + import * as cjs from "inner/a"; + import * as mjs from "inner/b"; + import * as type from "inner"; + import * as ts from "inner/types"; + export { cjs }; + export { mjs }; + export { type }; + export { ts }; + export const cjsSource = true; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./a": { + "require": "./index.cjs", + "node": "./index.mjs" + }, + "./b": { + "import": "./index.mjs", + "node": "./index.cjs" + }, + ".": { + "import": "./index.mjs", + "node": "./index.js" + }, + "./types": { + "types": { + "import": "./index.d.mts", + "require": "./index.d.cts", + }, + "node": { + "import": "./index.mjs", + "require": "./index.cjs" + } + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node20).js b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node20).js new file mode 100644 index 0000000000000..8bf4f316a59ff --- /dev/null +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node20).js @@ -0,0 +1,215 @@ +//// [tests/cases/conformance/node/nodeModulesConditionalPackageExports.ts] //// + +//// [index.ts] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; +//// [index.mts] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; +//// [index.cts] +// cjs format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.cjsSource; +mjsi.cjsSource; +typei.implicitCjsSource; +ts.cjsSource; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/a"; +import * as mjs from "inner/b"; +import * as type from "inner"; +import * as ts from "inner/types"; +export { cjs }; +export { mjs }; +export { type }; +export { ts }; +export const implicitCjsSource = true; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/a"; +import * as mjs from "inner/b"; +import * as type from "inner"; +import * as ts from "inner/types"; +export { cjs }; +export { mjs }; +export { type }; +export { ts }; +export const mjsSource = true; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/a"; +import * as mjs from "inner/b"; +import * as type from "inner"; +import * as ts from "inner/types"; +export { cjs }; +export { mjs }; +export { type }; +export { ts }; +export const cjsSource = true; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./a": { + "require": "./index.cjs", + "node": "./index.mjs" + }, + "./b": { + "import": "./index.mjs", + "node": "./index.cjs" + }, + ".": { + "import": "./index.mjs", + "node": "./index.js" + }, + "./types": { + "types": { + "import": "./index.d.mts", + "require": "./index.d.cts", + }, + "node": { + "import": "./index.mjs", + "require": "./index.cjs" + } + } + } +} + +//// [index.mjs] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjs = __importStar(require("package/cjs")); +const mjs = __importStar(require("package/mjs")); +const type = __importStar(require("package")); +cjs; +mjs; +type; +const cjsi = __importStar(require("inner/a")); +const mjsi = __importStar(require("inner/b")); +const typei = __importStar(require("inner")); +const ts = __importStar(require("inner/types")); +cjsi.cjsSource; +mjsi.cjsSource; +typei.implicitCjsSource; +ts.cjsSource; +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; + + +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node20).symbols b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node20).symbols new file mode 100644 index 0000000000000..07c60903e55eb --- /dev/null +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node20).symbols @@ -0,0 +1,245 @@ +//// [tests/cases/conformance/node/nodeModulesConditionalPackageExports.ts] //// + +=== index.ts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.ts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.ts, 3, 6)) + +import * as cjsi from "inner/a"; +>cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) + +import * as mjsi from "inner/b"; +>mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.ts, 9, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.ts, 10, 6)) + +cjsi.mjsSource; +>cjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +mjsi.mjsSource; +>mjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +typei.mjsSource; +>typei.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>typei : Symbol(typei, Decl(index.ts, 9, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +ts.mjsSource; +>ts.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>ts : Symbol(ts, Decl(index.ts, 10, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +=== index.mts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.mts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.mts, 3, 6)) + +import * as cjsi from "inner/a"; +>cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) + +import * as mjsi from "inner/b"; +>mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.mts, 9, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.mts, 10, 6)) + +cjsi.mjsSource; +>cjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +mjsi.mjsSource; +>mjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +typei.mjsSource; +>typei.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>typei : Symbol(typei, Decl(index.mts, 9, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +ts.mjsSource; +>ts.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>ts : Symbol(ts, Decl(index.mts, 10, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +=== index.cts === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.cts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.cts, 3, 6)) + +import * as cjsi from "inner/a"; +>cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) + +import * as mjsi from "inner/b"; +>mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.cts, 9, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.cts, 10, 6)) + +cjsi.cjsSource; +>cjsi.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) +>cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) +>cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) + +mjsi.cjsSource; +>mjsi.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) +>mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) +>cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) + +typei.implicitCjsSource; +>typei.implicitCjsSource : Symbol(cjsi.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) +>typei : Symbol(typei, Decl(index.cts, 9, 6)) +>implicitCjsSource : Symbol(cjsi.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) + +ts.cjsSource; +>ts.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) +>ts : Symbol(ts, Decl(index.cts, 10, 6)) +>cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/b"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.d.ts, 4, 6)) + +export { cjs }; +>cjs : Symbol(mjs.type.cjs, Decl(index.d.ts, 5, 8)) + +export { mjs }; +>mjs : Symbol(mjs.type.mjs, Decl(index.d.ts, 6, 8)) + +export { type }; +>type : Symbol(mjs.type.type, Decl(index.d.ts, 7, 8)) + +export { ts }; +>ts : Symbol(mjs.type.ts, Decl(index.d.ts, 8, 8)) + +export const implicitCjsSource = true; +>implicitCjsSource : Symbol(mjs.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/a"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/b"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.d.mts, 4, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs, Decl(index.d.mts, 5, 8)) + +export { mjs }; +>mjs : Symbol(mjs.mjs, Decl(index.d.mts, 6, 8)) + +export { type }; +>type : Symbol(mjs.type, Decl(index.d.mts, 7, 8)) + +export { ts }; +>ts : Symbol(mjs.ts, Decl(index.d.mts, 8, 8)) + +export const mjsSource = true; +>mjsSource : Symbol(mjs.mjsSource, Decl(index.d.mts, 9, 12)) + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/b"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.d.cts, 4, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 5, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 6, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 7, 8)) + +export { ts }; +>ts : Symbol(cjs.ts, Decl(index.d.cts, 8, 8)) + +export const cjsSource = true; +>cjsSource : Symbol(cjs.cjsSource, Decl(index.d.cts, 9, 12)) + diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node20).types b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node20).types new file mode 100644 index 0000000000000..a7cb6f45bf8e8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node20).types @@ -0,0 +1,344 @@ +//// [tests/cases/conformance/node/nodeModulesConditionalPackageExports.ts] //// + +=== index.ts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "package/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "package"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +import * as cjsi from "inner/a"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/b"; +>mjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as typei from "inner"; +>typei : typeof cjsi +> : ^^^^^^^^^^^ + +import * as ts from "inner/types"; +>ts : typeof cjsi +> : ^^^^^^^^^^^ + +cjsi.mjsSource; +>cjsi.mjsSource : true +> : ^^^^ +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +mjsi.mjsSource; +>mjsi.mjsSource : true +> : ^^^^ +>mjsi : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +typei.mjsSource; +>typei.mjsSource : true +> : ^^^^ +>typei : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +ts.mjsSource; +>ts.mjsSource : true +> : ^^^^ +>ts : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +=== index.mts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "package/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "package"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +import * as cjsi from "inner/a"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/b"; +>mjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as typei from "inner"; +>typei : typeof cjsi +> : ^^^^^^^^^^^ + +import * as ts from "inner/types"; +>ts : typeof cjsi +> : ^^^^^^^^^^^ + +cjsi.mjsSource; +>cjsi.mjsSource : true +> : ^^^^ +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +mjsi.mjsSource; +>mjsi.mjsSource : true +> : ^^^^ +>mjsi : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +typei.mjsSource; +>typei.mjsSource : true +> : ^^^^ +>typei : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +ts.mjsSource; +>ts.mjsSource : true +> : ^^^^ +>ts : typeof cjsi +> : ^^^^^^^^^^^ +>mjsSource : true +> : ^^^^ + +=== index.cts === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "package/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "package"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +import * as cjsi from "inner/a"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/b"; +>mjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as typei from "inner"; +>typei : typeof cjsi.type +> : ^^^^^^^^^^^^^^^^ + +import * as ts from "inner/types"; +>ts : typeof cjsi +> : ^^^^^^^^^^^ + +cjsi.cjsSource; +>cjsi.cjsSource : true +> : ^^^^ +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ +>cjsSource : true +> : ^^^^ + +mjsi.cjsSource; +>mjsi.cjsSource : true +> : ^^^^ +>mjsi : typeof cjsi +> : ^^^^^^^^^^^ +>cjsSource : true +> : ^^^^ + +typei.implicitCjsSource; +>typei.implicitCjsSource : true +> : ^^^^ +>typei : typeof cjsi.type +> : ^^^^^^^^^^^^^^^^ +>implicitCjsSource : true +> : ^^^^ + +ts.cjsSource; +>ts.cjsSource : true +> : ^^^^ +>ts : typeof cjsi +> : ^^^^^^^^^^^ +>cjsSource : true +> : ^^^^ + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/b"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "inner"; +>type : typeof mjs.type +> : ^^^^^^^^^^^^^^^ + +import * as ts from "inner/types"; +>ts : typeof mjs +> : ^^^^^^^^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +export { type }; +>type : typeof mjs.type +> : ^^^^^^^^^^^^^^^ + +export { ts }; +>ts : typeof mjs +> : ^^^^^^^^^^ + +export const implicitCjsSource = true; +>implicitCjsSource : true +> : ^^^^ +>true : true +> : ^^^^ + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/a"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/b"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "inner"; +>type : typeof mjs +> : ^^^^^^^^^^ + +import * as ts from "inner/types"; +>ts : typeof mjs +> : ^^^^^^^^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +export { type }; +>type : typeof mjs +> : ^^^^^^^^^^ + +export { ts }; +>ts : typeof mjs +> : ^^^^^^^^^^ + +export const mjsSource = true; +>mjsSource : true +> : ^^^^ +>true : true +> : ^^^^ + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/b"; +>mjs : typeof cjs +> : ^^^^^^^^^^ + +import * as type from "inner"; +>type : typeof cjs.type +> : ^^^^^^^^^^^^^^^ + +import * as ts from "inner/types"; +>ts : typeof cjs +> : ^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs +> : ^^^^^^^^^^ + +export { type }; +>type : typeof cjs.type +> : ^^^^^^^^^^^^^^^ + +export { ts }; +>ts : typeof cjs +> : ^^^^^^^^^^ + +export const cjsSource = true; +>cjsSource : true +> : ^^^^ +>true : true +> : ^^^^ + diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports(module=node20).js b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports(module=node20).js new file mode 100644 index 0000000000000..3afe5f2a3f639 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports(module=node20).js @@ -0,0 +1,171 @@ +//// [tests/cases/conformance/node/nodeModulesDeclarationEmitDynamicImportWithPackageExports.ts] //// + +//// [index.ts] +// esm format file +export {}; +//// [index.mts] +// esm format file +export {}; +//// [index.cts] +// cjs format file +export {}; +//// [other.ts] +// esm format file +export const a = await import("package/cjs"); +export const b = await import("package/mjs"); +export const c = await import("package"); +export const f = await import("inner"); +//// [other2.ts] +// esm format file +export const d = await import("inner/cjs"); +export const e = await import("inner/mjs"); +//// [other.mts] +// esm format file +export const a = await import("package/cjs"); +export const b = await import("package/mjs"); +export const c = await import("package"); +export const f = await import("inner"); +//// [other2.mts] +// esm format file +export const d = await import("inner/cjs"); +export const e = await import("inner/mjs"); +//// [other.cts] +// cjs format file, no TLA +export const a = import("package/cjs"); +export const b = import("package/mjs"); +export const c = import("package"); +export const f = import("inner"); +//// [other2.cts] +// cjs format file, no TLA +export const d = import("inner/cjs"); +export const e = import("inner/mjs"); +//// [index.d.ts] +// cjs format file +export const cjsMain = true; +//// [index.d.mts] +// esm format file +export const esm = true; +//// [index.d.cts] +// cjs format file +export const cjsNonmain = true; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} + +//// [index.js] +export {}; +//// [index.mjs] +export {}; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//// [other.js] +// esm format file +export const a = await import("package/cjs"); +export const b = await import("package/mjs"); +export const c = await import("package"); +export const f = await import("inner"); +//// [other2.js] +// esm format file +export const d = await import("inner/cjs"); +export const e = await import("inner/mjs"); +//// [other.mjs] +// esm format file +export const a = await import("package/cjs"); +export const b = await import("package/mjs"); +export const c = await import("package"); +export const f = await import("inner"); +//// [other2.mjs] +// esm format file +export const d = await import("inner/cjs"); +export const e = await import("inner/mjs"); +//// [other.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.f = exports.c = exports.b = exports.a = void 0; +// cjs format file, no TLA +exports.a = import("package/cjs"); +exports.b = import("package/mjs"); +exports.c = import("package"); +exports.f = import("inner"); +//// [other2.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.e = exports.d = void 0; +// cjs format file, no TLA +exports.d = import("inner/cjs"); +exports.e = import("inner/mjs"); + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; +//// [other.d.ts] +export declare const a: { + default: typeof import("package/cjs"); +}; +export declare const b: typeof import("package/mjs"); +export declare const c: typeof import("package"); +export declare const f: { + default: typeof import("inner"); + cjsMain: true; +}; +//// [other2.d.ts] +export declare const d: { + default: typeof import("inner/cjs"); + cjsNonmain: true; +}; +export declare const e: typeof import("inner/mjs"); +//// [other.d.mts] +export declare const a: { + default: typeof import("package/cjs"); +}; +export declare const b: typeof import("package/mjs"); +export declare const c: typeof import("package"); +export declare const f: { + default: typeof import("inner"); + cjsMain: true; +}; +//// [other2.d.mts] +export declare const d: { + default: typeof import("inner/cjs"); + cjsNonmain: true; +}; +export declare const e: typeof import("inner/mjs"); +//// [other.d.cts] +export declare const a: Promise<{ + default: typeof import("./index.cjs"); +}>; +export declare const b: Promise; +export declare const c: Promise; +export declare const f: Promise<{ + default: typeof import("inner"); + cjsMain: true; +}>; +//// [other2.d.cts] +export declare const d: Promise<{ + default: typeof import("inner/cjs"); + cjsNonmain: true; +}>; +export declare const e: Promise; diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports(module=node20).symbols b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports(module=node20).symbols new file mode 100644 index 0000000000000..653778e00a97f --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports(module=node20).symbols @@ -0,0 +1,113 @@ +//// [tests/cases/conformance/node/nodeModulesDeclarationEmitDynamicImportWithPackageExports.ts] //// + +=== index.ts === + +// esm format file +export {}; +=== index.mts === + +// esm format file +export {}; +=== index.cts === + +// cjs format file +export {}; +=== other.ts === +// esm format file +export const a = await import("package/cjs"); +>a : Symbol(a, Decl(other.ts, 1, 12)) +>"package/cjs" : Symbol("index", Decl(index.cts, 0, 0)) + +export const b = await import("package/mjs"); +>b : Symbol(b, Decl(other.ts, 2, 12)) +>"package/mjs" : Symbol("index", Decl(index.mts, 0, 0)) + +export const c = await import("package"); +>c : Symbol(c, Decl(other.ts, 3, 12)) +>"package" : Symbol("index", Decl(index.ts, 0, 0)) + +export const f = await import("inner"); +>f : Symbol(f, Decl(other.ts, 4, 12)) +>"inner" : Symbol("node_modules/inner/index", Decl(index.d.ts, 0, 0)) + +=== other2.ts === +// esm format file +export const d = await import("inner/cjs"); +>d : Symbol(d, Decl(other2.ts, 1, 12)) +>"inner/cjs" : Symbol("node_modules/inner/index", Decl(index.d.cts, 0, 0)) + +export const e = await import("inner/mjs"); +>e : Symbol(e, Decl(other2.ts, 2, 12)) +>"inner/mjs" : Symbol("node_modules/inner/index", Decl(index.d.mts, 0, 0)) + +=== other.mts === +// esm format file +export const a = await import("package/cjs"); +>a : Symbol(a, Decl(other.mts, 1, 12)) +>"package/cjs" : Symbol("index", Decl(index.cts, 0, 0)) + +export const b = await import("package/mjs"); +>b : Symbol(b, Decl(other.mts, 2, 12)) +>"package/mjs" : Symbol("index", Decl(index.mts, 0, 0)) + +export const c = await import("package"); +>c : Symbol(c, Decl(other.mts, 3, 12)) +>"package" : Symbol("index", Decl(index.ts, 0, 0)) + +export const f = await import("inner"); +>f : Symbol(f, Decl(other.mts, 4, 12)) +>"inner" : Symbol("node_modules/inner/index", Decl(index.d.ts, 0, 0)) + +=== other2.mts === +// esm format file +export const d = await import("inner/cjs"); +>d : Symbol(d, Decl(other2.mts, 1, 12)) +>"inner/cjs" : Symbol("node_modules/inner/index", Decl(index.d.cts, 0, 0)) + +export const e = await import("inner/mjs"); +>e : Symbol(e, Decl(other2.mts, 2, 12)) +>"inner/mjs" : Symbol("node_modules/inner/index", Decl(index.d.mts, 0, 0)) + +=== other.cts === +// cjs format file, no TLA +export const a = import("package/cjs"); +>a : Symbol(a, Decl(other.cts, 1, 12)) +>"package/cjs" : Symbol("index", Decl(index.cts, 0, 0)) + +export const b = import("package/mjs"); +>b : Symbol(b, Decl(other.cts, 2, 12)) +>"package/mjs" : Symbol("index", Decl(index.mts, 0, 0)) + +export const c = import("package"); +>c : Symbol(c, Decl(other.cts, 3, 12)) +>"package" : Symbol("index", Decl(index.ts, 0, 0)) + +export const f = import("inner"); +>f : Symbol(f, Decl(other.cts, 4, 12)) +>"inner" : Symbol("node_modules/inner/index", Decl(index.d.ts, 0, 0)) + +=== other2.cts === +// cjs format file, no TLA +export const d = import("inner/cjs"); +>d : Symbol(d, Decl(other2.cts, 1, 12)) +>"inner/cjs" : Symbol("node_modules/inner/index", Decl(index.d.cts, 0, 0)) + +export const e = import("inner/mjs"); +>e : Symbol(e, Decl(other2.cts, 2, 12)) +>"inner/mjs" : Symbol("node_modules/inner/index", Decl(index.d.mts, 0, 0)) + +=== node_modules/inner/index.d.ts === +// cjs format file +export const cjsMain = true; +>cjsMain : Symbol(cjsMain, Decl(index.d.ts, 1, 12)) + +=== node_modules/inner/index.d.mts === +// esm format file +export const esm = true; +>esm : Symbol(esm, Decl(index.d.mts, 1, 12)) + +=== node_modules/inner/index.d.cts === +// cjs format file +export const cjsNonmain = true; +>cjsNonmain : Symbol(cjsNonmain, Decl(index.d.cts, 1, 12)) + diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports(module=node20).types b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports(module=node20).types new file mode 100644 index 0000000000000..597b7cc403c48 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports(module=node20).types @@ -0,0 +1,218 @@ +//// [tests/cases/conformance/node/nodeModulesDeclarationEmitDynamicImportWithPackageExports.ts] //// + +=== index.ts === + +// esm format file +export {}; +=== index.mts === + +// esm format file +export {}; +=== index.cts === + +// cjs format file +export {}; +=== other.ts === +// esm format file +export const a = await import("package/cjs"); +>a : { default: typeof import("index"); } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>await import("package/cjs") : { default: typeof import("index"); } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import("package/cjs") : Promise<{ default: typeof import("index"); }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"package/cjs" : "package/cjs" +> : ^^^^^^^^^^^^^ + +export const b = await import("package/mjs"); +>b : typeof import("index") +> : ^^^^^^^^^^^^^^^^^^^^^^ +>await import("package/mjs") : typeof import("index") +> : ^^^^^^^^^^^^^^^^^^^^^^ +>import("package/mjs") : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"package/mjs" : "package/mjs" +> : ^^^^^^^^^^^^^ + +export const c = await import("package"); +>c : typeof import("index") +> : ^^^^^^^^^^^^^^^^^^^^^^ +>await import("package") : typeof import("index") +> : ^^^^^^^^^^^^^^^^^^^^^^ +>import("package") : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"package" : "package" +> : ^^^^^^^^^ + +export const f = await import("inner"); +>f : { default: typeof import("node_modules/inner/index"); cjsMain: true; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>await import("inner") : { default: typeof import("node_modules/inner/index"); cjsMain: true; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>import("inner") : Promise<{ default: typeof import("node_modules/inner/index"); cjsMain: true; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ +>"inner" : "inner" +> : ^^^^^^^ + +=== other2.ts === +// esm format file +export const d = await import("inner/cjs"); +>d : { default: typeof import("node_modules/inner/index"); cjsNonmain: true; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>await import("inner/cjs") : { default: typeof import("node_modules/inner/index"); cjsNonmain: true; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>import("inner/cjs") : Promise<{ default: typeof import("node_modules/inner/index"); cjsNonmain: true; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ +>"inner/cjs" : "inner/cjs" +> : ^^^^^^^^^^^ + +export const e = await import("inner/mjs"); +>e : typeof import("node_modules/inner/index") +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>await import("inner/mjs") : typeof import("node_modules/inner/index") +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import("inner/mjs") : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"inner/mjs" : "inner/mjs" +> : ^^^^^^^^^^^ + +=== other.mts === +// esm format file +export const a = await import("package/cjs"); +>a : { default: typeof import("index"); } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>await import("package/cjs") : { default: typeof import("index"); } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import("package/cjs") : Promise<{ default: typeof import("index"); }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"package/cjs" : "package/cjs" +> : ^^^^^^^^^^^^^ + +export const b = await import("package/mjs"); +>b : typeof import("index") +> : ^^^^^^^^^^^^^^^^^^^^^^ +>await import("package/mjs") : typeof import("index") +> : ^^^^^^^^^^^^^^^^^^^^^^ +>import("package/mjs") : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"package/mjs" : "package/mjs" +> : ^^^^^^^^^^^^^ + +export const c = await import("package"); +>c : typeof import("index") +> : ^^^^^^^^^^^^^^^^^^^^^^ +>await import("package") : typeof import("index") +> : ^^^^^^^^^^^^^^^^^^^^^^ +>import("package") : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"package" : "package" +> : ^^^^^^^^^ + +export const f = await import("inner"); +>f : { default: typeof import("node_modules/inner/index"); cjsMain: true; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>await import("inner") : { default: typeof import("node_modules/inner/index"); cjsMain: true; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>import("inner") : Promise<{ default: typeof import("node_modules/inner/index"); cjsMain: true; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ +>"inner" : "inner" +> : ^^^^^^^ + +=== other2.mts === +// esm format file +export const d = await import("inner/cjs"); +>d : { default: typeof import("node_modules/inner/index"); cjsNonmain: true; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>await import("inner/cjs") : { default: typeof import("node_modules/inner/index"); cjsNonmain: true; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ +>import("inner/cjs") : Promise<{ default: typeof import("node_modules/inner/index"); cjsNonmain: true; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ +>"inner/cjs" : "inner/cjs" +> : ^^^^^^^^^^^ + +export const e = await import("inner/mjs"); +>e : typeof import("node_modules/inner/index") +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>await import("inner/mjs") : typeof import("node_modules/inner/index") +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import("inner/mjs") : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"inner/mjs" : "inner/mjs" +> : ^^^^^^^^^^^ + +=== other.cts === +// cjs format file, no TLA +export const a = import("package/cjs"); +>a : Promise<{ default: typeof import("index"); }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import("package/cjs") : Promise<{ default: typeof import("index"); }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"package/cjs" : "package/cjs" +> : ^^^^^^^^^^^^^ + +export const b = import("package/mjs"); +>b : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import("package/mjs") : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"package/mjs" : "package/mjs" +> : ^^^^^^^^^^^^^ + +export const c = import("package"); +>c : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import("package") : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"package" : "package" +> : ^^^^^^^^^ + +export const f = import("inner"); +>f : Promise<{ default: typeof import("node_modules/inner/index"); cjsMain: true; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ +>import("inner") : Promise<{ default: typeof import("node_modules/inner/index"); cjsMain: true; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ +>"inner" : "inner" +> : ^^^^^^^ + +=== other2.cts === +// cjs format file, no TLA +export const d = import("inner/cjs"); +>d : Promise<{ default: typeof import("node_modules/inner/index"); cjsNonmain: true; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ +>import("inner/cjs") : Promise<{ default: typeof import("node_modules/inner/index"); cjsNonmain: true; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ +>"inner/cjs" : "inner/cjs" +> : ^^^^^^^^^^^ + +export const e = import("inner/mjs"); +>e : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import("inner/mjs") : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"inner/mjs" : "inner/mjs" +> : ^^^^^^^^^^^ + +=== node_modules/inner/index.d.ts === +// cjs format file +export const cjsMain = true; +>cjsMain : true +> : ^^^^ +>true : true +> : ^^^^ + +=== node_modules/inner/index.d.mts === +// esm format file +export const esm = true; +>esm : true +> : ^^^^ +>true : true +> : ^^^^ + +=== node_modules/inner/index.d.cts === +// cjs format file +export const cjsNonmain = true; +>cjsNonmain : true +> : ^^^^ +>true : true +> : ^^^^ + diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node20).errors.txt b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node20).errors.txt new file mode 100644 index 0000000000000..ed1769f353bbb --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node20).errors.txt @@ -0,0 +1,103 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. +node_modules/inner/index.d.cts(5,1): error TS1036: Statements are not allowed in ambient contexts. +node_modules/inner/index.d.mts(5,1): error TS1036: Statements are not allowed in ambient contexts. +node_modules/inner/index.d.ts(5,1): error TS1036: Statements are not allowed in ambient contexts. + + +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. +==== index.ts (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + export const a = cjs; + export const b = mjs; + export const c = type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + import * as typei from "inner"; + export const d = cjsi; + export const e = mjsi; + export const f = typei; +==== index.mts (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + export const a = cjs; + export const b = mjs; + export const c = type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + import * as typei from "inner"; + export const d = cjsi; + export const e = mjsi; + export const f = typei; +==== index.cts (0 errors) ==== + // cjs format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + export const a = cjs; + export const b = mjs; + export const c = type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + import * as typei from "inner"; + export const d = cjsi; + export const e = mjsi; + export const f = typei; +==== node_modules/inner/index.d.ts (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + import * as type from "inner"; + cjs; + ~~~ +!!! error TS1036: Statements are not allowed in ambient contexts. + mjs; + type; + export const cjsMain = true; +==== node_modules/inner/index.d.mts (1 errors) ==== + // esm format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + import * as type from "inner"; + cjs; + ~~~ +!!! error TS1036: Statements are not allowed in ambient contexts. + mjs; + type; + export const esm = true; +==== node_modules/inner/index.d.cts (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + import * as type from "inner"; + cjs; + ~~~ +!!! error TS1036: Statements are not allowed in ambient contexts. + mjs; + type; + export const cjsNonmain = true; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node20).js b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node20).js new file mode 100644 index 0000000000000..58d736d2641fe --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node20).js @@ -0,0 +1,212 @@ +//// [tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts] //// + +//// [index.ts] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export const a = cjs; +export const b = mjs; +export const c = type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export const d = cjsi; +export const e = mjsi; +export const f = typei; +//// [index.mts] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export const a = cjs; +export const b = mjs; +export const c = type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export const d = cjsi; +export const e = mjsi; +export const f = typei; +//// [index.cts] +// cjs format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export const a = cjs; +export const b = mjs; +export const c = type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export const d = cjsi; +export const e = mjsi; +export const f = typei; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +cjs; +mjs; +type; +export const cjsMain = true; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +cjs; +mjs; +type; +export const esm = true; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +cjs; +mjs; +type; +export const cjsNonmain = true; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} + +//// [index.mjs] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export const a = cjs; +export const b = mjs; +export const c = type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export const d = cjsi; +export const e = mjsi; +export const f = typei; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.f = exports.e = exports.d = exports.c = exports.b = exports.a = void 0; +// cjs format file +const cjs = __importStar(require("package/cjs")); +const mjs = __importStar(require("package/mjs")); +const type = __importStar(require("package")); +exports.a = cjs; +exports.b = mjs; +exports.c = type; +const cjsi = __importStar(require("inner/cjs")); +const mjsi = __importStar(require("inner/mjs")); +const typei = __importStar(require("inner")); +exports.d = cjsi; +exports.e = mjsi; +exports.f = typei; +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export const a = cjs; +export const b = mjs; +export const c = type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export const d = cjsi; +export const e = mjsi; +export const f = typei; + + +//// [index.d.mts] +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export declare const a: typeof cjs; +export declare const b: typeof mjs; +export declare const c: typeof type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export declare const d: typeof cjsi; +export declare const e: typeof mjsi; +export declare const f: typeof typei; +//// [index.d.cts] +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export declare const a: typeof cjs; +export declare const b: typeof mjs; +export declare const c: typeof type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export declare const d: typeof cjsi; +export declare const e: typeof mjsi; +export declare const f: typeof typei; +//// [index.d.ts] +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export declare const a: typeof cjs; +export declare const b: typeof mjs; +export declare const c: typeof type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export declare const d: typeof cjsi; +export declare const e: typeof mjsi; +export declare const f: typeof typei; diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node20).symbols b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node20).symbols new file mode 100644 index 0000000000000..93d7af061919a --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node20).symbols @@ -0,0 +1,203 @@ +//// [tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts] //// + +=== index.ts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.ts, 3, 6)) + +export const a = cjs; +>a : Symbol(type.a, Decl(index.ts, 4, 12)) +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +export const b = mjs; +>b : Symbol(type.b, Decl(index.ts, 5, 12)) +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +export const c = type; +>c : Symbol(type.c, Decl(index.ts, 6, 12)) +>type : Symbol(type, Decl(index.ts, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.ts, 9, 6)) + +export const d = cjsi; +>d : Symbol(type.d, Decl(index.ts, 10, 12)) +>cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) + +export const e = mjsi; +>e : Symbol(type.e, Decl(index.ts, 11, 12)) +>mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) + +export const f = typei; +>f : Symbol(type.f, Decl(index.ts, 12, 12)) +>typei : Symbol(typei, Decl(index.ts, 9, 6)) + +=== index.mts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.mts, 3, 6)) + +export const a = cjs; +>a : Symbol(mjs.a, Decl(index.mts, 4, 12)) +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +export const b = mjs; +>b : Symbol(mjs.b, Decl(index.mts, 5, 12)) +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +export const c = type; +>c : Symbol(mjs.c, Decl(index.mts, 6, 12)) +>type : Symbol(type, Decl(index.mts, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.mts, 9, 6)) + +export const d = cjsi; +>d : Symbol(mjs.d, Decl(index.mts, 10, 12)) +>cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) + +export const e = mjsi; +>e : Symbol(mjs.e, Decl(index.mts, 11, 12)) +>mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) + +export const f = typei; +>f : Symbol(mjs.f, Decl(index.mts, 12, 12)) +>typei : Symbol(typei, Decl(index.mts, 9, 6)) + +=== index.cts === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.cts, 3, 6)) + +export const a = cjs; +>a : Symbol(cjs.a, Decl(index.cts, 4, 12)) +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +export const b = mjs; +>b : Symbol(cjs.b, Decl(index.cts, 5, 12)) +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +export const c = type; +>c : Symbol(cjs.c, Decl(index.cts, 6, 12)) +>type : Symbol(type, Decl(index.cts, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.cts, 9, 6)) + +export const d = cjsi; +>d : Symbol(cjs.d, Decl(index.cts, 10, 12)) +>cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) + +export const e = mjsi; +>e : Symbol(cjs.e, Decl(index.cts, 11, 12)) +>mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) + +export const f = typei; +>f : Symbol(cjs.f, Decl(index.cts, 12, 12)) +>typei : Symbol(typei, Decl(index.cts, 9, 6)) + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export const cjsMain = true; +>cjsMain : Symbol(type.cjsMain, Decl(index.d.ts, 7, 12)) + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export const esm = true; +>esm : Symbol(mjs.esm, Decl(index.d.mts, 7, 12)) + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export const cjsNonmain = true; +>cjsNonmain : Symbol(cjs.cjsNonmain, Decl(index.d.cts, 7, 12)) + diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node20).types b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node20).types new file mode 100644 index 0000000000000..9921b0e1f5183 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node20).types @@ -0,0 +1,284 @@ +//// [tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts] //// + +=== index.ts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "package/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "package"; +>type : typeof type +> : ^^^^^^^^^^^ + +export const a = cjs; +>a : typeof cjs +> : ^^^^^^^^^^ +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export const b = mjs; +>b : typeof mjs +> : ^^^^^^^^^^ +>mjs : typeof mjs +> : ^^^^^^^^^^ + +export const c = type; +>c : typeof type +> : ^^^^^^^^^^^ +>type : typeof type +> : ^^^^^^^^^^^ + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs"; +>mjsi : typeof mjsi +> : ^^^^^^^^^^^ + +import * as typei from "inner"; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +export const d = cjsi; +>d : typeof cjsi +> : ^^^^^^^^^^^ +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +export const e = mjsi; +>e : typeof mjsi +> : ^^^^^^^^^^^ +>mjsi : typeof mjsi +> : ^^^^^^^^^^^ + +export const f = typei; +>f : typeof typei +> : ^^^^^^^^^^^^ +>typei : typeof typei +> : ^^^^^^^^^^^^ + +=== index.mts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "package/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "package"; +>type : typeof type +> : ^^^^^^^^^^^ + +export const a = cjs; +>a : typeof cjs +> : ^^^^^^^^^^ +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export const b = mjs; +>b : typeof mjs +> : ^^^^^^^^^^ +>mjs : typeof mjs +> : ^^^^^^^^^^ + +export const c = type; +>c : typeof type +> : ^^^^^^^^^^^ +>type : typeof type +> : ^^^^^^^^^^^ + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs"; +>mjsi : typeof mjsi +> : ^^^^^^^^^^^ + +import * as typei from "inner"; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +export const d = cjsi; +>d : typeof cjsi +> : ^^^^^^^^^^^ +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +export const e = mjsi; +>e : typeof mjsi +> : ^^^^^^^^^^^ +>mjsi : typeof mjsi +> : ^^^^^^^^^^^ + +export const f = typei; +>f : typeof typei +> : ^^^^^^^^^^^^ +>typei : typeof typei +> : ^^^^^^^^^^^^ + +=== index.cts === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "package/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "package"; +>type : typeof type +> : ^^^^^^^^^^^ + +export const a = cjs; +>a : typeof cjs +> : ^^^^^^^^^^ +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export const b = mjs; +>b : typeof mjs +> : ^^^^^^^^^^ +>mjs : typeof mjs +> : ^^^^^^^^^^ + +export const c = type; +>c : typeof type +> : ^^^^^^^^^^^ +>type : typeof type +> : ^^^^^^^^^^^ + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs"; +>mjsi : typeof mjsi +> : ^^^^^^^^^^^ + +import * as typei from "inner"; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +export const d = cjsi; +>d : typeof cjsi +> : ^^^^^^^^^^^ +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +export const e = mjsi; +>e : typeof mjsi +> : ^^^^^^^^^^^ +>mjsi : typeof mjsi +> : ^^^^^^^^^^^ + +export const f = typei; +>f : typeof typei +> : ^^^^^^^^^^^^ +>typei : typeof typei +> : ^^^^^^^^^^^^ + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "inner"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +export const cjsMain = true; +>cjsMain : true +> : ^^^^ +>true : true +> : ^^^^ + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "inner"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +export const esm = true; +>esm : true +> : ^^^^ +>true : true +> : ^^^^ + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "inner"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +export const cjsNonmain = true; +>cjsNonmain : true +> : ^^^^ +>true : true +> : ^^^^ + diff --git a/tests/baselines/reference/nodeModulesDynamicImport(module=node20).js b/tests/baselines/reference/nodeModulesDynamicImport(module=node20).js new file mode 100644 index 0000000000000..378a054d25109 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDynamicImport(module=node20).js @@ -0,0 +1,44 @@ +//// [tests/cases/conformance/node/nodeModulesDynamicImport.ts] //// + +//// [index.ts] +// cjs format file +export async function main() { + const { readFile } = await import("fs"); +} +//// [index.ts] +// esm format file +export async function main() { + const { readFile } = await import("fs"); +} +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.main = main; +// cjs format file +async function main() { + const { readFile } = await import("fs"); +} +//// [index.js] +// esm format file +export async function main() { + const { readFile } = await import("fs"); +} + + +//// [index.d.ts] +export declare function main(): Promise; +//// [index.d.ts] +export declare function main(): Promise; diff --git a/tests/baselines/reference/nodeModulesDynamicImport(module=node20).symbols b/tests/baselines/reference/nodeModulesDynamicImport(module=node20).symbols new file mode 100644 index 0000000000000..ba5c96124df46 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDynamicImport(module=node20).symbols @@ -0,0 +1,24 @@ +//// [tests/cases/conformance/node/nodeModulesDynamicImport.ts] //// + +=== subfolder/index.ts === +// cjs format file +export async function main() { +>main : Symbol(main, Decl(index.ts, 0, 0)) + + const { readFile } = await import("fs"); +>readFile : Symbol(readFile, Decl(index.ts, 2, 11)) +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) +} +=== index.ts === +// esm format file +export async function main() { +>main : Symbol(main, Decl(index.ts, 0, 0)) + + const { readFile } = await import("fs"); +>readFile : Symbol(readFile, Decl(index.ts, 2, 11)) +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) +} +=== types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesDynamicImport(module=node20).types b/tests/baselines/reference/nodeModulesDynamicImport(module=node20).types new file mode 100644 index 0000000000000..18249dadabb9c --- /dev/null +++ b/tests/baselines/reference/nodeModulesDynamicImport(module=node20).types @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/node/nodeModulesDynamicImport.ts] //// + +=== subfolder/index.ts === +// cjs format file +export async function main() { +>main : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + + const { readFile } = await import("fs"); +>readFile : any +> : ^^^ +>await import("fs") : any +>import("fs") : Promise +> : ^^^^^^^^^^^^ +>"fs" : "fs" +> : ^^^^ +} +=== index.ts === +// esm format file +export async function main() { +>main : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + + const { readFile } = await import("fs"); +>readFile : any +> : ^^^ +>await import("fs") : any +>import("fs") : Promise +> : ^^^^^^^^^^^^ +>"fs" : "fs" +> : ^^^^ +} +=== types.d.ts === +declare module "fs"; +>"fs" : any + diff --git a/tests/baselines/reference/nodeModulesExportAssignments(module=node20).errors.txt b/tests/baselines/reference/nodeModulesExportAssignments(module=node20).errors.txt new file mode 100644 index 0000000000000..edb49c7a61f05 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportAssignments(module=node20).errors.txt @@ -0,0 +1,23 @@ +index.ts(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. + + +==== subfolder/index.ts (0 errors) ==== + // cjs format file + const a = {}; + export = a; +==== index.ts (1 errors) ==== + // esm format file + const a = {}; + export = a; + ~~~~~~~~~~~ +!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportAssignments(module=node20).js b/tests/baselines/reference/nodeModulesExportAssignments(module=node20).js new file mode 100644 index 0000000000000..2d09438ae7cd8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportAssignments(module=node20).js @@ -0,0 +1,38 @@ +//// [tests/cases/conformance/node/nodeModulesExportAssignments.ts] //// + +//// [index.ts] +// cjs format file +const a = {}; +export = a; +//// [index.ts] +// esm format file +const a = {}; +export = a; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +// cjs format file +const a = {}; +module.exports = a; +//// [index.js] +// esm format file +const a = {}; +export {}; + + +//// [index.d.ts] +declare const a: {}; +export = a; +//// [index.d.ts] +declare const a: {}; +export = a; diff --git a/tests/baselines/reference/nodeModulesExportAssignments(module=node20).symbols b/tests/baselines/reference/nodeModulesExportAssignments(module=node20).symbols new file mode 100644 index 0000000000000..97363f05b7a86 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportAssignments(module=node20).symbols @@ -0,0 +1,18 @@ +//// [tests/cases/conformance/node/nodeModulesExportAssignments.ts] //// + +=== subfolder/index.ts === +// cjs format file +const a = {}; +>a : Symbol(a, Decl(index.ts, 1, 5)) + +export = a; +>a : Symbol(a, Decl(index.ts, 1, 5)) + +=== index.ts === +// esm format file +const a = {}; +>a : Symbol(a, Decl(index.ts, 1, 5)) + +export = a; +>a : Symbol(a, Decl(index.ts, 1, 5)) + diff --git a/tests/baselines/reference/nodeModulesExportAssignments(module=node20).types b/tests/baselines/reference/nodeModulesExportAssignments(module=node20).types new file mode 100644 index 0000000000000..bb44573eb15c7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportAssignments(module=node20).types @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/node/nodeModulesExportAssignments.ts] //// + +=== subfolder/index.ts === +// cjs format file +const a = {}; +>a : {} +> : ^^ +>{} : {} +> : ^^ + +export = a; +>a : {} +> : ^^ + +=== index.ts === +// esm format file +const a = {}; +>a : {} +> : ^^ +>{} : {} +> : ^^ + +export = a; +>a : {} +> : ^^ + diff --git a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node20).errors.txt b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node20).errors.txt new file mode 100644 index 0000000000000..7e86097227b3b --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node20).errors.txt @@ -0,0 +1,33 @@ +index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. +index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. + + +==== index.ts (2 errors) ==== + // esm format file + import { Thing } from "inner/other"; + ~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. + export const a = (await import("inner")).x(); + ~ +!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +==== node_modules/inner/index.d.ts (0 errors) ==== + // esm format file + export { x } from "./other.js"; +==== node_modules/inner/other.d.ts (0 errors) ==== + // esm format file + export interface Thing {} + export const x: () => Thing; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "type": "module", + "exports": "./index.js" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node20).js b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node20).js new file mode 100644 index 0000000000000..da6fe0fc80095 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node20).js @@ -0,0 +1,30 @@ +//// [tests/cases/conformance/node/nodeModulesExportsBlocksSpecifierResolution.ts] //// + +//// [index.ts] +// esm format file +import { Thing } from "inner/other"; +export const a = (await import("inner")).x(); +//// [index.d.ts] +// esm format file +export { x } from "./other.js"; +//// [other.d.ts] +// esm format file +export interface Thing {} +export const x: () => Thing; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" +} +//// [package.json] +{ + "name": "inner", + "private": true, + "type": "module", + "exports": "./index.js" +} + +//// [index.js] +export const a = (await import("inner")).x(); diff --git a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node20).symbols b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node20).symbols new file mode 100644 index 0000000000000..91fce59692fb1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node20).symbols @@ -0,0 +1,27 @@ +//// [tests/cases/conformance/node/nodeModulesExportsBlocksSpecifierResolution.ts] //// + +=== index.ts === +// esm format file +import { Thing } from "inner/other"; +>Thing : Symbol(Thing, Decl(index.ts, 1, 8)) + +export const a = (await import("inner")).x(); +>a : Symbol(a, Decl(index.ts, 2, 12)) +>(await import("inner")).x : Symbol(x, Decl(index.d.ts, 1, 8)) +>"inner" : Symbol("node_modules/inner/index", Decl(index.d.ts, 0, 0)) +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + +export const x: () => Thing; +>x : Symbol(x, Decl(other.d.ts, 2, 12)) +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node20).types b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node20).types new file mode 100644 index 0000000000000..dc944e2b96ae6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node20).types @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesExportsBlocksSpecifierResolution.ts] //// + +=== index.ts === +// esm format file +import { Thing } from "inner/other"; +>Thing : any +> : ^^^ + +export const a = (await import("inner")).x(); +>a : import("node_modules/inner/other").Thing +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(await import("inner")).x() : import("node_modules/inner/other").Thing +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(await import("inner")).x : () => import("node_modules/inner/other").Thing +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ +>(await import("inner")) : typeof import("node_modules/inner/index") +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>await import("inner") : typeof import("node_modules/inner/index") +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import("inner") : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"inner" : "inner" +> : ^^^^^^^ +>x : () => import("node_modules/inner/other").Thing +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ + +=== node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : () => import("node_modules/inner/other").Thing +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ + +=== node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +export const x: () => Thing; +>x : () => Thing +> : ^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node20).errors.txt b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node20).errors.txt new file mode 100644 index 0000000000000..a0ed330173ed8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node20).errors.txt @@ -0,0 +1,92 @@ +error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation +/main.cts(1,16): error TS7016: Could not find a declaration file for module 'exports-and-types-versions/foo'. '/node_modules/exports-and-types-versions/dist/foo.js' implicitly has an 'any' type. + If the 'exports-and-types-versions' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'exports-and-types-versions/foo';` +/main.cts(2,16): error TS2307: Cannot find module 'exports-and-types-versions/nope' or its corresponding type declarations. +/main.cts(5,16): error TS2307: Cannot find module 'exports-and-types-versions/versioned-nah' or its corresponding type declarations. +/main.mts(1,16): error TS7016: Could not find a declaration file for module 'exports-and-types-versions/foo'. '/node_modules/exports-and-types-versions/dist/foo.js' implicitly has an 'any' type. + There are types at '/node_modules/exports-and-types-versions/types/foo.d.ts', but this result could not be resolved when respecting package.json "exports". The 'exports-and-types-versions' library may need to update its package.json or typings. +/main.mts(2,16): error TS2307: Cannot find module 'exports-and-types-versions/nope' or its corresponding type declarations. +/main.mts(5,16): error TS2307: Cannot find module 'exports-and-types-versions/versioned-nah' or its corresponding type declarations. + + +!!! error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +==== /node_modules/exports-and-types-versions/package.json (0 errors) ==== + { + "name": "exports-and-types-versions", + "version": "1.0.0", + "exports": { + "./foo": "./dist/foo.js", + "./yep": { + "types": "./types/foo.d.ts", + "default": "./dist/foo.js" + }, + "./versioned-yep": { + "types@>=4": "./types/foo.d.ts" + }, + "./versioned-nah": { + "types@<4": "./types/foo.d.ts" + } + }, + "typesVersions": { + "*": { + "foo": ["./types/foo.d.ts"], + "nope": ["./types/foo.d.ts"], + "versioned-nah": ["./types/foo.d.ts"] + } + } + } + +==== /node_modules/exports-and-types-versions/dist/foo.js (0 errors) ==== + module.exports = {}; + +==== /node_modules/exports-and-types-versions/types/foo.d.ts (0 errors) ==== + export {}; + +==== /node_modules/just-types-versions/package.json (0 errors) ==== + { + "name": "just-types-versions", + "version": "1.0.0", + "typesVersions": { + "*": { + "foo": ["./types/foo.d.ts"] + } + } + } + +==== /node_modules/just-types-versions/types/foo.d.ts (0 errors) ==== + export {}; + +==== /main.cts (3 errors) ==== + import {} from "exports-and-types-versions/foo"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS7016: Could not find a declaration file for module 'exports-and-types-versions/foo'. '/node_modules/exports-and-types-versions/dist/foo.js' implicitly has an 'any' type. +!!! error TS7016: If the 'exports-and-types-versions' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'exports-and-types-versions/foo';` + import {} from "exports-and-types-versions/nope"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'exports-and-types-versions/nope' or its corresponding type declarations. + import {} from "exports-and-types-versions/yep"; + import {} from "exports-and-types-versions/versioned-yep"; + import {} from "exports-and-types-versions/versioned-nah"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'exports-and-types-versions/versioned-nah' or its corresponding type declarations. + import {} from "just-types-versions/foo"; + +==== /main.mts (3 errors) ==== + import {} from "exports-and-types-versions/foo"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS7016: Could not find a declaration file for module 'exports-and-types-versions/foo'. '/node_modules/exports-and-types-versions/dist/foo.js' implicitly has an 'any' type. +!!! error TS7016: There are types at '/node_modules/exports-and-types-versions/types/foo.d.ts', but this result could not be resolved when respecting package.json "exports". The 'exports-and-types-versions' library may need to update its package.json or typings. + import {} from "exports-and-types-versions/nope"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'exports-and-types-versions/nope' or its corresponding type declarations. + import {} from "exports-and-types-versions/yep"; + import {} from "exports-and-types-versions/versioned-yep"; + import {} from "exports-and-types-versions/versioned-nah"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'exports-and-types-versions/versioned-nah' or its corresponding type declarations. + import {} from "just-types-versions/foo"; + \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node20).js b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node20).js new file mode 100644 index 0000000000000..396ca2dfc4bcc --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node20).js @@ -0,0 +1,70 @@ +//// [tests/cases/conformance/node/nodeModulesExportsBlocksTypesVersions.ts] //// + +//// [package.json] +{ + "name": "exports-and-types-versions", + "version": "1.0.0", + "exports": { + "./foo": "./dist/foo.js", + "./yep": { + "types": "./types/foo.d.ts", + "default": "./dist/foo.js" + }, + "./versioned-yep": { + "types@>=4": "./types/foo.d.ts" + }, + "./versioned-nah": { + "types@<4": "./types/foo.d.ts" + } + }, + "typesVersions": { + "*": { + "foo": ["./types/foo.d.ts"], + "nope": ["./types/foo.d.ts"], + "versioned-nah": ["./types/foo.d.ts"] + } + } +} + +//// [foo.js] +module.exports = {}; + +//// [foo.d.ts] +export {}; + +//// [package.json] +{ + "name": "just-types-versions", + "version": "1.0.0", + "typesVersions": { + "*": { + "foo": ["./types/foo.d.ts"] + } + } +} + +//// [foo.d.ts] +export {}; + +//// [main.cts] +import {} from "exports-and-types-versions/foo"; +import {} from "exports-and-types-versions/nope"; +import {} from "exports-and-types-versions/yep"; +import {} from "exports-and-types-versions/versioned-yep"; +import {} from "exports-and-types-versions/versioned-nah"; +import {} from "just-types-versions/foo"; + +//// [main.mts] +import {} from "exports-and-types-versions/foo"; +import {} from "exports-and-types-versions/nope"; +import {} from "exports-and-types-versions/yep"; +import {} from "exports-and-types-versions/versioned-yep"; +import {} from "exports-and-types-versions/versioned-nah"; +import {} from "just-types-versions/foo"; + + +//// [main.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//// [main.mjs] +export {}; diff --git a/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node20).symbols b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node20).symbols new file mode 100644 index 0000000000000..9dc062fedd9a6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node20).symbols @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/node/nodeModulesExportsBlocksTypesVersions.ts] //// + +=== /node_modules/exports-and-types-versions/types/foo.d.ts === + +export {}; + +=== /node_modules/just-types-versions/types/foo.d.ts === + +export {}; + +=== /main.cts === + +import {} from "exports-and-types-versions/foo"; +import {} from "exports-and-types-versions/nope"; +import {} from "exports-and-types-versions/yep"; +import {} from "exports-and-types-versions/versioned-yep"; +import {} from "exports-and-types-versions/versioned-nah"; +import {} from "just-types-versions/foo"; + +=== /main.mts === + +import {} from "exports-and-types-versions/foo"; +import {} from "exports-and-types-versions/nope"; +import {} from "exports-and-types-versions/yep"; +import {} from "exports-and-types-versions/versioned-yep"; +import {} from "exports-and-types-versions/versioned-nah"; +import {} from "just-types-versions/foo"; + diff --git a/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node20).trace.json b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node20).trace.json new file mode 100644 index 0000000000000..10ff0d95c7350 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node20).trace.json @@ -0,0 +1,1136 @@ +[ + "File '/node_modules/exports-and-types-versions/types/package.json' does not exist.", + "Found 'package.json' at '/node_modules/exports-and-types-versions/package.json'.", + "File '/node_modules/just-types-versions/types/package.json' does not exist.", + "Found 'package.json' at '/node_modules/just-types-versions/package.json'.", + "======== Resolving module 'exports-and-types-versions/foo' from '/main.cts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/package.json' does not exist.", + "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Using 'exports' subpath './foo' with target './dist/foo.js'.", + "File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it.", + "File '/node_modules/exports-and-types-versions/dist/foo.ts' does not exist.", + "File '/node_modules/exports-and-types-versions/dist/foo.tsx' does not exist.", + "File '/node_modules/exports-and-types-versions/dist/foo.d.ts' does not exist.", + "Export specifier './foo' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Using 'exports' subpath './foo' with target './dist/foo.js'.", + "File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it.", + "File '/node_modules/exports-and-types-versions/dist/foo.js' exists - use it as a name resolution result.", + "'package.json' does not have a 'peerDependencies' field.", + "Resolving real path for '/node_modules/exports-and-types-versions/dist/foo.js', result '/node_modules/exports-and-types-versions/dist/foo.js'.", + "======== Module name 'exports-and-types-versions/foo' was successfully resolved to '/node_modules/exports-and-types-versions/dist/foo.js' with Package ID 'exports-and-types-versions/dist/foo.js@1.0.0'. ========", + "======== Resolving module 'exports-and-types-versions/nope' from '/main.cts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/package.json' does not exist according to earlier cached lookups.", + "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", + "======== Module name 'exports-and-types-versions/nope' was not resolved. ========", + "======== Resolving module 'exports-and-types-versions/yep' from '/main.cts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/package.json' does not exist according to earlier cached lookups.", + "Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Entering conditional exports.", + "Matched 'exports' condition 'types'.", + "Using 'exports' subpath './yep' with target './types/foo.d.ts'.", + "File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result.", + "Resolved under condition 'types'.", + "Exiting conditional exports.", + "Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'.", + "======== Module name 'exports-and-types-versions/yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions/types/foo.d.ts@1.0.0'. ========", + "======== Resolving module 'exports-and-types-versions/versioned-yep' from '/main.cts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/package.json' does not exist according to earlier cached lookups.", + "Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Entering conditional exports.", + "Matched 'exports' condition 'types@>=4'.", + "Using 'exports' subpath './versioned-yep' with target './types/foo.d.ts'.", + "File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result.", + "Resolved under condition 'types@>=4'.", + "Exiting conditional exports.", + "Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'.", + "======== Module name 'exports-and-types-versions/versioned-yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions/types/foo.d.ts@1.0.0'. ========", + "======== Resolving module 'exports-and-types-versions/versioned-nah' from '/main.cts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/package.json' does not exist according to earlier cached lookups.", + "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Entering conditional exports.", + "Saw non-matching condition 'types@<4'.", + "Exiting conditional exports.", + "Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Entering conditional exports.", + "Saw non-matching condition 'types@<4'.", + "Exiting conditional exports.", + "Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", + "======== Module name 'exports-and-types-versions/versioned-nah' was not resolved. ========", + "======== Resolving module 'just-types-versions/foo' from '/main.cts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/package.json' does not exist according to earlier cached lookups.", + "Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/node_modules/just-types-versions/package.json' exists according to earlier cached lookups.", + "'package.json' has a 'typesVersions' field with version-specific path mappings.", + "'package.json' has a 'typesVersions' entry '*' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'foo'.", + "Module name 'foo', matched pattern 'foo'.", + "Trying substitution './types/foo.d.ts', candidate module location: './types/foo.d.ts'.", + "File '/node_modules/just-types-versions/types/foo.d.ts' exists - use it as a name resolution result.", + "Resolving real path for '/node_modules/just-types-versions/types/foo.d.ts', result '/node_modules/just-types-versions/types/foo.d.ts'.", + "======== Module name 'just-types-versions/foo' was successfully resolved to '/node_modules/just-types-versions/types/foo.d.ts'. ========", + "======== Resolving module 'exports-and-types-versions/foo' from '/main.mts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/package.json' does not exist according to earlier cached lookups.", + "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Using 'exports' subpath './foo' with target './dist/foo.js'.", + "File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it.", + "File '/node_modules/exports-and-types-versions/dist/foo.ts' does not exist.", + "File '/node_modules/exports-and-types-versions/dist/foo.tsx' does not exist.", + "File '/node_modules/exports-and-types-versions/dist/foo.d.ts' does not exist.", + "Export specifier './foo' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Using 'exports' subpath './foo' with target './dist/foo.js'.", + "File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it.", + "File '/node_modules/exports-and-types-versions/dist/foo.js' exists - use it as a name resolution result.", + "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update.", + "File '/package.json' does not exist according to earlier cached lookups.", + "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "'package.json' has a 'typesVersions' field with version-specific path mappings.", + "'package.json' has a 'typesVersions' entry '*' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'foo'.", + "Module name 'foo', matched pattern 'foo'.", + "Trying substitution './types/foo.d.ts', candidate module location: './types/foo.d.ts'.", + "File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result.", + "Resolving real path for '/node_modules/exports-and-types-versions/dist/foo.js', result '/node_modules/exports-and-types-versions/dist/foo.js'.", + "======== Module name 'exports-and-types-versions/foo' was successfully resolved to '/node_modules/exports-and-types-versions/dist/foo.js' with Package ID 'exports-and-types-versions/dist/foo.js@1.0.0'. ========", + "======== Resolving module 'exports-and-types-versions/nope' from '/main.mts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/package.json' does not exist according to earlier cached lookups.", + "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", + "======== Module name 'exports-and-types-versions/nope' was not resolved. ========", + "======== Resolving module 'exports-and-types-versions/yep' from '/main.mts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/package.json' does not exist according to earlier cached lookups.", + "Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Entering conditional exports.", + "Matched 'exports' condition 'types'.", + "Using 'exports' subpath './yep' with target './types/foo.d.ts'.", + "File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result.", + "Resolved under condition 'types'.", + "Exiting conditional exports.", + "Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'.", + "======== Module name 'exports-and-types-versions/yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions/types/foo.d.ts@1.0.0'. ========", + "======== Resolving module 'exports-and-types-versions/versioned-yep' from '/main.mts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/package.json' does not exist according to earlier cached lookups.", + "Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Entering conditional exports.", + "Matched 'exports' condition 'types@>=4'.", + "Using 'exports' subpath './versioned-yep' with target './types/foo.d.ts'.", + "File '/node_modules/exports-and-types-versions/types/foo.d.ts' exists - use it as a name resolution result.", + "Resolved under condition 'types@>=4'.", + "Exiting conditional exports.", + "Resolving real path for '/node_modules/exports-and-types-versions/types/foo.d.ts', result '/node_modules/exports-and-types-versions/types/foo.d.ts'.", + "======== Module name 'exports-and-types-versions/versioned-yep' was successfully resolved to '/node_modules/exports-and-types-versions/types/foo.d.ts' with Package ID 'exports-and-types-versions/types/foo.d.ts@1.0.0'. ========", + "======== Resolving module 'exports-and-types-versions/versioned-nah' from '/main.mts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/package.json' does not exist according to earlier cached lookups.", + "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Entering conditional exports.", + "Saw non-matching condition 'types@<4'.", + "Exiting conditional exports.", + "Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", + "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", + "Entering conditional exports.", + "Saw non-matching condition 'types@<4'.", + "Exiting conditional exports.", + "Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", + "======== Module name 'exports-and-types-versions/versioned-nah' was not resolved. ========", + "======== Resolving module 'just-types-versions/foo' from '/main.mts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/package.json' does not exist according to earlier cached lookups.", + "Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/node_modules/just-types-versions/package.json' exists according to earlier cached lookups.", + "'package.json' has a 'typesVersions' entry '*' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'foo'.", + "Module name 'foo', matched pattern 'foo'.", + "Trying substitution './types/foo.d.ts', candidate module location: './types/foo.d.ts'.", + "File '/node_modules/just-types-versions/types/foo.d.ts' exists - use it as a name resolution result.", + "Resolving real path for '/node_modules/just-types-versions/types/foo.d.ts', result '/node_modules/just-types-versions/types/foo.d.ts'.", + "======== Module name 'just-types-versions/foo' was successfully resolved to '/node_modules/just-types-versions/types/foo.d.ts'. ========", + "File '/.ts/package.json' does not exist.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2023' from '/.src/__lib_node_modules_lookup_lib.es2023.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023'", + "Loading module '@typescript/lib-es2023' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022' from '/.src/__lib_node_modules_lookup_lib.es2022.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022'", + "Loading module '@typescript/lib-es2022' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021' from '/.src/__lib_node_modules_lookup_lib.es2021.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021'", + "Loading module '@typescript/lib-es2021' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020' from '/.src/__lib_node_modules_lookup_lib.es2020.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020'", + "Loading module '@typescript/lib-es2020' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019' from '/.src/__lib_node_modules_lookup_lib.es2019.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019'", + "Loading module '@typescript/lib-es2019' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018' from '/.src/__lib_node_modules_lookup_lib.es2018.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018'", + "Loading module '@typescript/lib-es2018' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017' from '/.src/__lib_node_modules_lookup_lib.es2017.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017'", + "Loading module '@typescript/lib-es2017' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2016' from '/.src/__lib_node_modules_lookup_lib.es2016.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2016' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016'", + "Loading module '@typescript/lib-es2016' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2016' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015' from '/.src/__lib_node_modules_lookup_lib.es2015.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015'", + "Loading module '@typescript/lib-es2015' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es5'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es5'", + "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es5' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-decorators' from '/.src/__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators'", + "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-decorators' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-decorators/legacy' from '/.src/__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators/legacy'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators/legacy'", + "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/core' from '/.src/__lib_node_modules_lookup_lib.es2015.core.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/core' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/core'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/core'", + "Loading module '@typescript/lib-es2015/core' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/core' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/collection' from '/.src/__lib_node_modules_lookup_lib.es2015.collection.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/collection' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/collection'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/collection'", + "Loading module '@typescript/lib-es2015/collection' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/collection' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/iterable' from '/.src/__lib_node_modules_lookup_lib.es2015.iterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/iterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/iterable'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/iterable'", + "Loading module '@typescript/lib-es2015/iterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/iterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/symbol' from '/.src/__lib_node_modules_lookup_lib.es2015.symbol.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/symbol' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol'", + "Loading module '@typescript/lib-es2015/symbol' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/symbol' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/generator' from '/.src/__lib_node_modules_lookup_lib.es2015.generator.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/generator' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/generator'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/generator'", + "Loading module '@typescript/lib-es2015/generator' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/generator' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/promise' from '/.src/__lib_node_modules_lookup_lib.es2015.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/promise'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/promise'", + "Loading module '@typescript/lib-es2015/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/proxy' from '/.src/__lib_node_modules_lookup_lib.es2015.proxy.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/proxy' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/proxy'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/proxy'", + "Loading module '@typescript/lib-es2015/proxy' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/proxy' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/reflect' from '/.src/__lib_node_modules_lookup_lib.es2015.reflect.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/reflect' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/reflect'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/reflect'", + "Loading module '@typescript/lib-es2015/reflect' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/reflect' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/symbol-wellknown' from '/.src/__lib_node_modules_lookup_lib.es2015.symbol.wellknown.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/symbol-wellknown' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol-wellknown'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol-wellknown'", + "Loading module '@typescript/lib-es2015/symbol-wellknown' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/symbol-wellknown' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2016/array-include' from '/.src/__lib_node_modules_lookup_lib.es2016.array.include.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2016/array-include' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/array-include'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/array-include'", + "Loading module '@typescript/lib-es2016/array-include' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2016/array-include' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2016/intl' from '/.src/__lib_node_modules_lookup_lib.es2016.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2016/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/intl'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/intl'", + "Loading module '@typescript/lib-es2016/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2016/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/arraybuffer' from '/.src/__lib_node_modules_lookup_lib.es2017.arraybuffer.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/arraybuffer' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/arraybuffer'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/arraybuffer'", + "Loading module '@typescript/lib-es2017/arraybuffer' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/arraybuffer' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/date' from '/.src/__lib_node_modules_lookup_lib.es2017.date.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/date' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/date'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/date'", + "Loading module '@typescript/lib-es2017/date' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/date' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/intl' from '/.src/__lib_node_modules_lookup_lib.es2017.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/intl'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/intl'", + "Loading module '@typescript/lib-es2017/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/object' from '/.src/__lib_node_modules_lookup_lib.es2017.object.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/object' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/object'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/object'", + "Loading module '@typescript/lib-es2017/object' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/object' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/sharedmemory' from '/.src/__lib_node_modules_lookup_lib.es2017.sharedmemory.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/sharedmemory' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/sharedmemory'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/sharedmemory'", + "Loading module '@typescript/lib-es2017/sharedmemory' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/sharedmemory' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/string' from '/.src/__lib_node_modules_lookup_lib.es2017.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/string'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/string'", + "Loading module '@typescript/lib-es2017/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/typedarrays' from '/.src/__lib_node_modules_lookup_lib.es2017.typedarrays.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/typedarrays' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/typedarrays'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/typedarrays'", + "Loading module '@typescript/lib-es2017/typedarrays' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/typedarrays' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/asynciterable' from '/.src/__lib_node_modules_lookup_lib.es2018.asynciterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/asynciterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asynciterable'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asynciterable'", + "Loading module '@typescript/lib-es2018/asynciterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/asynciterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/asyncgenerator' from '/.src/__lib_node_modules_lookup_lib.es2018.asyncgenerator.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/asyncgenerator' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asyncgenerator'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asyncgenerator'", + "Loading module '@typescript/lib-es2018/asyncgenerator' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/asyncgenerator' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/promise' from '/.src/__lib_node_modules_lookup_lib.es2018.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/promise'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/promise'", + "Loading module '@typescript/lib-es2018/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/regexp' from '/.src/__lib_node_modules_lookup_lib.es2018.regexp.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/regexp' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/regexp'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/regexp'", + "Loading module '@typescript/lib-es2018/regexp' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/regexp' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/intl' from '/.src/__lib_node_modules_lookup_lib.es2018.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/intl'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/intl'", + "Loading module '@typescript/lib-es2018/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/array' from '/.src/__lib_node_modules_lookup_lib.es2019.array.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/array' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/array'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/array'", + "Loading module '@typescript/lib-es2019/array' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/array' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/object' from '/.src/__lib_node_modules_lookup_lib.es2019.object.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/object' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/object'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/object'", + "Loading module '@typescript/lib-es2019/object' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/object' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/string' from '/.src/__lib_node_modules_lookup_lib.es2019.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/string'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/string'", + "Loading module '@typescript/lib-es2019/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/symbol' from '/.src/__lib_node_modules_lookup_lib.es2019.symbol.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/symbol' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/symbol'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/symbol'", + "Loading module '@typescript/lib-es2019/symbol' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/symbol' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/intl' from '/.src/__lib_node_modules_lookup_lib.es2019.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/intl'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/intl'", + "Loading module '@typescript/lib-es2019/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/bigint' from '/.src/__lib_node_modules_lookup_lib.es2020.bigint.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/bigint' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/bigint'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/bigint'", + "Loading module '@typescript/lib-es2020/bigint' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/bigint' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/intl' from '/.src/__lib_node_modules_lookup_lib.es2020.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/intl'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/intl'", + "Loading module '@typescript/lib-es2020/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/date' from '/.src/__lib_node_modules_lookup_lib.es2020.date.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/date' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/date'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/date'", + "Loading module '@typescript/lib-es2020/date' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/date' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/number' from '/.src/__lib_node_modules_lookup_lib.es2020.number.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/number' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/number'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/number'", + "Loading module '@typescript/lib-es2020/number' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/number' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/promise' from '/.src/__lib_node_modules_lookup_lib.es2020.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/promise'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/promise'", + "Loading module '@typescript/lib-es2020/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/sharedmemory' from '/.src/__lib_node_modules_lookup_lib.es2020.sharedmemory.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/sharedmemory' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/sharedmemory'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/sharedmemory'", + "Loading module '@typescript/lib-es2020/sharedmemory' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/sharedmemory' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/string' from '/.src/__lib_node_modules_lookup_lib.es2020.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/string'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/string'", + "Loading module '@typescript/lib-es2020/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/symbol-wellknown' from '/.src/__lib_node_modules_lookup_lib.es2020.symbol.wellknown.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/symbol-wellknown' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/symbol-wellknown'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/symbol-wellknown'", + "Loading module '@typescript/lib-es2020/symbol-wellknown' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/symbol-wellknown' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/promise' from '/.src/__lib_node_modules_lookup_lib.es2021.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/promise'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/promise'", + "Loading module '@typescript/lib-es2021/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/string' from '/.src/__lib_node_modules_lookup_lib.es2021.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/string'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/string'", + "Loading module '@typescript/lib-es2021/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/weakref' from '/.src/__lib_node_modules_lookup_lib.es2021.weakref.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/weakref' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/weakref'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/weakref'", + "Loading module '@typescript/lib-es2021/weakref' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/weakref' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/intl' from '/.src/__lib_node_modules_lookup_lib.es2021.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/intl'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/intl'", + "Loading module '@typescript/lib-es2021/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/array' from '/.src/__lib_node_modules_lookup_lib.es2022.array.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/array' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/array'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/array'", + "Loading module '@typescript/lib-es2022/array' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/array' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/error' from '/.src/__lib_node_modules_lookup_lib.es2022.error.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/error' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/error'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/error'", + "Loading module '@typescript/lib-es2022/error' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/error' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/intl' from '/.src/__lib_node_modules_lookup_lib.es2022.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/intl'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/intl'", + "Loading module '@typescript/lib-es2022/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/object' from '/.src/__lib_node_modules_lookup_lib.es2022.object.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/object' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/object'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/object'", + "Loading module '@typescript/lib-es2022/object' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/object' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/regexp' from '/.src/__lib_node_modules_lookup_lib.es2022.regexp.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/regexp' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/regexp'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/regexp'", + "Loading module '@typescript/lib-es2022/regexp' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/regexp' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/string' from '/.src/__lib_node_modules_lookup_lib.es2022.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/string'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/string'", + "Loading module '@typescript/lib-es2022/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2023/array' from '/.src/__lib_node_modules_lookup_lib.es2023.array.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/array' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/array'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/array'", + "Loading module '@typescript/lib-es2023/array' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/array' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2023/collection' from '/.src/__lib_node_modules_lookup_lib.es2023.collection.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/collection' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/collection'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/collection'", + "Loading module '@typescript/lib-es2023/collection' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom'", + "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-webworker/importscripts' from '/.src/__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-webworker/importscripts'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-webworker/importscripts'", + "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-scripthost' from '/.src/__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-scripthost'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-scripthost'", + "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-scripthost' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-dom/iterable' from '/.src/__lib_node_modules_lookup_lib.dom.iterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom/iterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/iterable'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/iterable'", + "Loading module '@typescript/lib-dom/iterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom/iterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-dom/asynciterable' from '/.src/__lib_node_modules_lookup_lib.dom.asynciterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom/asynciterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/asynciterable'", + "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/asynciterable'", + "Loading module '@typescript/lib-dom/asynciterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom/asynciterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups." +] \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node20).types b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node20).types new file mode 100644 index 0000000000000..9dc062fedd9a6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node20).types @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/node/nodeModulesExportsBlocksTypesVersions.ts] //// + +=== /node_modules/exports-and-types-versions/types/foo.d.ts === + +export {}; + +=== /node_modules/just-types-versions/types/foo.d.ts === + +export {}; + +=== /main.cts === + +import {} from "exports-and-types-versions/foo"; +import {} from "exports-and-types-versions/nope"; +import {} from "exports-and-types-versions/yep"; +import {} from "exports-and-types-versions/versioned-yep"; +import {} from "exports-and-types-versions/versioned-nah"; +import {} from "just-types-versions/foo"; + +=== /main.mts === + +import {} from "exports-and-types-versions/foo"; +import {} from "exports-and-types-versions/nope"; +import {} from "exports-and-types-versions/yep"; +import {} from "exports-and-types-versions/versioned-yep"; +import {} from "exports-and-types-versions/versioned-nah"; +import {} from "just-types-versions/foo"; + diff --git a/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json index f2e892254f6e0..d74063ea6a7ea 100644 --- a/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json +++ b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json @@ -7,7 +7,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'require', 'types', 'node'.", "File '/package.json' does not exist.", - "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './foo' with target './dist/foo.js'.", @@ -17,7 +17,7 @@ "File '/node_modules/exports-and-types-versions/dist/foo.d.ts' does not exist.", "Export specifier './foo' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './foo' with target './dist/foo.js'.", "File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it.", @@ -29,12 +29,12 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'require', 'types', 'node'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "======== Module name 'exports-and-types-versions/nope' was not resolved. ========", @@ -42,7 +42,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'require', 'types', 'node'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Entering conditional exports.", @@ -57,7 +57,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'require', 'types', 'node'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Entering conditional exports.", @@ -72,7 +72,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'require', 'types', 'node'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Entering conditional exports.", @@ -80,7 +80,7 @@ "Exiting conditional exports.", "Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Entering conditional exports.", "Saw non-matching condition 'types@<4'.", @@ -91,7 +91,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'require', 'types', 'node'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/node_modules/just-types-versions/package.json' exists according to earlier cached lookups.", "'package.json' has a 'typesVersions' field with version-specific path mappings.", @@ -105,7 +105,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'import', 'types', 'node'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './foo' with target './dist/foo.js'.", @@ -115,7 +115,7 @@ "File '/node_modules/exports-and-types-versions/dist/foo.d.ts' does not exist.", "Export specifier './foo' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './foo' with target './dist/foo.js'.", "File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it.", @@ -136,12 +136,12 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'import', 'types', 'node'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "======== Module name 'exports-and-types-versions/nope' was not resolved. ========", @@ -149,7 +149,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'import', 'types', 'node'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Entering conditional exports.", @@ -164,7 +164,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'import', 'types', 'node'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Entering conditional exports.", @@ -179,7 +179,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'import', 'types', 'node'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Entering conditional exports.", @@ -187,7 +187,7 @@ "Exiting conditional exports.", "Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Entering conditional exports.", "Saw non-matching condition 'types@<4'.", @@ -198,7 +198,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'import', 'types', 'node'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/node_modules/just-types-versions/package.json' exists according to earlier cached lookups.", "'package.json' has a 'typesVersions' entry '*' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'foo'.", diff --git a/tests/baselines/reference/nodeModulesExportsDoubleAsterisk(module=node20).errors.txt b/tests/baselines/reference/nodeModulesExportsDoubleAsterisk(module=node20).errors.txt new file mode 100644 index 0000000000000..1ab8b6bb276e0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsDoubleAsterisk(module=node20).errors.txt @@ -0,0 +1,21 @@ +/main.mts(1,16): error TS2307: Cannot find module 'double-asterisk/a/*/b/*/c/*' or its corresponding type declarations. + + +==== /node_modules/double-asterisk/package.json (0 errors) ==== + { + "name": "double-asterisk", + "version": "1.0.0", + "type": "module", + "exports": { + "./a/*/b/*/c/*": "./example.js" + } + } + +==== /node_modules/double-asterisk/example.d.ts (0 errors) ==== + export {}; + +==== /main.mts (1 errors) ==== + import {} from "double-asterisk/a/*/b/*/c/*"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'double-asterisk/a/*/b/*/c/*' or its corresponding type declarations. + \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsSourceTs(module=node20).errors.txt b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node20).errors.txt new file mode 100644 index 0000000000000..358a0e61437a1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node20).errors.txt @@ -0,0 +1,34 @@ +index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. +index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. + + +==== index.ts (2 errors) ==== + // esm format file + import { Thing } from "inner/other"; + ~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. + export const a = (await import("inner")).x(); + ~ +!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. + import {a as a2} from "package"; +==== node_modules/inner/index.ts (0 errors) ==== + // esm format file + export { x } from "./other.js"; +==== node_modules/inner/other.ts (0 errors) ==== + // esm format file + export interface Thing {} + export const x: () => Thing = null as any; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.ts" + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "type": "module", + "exports": "./index.ts" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsSourceTs(module=node20).js b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node20).js new file mode 100644 index 0000000000000..b6f1adda8d33c --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node20).js @@ -0,0 +1,44 @@ +//// [tests/cases/conformance/node/nodeModulesExportsSourceTs.ts] //// + +//// [index.ts] +// esm format file +import { Thing } from "inner/other"; +export const a = (await import("inner")).x(); +import {a as a2} from "package"; +//// [index.ts] +// esm format file +export { x } from "./other.js"; +//// [other.ts] +// esm format file +export interface Thing {} +export const x: () => Thing = null as any; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.ts" +} +//// [package.json] +{ + "name": "inner", + "private": true, + "type": "module", + "exports": "./index.ts" +} + +//// [other.js] +export const x = null; +//// [index.js] +// esm format file +export { x } from "./other.js"; +//// [index.js] +export const a = (await import("inner")).x(); + + +//// [other.d.ts] +export interface Thing { +} +export declare const x: () => Thing; +//// [index.d.ts] +export { x } from "./other.js"; diff --git a/tests/baselines/reference/nodeModulesExportsSourceTs(module=node20).symbols b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node20).symbols new file mode 100644 index 0000000000000..182723309687c --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node20).symbols @@ -0,0 +1,31 @@ +//// [tests/cases/conformance/node/nodeModulesExportsSourceTs.ts] //// + +=== index.ts === +// esm format file +import { Thing } from "inner/other"; +>Thing : Symbol(Thing, Decl(index.ts, 1, 8)) + +export const a = (await import("inner")).x(); +>a : Symbol(a, Decl(index.ts, 2, 12)) +>(await import("inner")).x : Symbol(x, Decl(index.ts, 1, 8)) +>"inner" : Symbol("node_modules/inner/index", Decl(index.ts, 0, 0)) +>x : Symbol(x, Decl(index.ts, 1, 8)) + +import {a as a2} from "package"; +>a : Symbol(a, Decl(index.ts, 2, 12)) +>a2 : Symbol(a2, Decl(index.ts, 3, 8)) + +=== node_modules/inner/index.ts === +// esm format file +export { x } from "./other.js"; +>x : Symbol(x, Decl(index.ts, 1, 8)) + +=== node_modules/inner/other.ts === +// esm format file +export interface Thing {} +>Thing : Symbol(Thing, Decl(other.ts, 0, 0)) + +export const x: () => Thing = null as any; +>x : Symbol(x, Decl(other.ts, 2, 12)) +>Thing : Symbol(Thing, Decl(other.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesExportsSourceTs(module=node20).types b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node20).types new file mode 100644 index 0000000000000..880b84aad2d77 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node20).types @@ -0,0 +1,47 @@ +//// [tests/cases/conformance/node/nodeModulesExportsSourceTs.ts] //// + +=== index.ts === +// esm format file +import { Thing } from "inner/other"; +>Thing : any +> : ^^^ + +export const a = (await import("inner")).x(); +>a : import("node_modules/inner/other").Thing +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(await import("inner")).x() : import("node_modules/inner/other").Thing +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(await import("inner")).x : () => import("node_modules/inner/other").Thing +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ +>(await import("inner")) : typeof import("node_modules/inner/index") +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>await import("inner") : typeof import("node_modules/inner/index") +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import("inner") : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"inner" : "inner" +> : ^^^^^^^ +>x : () => import("node_modules/inner/other").Thing +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ + +import {a as a2} from "package"; +>a : import("node_modules/inner/other").Thing +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>a2 : import("node_modules/inner/other").Thing +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.ts === +// esm format file +export { x } from "./other.js"; +>x : () => import("node_modules/inner/other").Thing +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ + +=== node_modules/inner/other.ts === +// esm format file +export interface Thing {} +export const x: () => Thing = null as any; +>x : () => Thing +> : ^^^^^^ +>null as any : any +> : ^^^ + diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node20).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node20).errors.txt new file mode 100644 index 0000000000000..08ce05322d3bc --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node20).errors.txt @@ -0,0 +1,37 @@ +index.ts(2,23): error TS2307: Cannot find module 'inner/other.js' or its corresponding type declarations. + + +==== index.ts (1 errors) ==== + // esm format file + import { Thing } from "inner/other.js"; // should fail + ~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/other.js' or its corresponding type declarations. + export const a = (await import("inner")).x(); +==== node_modules/inner/index.d.ts (0 errors) ==== + // esm format file + export { x } from "./other.js"; +==== node_modules/inner/other.d.ts (0 errors) ==== + // esm format file + export interface Thing {} + export const x: () => Thing; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "type": "module", + "exports": { + ".": { + "default": "./index.js" + }, + "./other": { + "default": "./other.js" + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node20).js b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node20).js new file mode 100644 index 0000000000000..5db58ae2f7bfa --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node20).js @@ -0,0 +1,41 @@ +//// [tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationConditions.ts] //// + +//// [index.ts] +// esm format file +import { Thing } from "inner/other.js"; // should fail +export const a = (await import("inner")).x(); +//// [index.d.ts] +// esm format file +export { x } from "./other.js"; +//// [other.d.ts] +// esm format file +export interface Thing {} +export const x: () => Thing; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" +} +//// [package.json] +{ + "name": "inner", + "private": true, + "type": "module", + "exports": { + ".": { + "default": "./index.js" + }, + "./other": { + "default": "./other.js" + } + } +} + +//// [index.js] +export const a = (await import("inner")).x(); + + +//// [index.d.ts] +export declare const a: import("inner/other").Thing; diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node20).symbols b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node20).symbols new file mode 100644 index 0000000000000..d429eab9b497f --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node20).symbols @@ -0,0 +1,27 @@ +//// [tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationConditions.ts] //// + +=== index.ts === +// esm format file +import { Thing } from "inner/other.js"; // should fail +>Thing : Symbol(Thing, Decl(index.ts, 1, 8)) + +export const a = (await import("inner")).x(); +>a : Symbol(a, Decl(index.ts, 2, 12)) +>(await import("inner")).x : Symbol(x, Decl(index.d.ts, 1, 8)) +>"inner" : Symbol("node_modules/inner/index", Decl(index.d.ts, 0, 0)) +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + +export const x: () => Thing; +>x : Symbol(x, Decl(other.d.ts, 2, 12)) +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node20).types b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node20).types new file mode 100644 index 0000000000000..d62dfd1155d03 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node20).types @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationConditions.ts] //// + +=== index.ts === +// esm format file +import { Thing } from "inner/other.js"; // should fail +>Thing : any +> : ^^^ + +export const a = (await import("inner")).x(); +>a : import("node_modules/inner/other").Thing +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(await import("inner")).x() : import("node_modules/inner/other").Thing +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(await import("inner")).x : () => import("node_modules/inner/other").Thing +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ +>(await import("inner")) : typeof import("node_modules/inner/index") +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>await import("inner") : typeof import("node_modules/inner/index") +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import("inner") : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"inner" : "inner" +> : ^^^^^^^ +>x : () => import("node_modules/inner/other").Thing +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ + +=== node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : () => import("node_modules/inner/other").Thing +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ + +=== node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +export const x: () => Thing; +>x : () => Thing +> : ^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node20).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node20).errors.txt new file mode 100644 index 0000000000000..f7015dbf604c1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node20).errors.txt @@ -0,0 +1,32 @@ +index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. + + +==== index.ts (1 errors) ==== + // esm format file + import { Thing } from "inner/other"; + ~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. + export const a = (await import("inner/index.js")).x(); +==== node_modules/inner/index.d.ts (0 errors) ==== + // esm format file + export { x } from "./other.js"; +==== node_modules/inner/other.d.ts (0 errors) ==== + // esm format file + export interface Thing {} + export const x: () => Thing; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "type": "module", + "exports": { + "./": "./" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node20).js b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node20).js new file mode 100644 index 0000000000000..c0d6b006b33cf --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node20).js @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationDirectory.ts] //// + +//// [index.ts] +// esm format file +import { Thing } from "inner/other"; +export const a = (await import("inner/index.js")).x(); +//// [index.d.ts] +// esm format file +export { x } from "./other.js"; +//// [other.d.ts] +// esm format file +export interface Thing {} +export const x: () => Thing; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" +} +//// [package.json] +{ + "name": "inner", + "private": true, + "type": "module", + "exports": { + "./": "./" + } +} + +//// [index.js] +export const a = (await import("inner/index.js")).x(); + + +//// [index.d.ts] +export declare const a: import("inner/other.js").Thing; diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node20).symbols b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node20).symbols new file mode 100644 index 0000000000000..6fd6d1a29cedd --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node20).symbols @@ -0,0 +1,27 @@ +//// [tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationDirectory.ts] //// + +=== index.ts === +// esm format file +import { Thing } from "inner/other"; +>Thing : Symbol(Thing, Decl(index.ts, 1, 8)) + +export const a = (await import("inner/index.js")).x(); +>a : Symbol(a, Decl(index.ts, 2, 12)) +>(await import("inner/index.js")).x : Symbol(x, Decl(index.d.ts, 1, 8)) +>"inner/index.js" : Symbol("node_modules/inner/index", Decl(index.d.ts, 0, 0)) +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + +export const x: () => Thing; +>x : Symbol(x, Decl(other.d.ts, 2, 12)) +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node20).types b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node20).types new file mode 100644 index 0000000000000..034994f0ff8bb --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node20).types @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationDirectory.ts] //// + +=== index.ts === +// esm format file +import { Thing } from "inner/other"; +>Thing : any +> : ^^^ + +export const a = (await import("inner/index.js")).x(); +>a : import("node_modules/inner/other").Thing +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(await import("inner/index.js")).x() : import("node_modules/inner/other").Thing +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(await import("inner/index.js")).x : () => import("node_modules/inner/other").Thing +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ +>(await import("inner/index.js")) : typeof import("node_modules/inner/index") +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>await import("inner/index.js") : typeof import("node_modules/inner/index") +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import("inner/index.js") : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"inner/index.js" : "inner/index.js" +> : ^^^^^^^^^^^^^^^^ +>x : () => import("node_modules/inner/other").Thing +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ + +=== node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : () => import("node_modules/inner/other").Thing +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ + +=== node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +export const x: () => Thing; +>x : () => Thing +> : ^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node20).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node20).errors.txt new file mode 100644 index 0000000000000..002881ca1c0e7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node20).errors.txt @@ -0,0 +1,32 @@ +index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. + + +==== index.ts (1 errors) ==== + // esm format file + import { Thing } from "inner/other"; + ~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. + export const a = (await import("inner/index.js")).x(); +==== node_modules/inner/index.d.ts (0 errors) ==== + // esm format file + export { x } from "./other.js"; +==== node_modules/inner/other.d.ts (0 errors) ==== + // esm format file + export interface Thing {} + export const x: () => Thing; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "type": "module", + "exports": { + "./*.js": "./*.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node20).js b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node20).js new file mode 100644 index 0000000000000..dcdd62bed698d --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node20).js @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationPattern.ts] //// + +//// [index.ts] +// esm format file +import { Thing } from "inner/other"; +export const a = (await import("inner/index.js")).x(); +//// [index.d.ts] +// esm format file +export { x } from "./other.js"; +//// [other.d.ts] +// esm format file +export interface Thing {} +export const x: () => Thing; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" +} +//// [package.json] +{ + "name": "inner", + "private": true, + "type": "module", + "exports": { + "./*.js": "./*.js" + } +} + +//// [index.js] +export const a = (await import("inner/index.js")).x(); + + +//// [index.d.ts] +export declare const a: import("inner/other.js").Thing; diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node20).symbols b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node20).symbols new file mode 100644 index 0000000000000..7429733b3c4f6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node20).symbols @@ -0,0 +1,27 @@ +//// [tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationPattern.ts] //// + +=== index.ts === +// esm format file +import { Thing } from "inner/other"; +>Thing : Symbol(Thing, Decl(index.ts, 1, 8)) + +export const a = (await import("inner/index.js")).x(); +>a : Symbol(a, Decl(index.ts, 2, 12)) +>(await import("inner/index.js")).x : Symbol(x, Decl(index.d.ts, 1, 8)) +>"inner/index.js" : Symbol("node_modules/inner/index", Decl(index.d.ts, 0, 0)) +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + +export const x: () => Thing; +>x : Symbol(x, Decl(other.d.ts, 2, 12)) +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node20).types b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node20).types new file mode 100644 index 0000000000000..78367ad6e9714 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node20).types @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationPattern.ts] //// + +=== index.ts === +// esm format file +import { Thing } from "inner/other"; +>Thing : any +> : ^^^ + +export const a = (await import("inner/index.js")).x(); +>a : import("node_modules/inner/other").Thing +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(await import("inner/index.js")).x() : import("node_modules/inner/other").Thing +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(await import("inner/index.js")).x : () => import("node_modules/inner/other").Thing +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ +>(await import("inner/index.js")) : typeof import("node_modules/inner/index") +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>await import("inner/index.js") : typeof import("node_modules/inner/index") +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import("inner/index.js") : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"inner/index.js" : "inner/index.js" +> : ^^^^^^^^^^^^^^^^ +>x : () => import("node_modules/inner/other").Thing +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ + +=== node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : () => import("node_modules/inner/other").Thing +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ + +=== node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +export const x: () => Thing; +>x : () => Thing +> : ^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node20).errors.txt b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node20).errors.txt new file mode 100644 index 0000000000000..e338028b93522 --- /dev/null +++ b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node20).errors.txt @@ -0,0 +1,139 @@ +index.cts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +index.cts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +index.cts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +index.mts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +index.mts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +index.mts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +subfolder/index.cts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +subfolder/index.cts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +subfolder/index.cts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +subfolder/index.mts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +subfolder/index.mts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +subfolder/index.mts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +subfolder2/another/index.cts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +subfolder2/another/index.cts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +subfolder2/another/index.cts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +subfolder2/another/index.mts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +subfolder2/another/index.mts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +subfolder2/another/index.mts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +subfolder2/index.cts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +subfolder2/index.cts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +subfolder2/index.cts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +subfolder2/index.mts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +subfolder2/index.mts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +subfolder2/index.mts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + + +==== subfolder/index.ts (0 errors) ==== + // cjs format file + const x = () => (void 0); + export {x}; +==== subfolder/index.cts (3 errors) ==== + // cjs format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== subfolder/index.mts (3 errors) ==== + // esm format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== subfolder2/index.ts (0 errors) ==== + // cjs format file + const x = () => (void 0); + export {x}; +==== subfolder2/index.cts (3 errors) ==== + // cjs format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== subfolder2/index.mts (3 errors) ==== + // esm format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== subfolder2/another/index.ts (0 errors) ==== + // esm format file + const x = () => (void 0); + export {x}; +==== subfolder2/another/index.mts (3 errors) ==== + // esm format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== subfolder2/another/index.cts (3 errors) ==== + // cjs format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== index.mts (3 errors) ==== + // esm format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== index.cts (3 errors) ==== + // cjs format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== index.ts (0 errors) ==== + // esm format file + const x = () => (void 0); + export {x}; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== subfolder2/package.json (0 errors) ==== + { + } +==== subfolder2/another/package.json (0 errors) ==== + { + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node20).js b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node20).js new file mode 100644 index 0000000000000..4cca6af5a58d7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node20).js @@ -0,0 +1,172 @@ +//// [tests/cases/conformance/node/nodeModulesForbidenSyntax.ts] //// + +//// [index.ts] +// cjs format file +const x = () => (void 0); +export {x}; +//// [index.cts] +// cjs format file +const x = () => (void 0); +export {x}; +//// [index.mts] +// esm format file +const x = () => (void 0); +export {x}; +//// [index.ts] +// cjs format file +const x = () => (void 0); +export {x}; +//// [index.cts] +// cjs format file +const x = () => (void 0); +export {x}; +//// [index.mts] +// esm format file +const x = () => (void 0); +export {x}; +//// [index.ts] +// esm format file +const x = () => (void 0); +export {x}; +//// [index.mts] +// esm format file +const x = () => (void 0); +export {x}; +//// [index.cts] +// cjs format file +const x = () => (void 0); +export {x}; +//// [index.mts] +// esm format file +const x = () => (void 0); +export {x}; +//// [index.cts] +// cjs format file +const x = () => (void 0); +export {x}; +//// [index.ts] +// esm format file +const x = () => (void 0); +export {x}; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [package.json] +{ +} +//// [package.json] +{ + "type": "module" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = () => (void 0); +exports.x = x; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = () => (void 0); +exports.x = x; +//// [index.mjs] +// esm format file +const x = () => (void 0); +export { x }; +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = () => (void 0); +exports.x = x; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = () => (void 0); +exports.x = x; +//// [index.mjs] +// esm format file +const x = () => (void 0); +export { x }; +//// [index.js] +// esm format file +const x = () => (void 0); +export { x }; +//// [index.mjs] +// esm format file +const x = () => (void 0); +export { x }; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = () => (void 0); +exports.x = x; +//// [index.mjs] +// esm format file +const x = () => (void 0); +export { x }; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = () => (void 0); +exports.x = x; +//// [index.js] +// esm format file +const x = () => (void 0); +export { x }; + + +//// [index.d.ts] +declare const x: () => T; +export { x }; +//// [index.d.cts] +declare const x: () => T; +export { x }; +//// [index.d.mts] +declare const x: () => T; +export { x }; +//// [index.d.ts] +declare const x: () => T; +export { x }; +//// [index.d.cts] +declare const x: () => T; +export { x }; +//// [index.d.mts] +declare const x: () => T; +export { x }; +//// [index.d.ts] +declare const x: () => T; +export { x }; +//// [index.d.mts] +declare const x: () => T; +export { x }; +//// [index.d.cts] +declare const x: () => T; +export { x }; +//// [index.d.mts] +declare const x: () => T; +export { x }; +//// [index.d.cts] +declare const x: () => T; +export { x }; +//// [index.d.ts] +declare const x: () => T; +export { x }; diff --git a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node20).symbols b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node20).symbols new file mode 100644 index 0000000000000..6283085cda132 --- /dev/null +++ b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node20).symbols @@ -0,0 +1,122 @@ +//// [tests/cases/conformance/node/nodeModulesForbidenSyntax.ts] //// + +=== subfolder/index.ts === +// cjs format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.ts, 1, 5)) +>T : Symbol(T, Decl(index.ts, 1, 11)) +>T : Symbol(T, Decl(index.ts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +=== subfolder/index.cts === +// cjs format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.cts, 1, 5)) +>T : Symbol(T, Decl(index.cts, 1, 11)) +>T : Symbol(T, Decl(index.cts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.cts, 2, 8)) + +=== subfolder/index.mts === +// esm format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.mts, 1, 5)) +>T : Symbol(T, Decl(index.mts, 1, 11)) +>T : Symbol(T, Decl(index.mts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.mts, 2, 8)) + +=== subfolder2/index.ts === +// cjs format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.ts, 1, 5)) +>T : Symbol(T, Decl(index.ts, 1, 11)) +>T : Symbol(T, Decl(index.ts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +=== subfolder2/index.cts === +// cjs format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.cts, 1, 5)) +>T : Symbol(T, Decl(index.cts, 1, 11)) +>T : Symbol(T, Decl(index.cts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.cts, 2, 8)) + +=== subfolder2/index.mts === +// esm format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.mts, 1, 5)) +>T : Symbol(T, Decl(index.mts, 1, 11)) +>T : Symbol(T, Decl(index.mts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.mts, 2, 8)) + +=== subfolder2/another/index.ts === +// esm format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.ts, 1, 5)) +>T : Symbol(T, Decl(index.ts, 1, 11)) +>T : Symbol(T, Decl(index.ts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +=== subfolder2/another/index.mts === +// esm format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.mts, 1, 5)) +>T : Symbol(T, Decl(index.mts, 1, 11)) +>T : Symbol(T, Decl(index.mts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.mts, 2, 8)) + +=== subfolder2/another/index.cts === +// cjs format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.cts, 1, 5)) +>T : Symbol(T, Decl(index.cts, 1, 11)) +>T : Symbol(T, Decl(index.cts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.cts, 2, 8)) + +=== index.mts === +// esm format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.mts, 1, 5)) +>T : Symbol(T, Decl(index.mts, 1, 11)) +>T : Symbol(T, Decl(index.mts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.mts, 2, 8)) + +=== index.cts === +// cjs format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.cts, 1, 5)) +>T : Symbol(T, Decl(index.cts, 1, 11)) +>T : Symbol(T, Decl(index.cts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.cts, 2, 8)) + +=== index.ts === +// esm format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.ts, 1, 5)) +>T : Symbol(T, Decl(index.ts, 1, 11)) +>T : Symbol(T, Decl(index.ts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + diff --git a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node20).types b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node20).types new file mode 100644 index 0000000000000..ff52c1dedd1b3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node20).types @@ -0,0 +1,266 @@ +//// [tests/cases/conformance/node/nodeModulesForbidenSyntax.ts] //// + +=== subfolder/index.ts === +// cjs format file +const x = () => (void 0); +>x : () => T +> : ^ ^^^^^^^ +>() => (void 0) : () => T +> : ^ ^^^^^^^ +>(void 0) : T +> : ^ +>(void 0) : any +> : ^^^ +>(void 0) : undefined +> : ^^^^^^^^^ +>void 0 : undefined +> : ^^^^^^^^^ +>0 : 0 +> : ^ + +export {x}; +>x : () => T +> : ^ ^^^^^^^ + +=== subfolder/index.cts === +// cjs format file +const x = () => (void 0); +>x : () => T +> : ^ ^^^^^^^ +>() => (void 0) : () => T +> : ^ ^^^^^^^ +>(void 0) : T +> : ^ +>(void 0) : any +> : ^^^ +>(void 0) : undefined +> : ^^^^^^^^^ +>void 0 : undefined +> : ^^^^^^^^^ +>0 : 0 +> : ^ + +export {x}; +>x : () => T +> : ^ ^^^^^^^ + +=== subfolder/index.mts === +// esm format file +const x = () => (void 0); +>x : () => T +> : ^ ^^^^^^^ +>() => (void 0) : () => T +> : ^ ^^^^^^^ +>(void 0) : T +> : ^ +>(void 0) : any +> : ^^^ +>(void 0) : undefined +> : ^^^^^^^^^ +>void 0 : undefined +> : ^^^^^^^^^ +>0 : 0 +> : ^ + +export {x}; +>x : () => T +> : ^ ^^^^^^^ + +=== subfolder2/index.ts === +// cjs format file +const x = () => (void 0); +>x : () => T +> : ^ ^^^^^^^ +>() => (void 0) : () => T +> : ^ ^^^^^^^ +>(void 0) : T +> : ^ +>(void 0) : any +> : ^^^ +>(void 0) : undefined +> : ^^^^^^^^^ +>void 0 : undefined +> : ^^^^^^^^^ +>0 : 0 +> : ^ + +export {x}; +>x : () => T +> : ^ ^^^^^^^ + +=== subfolder2/index.cts === +// cjs format file +const x = () => (void 0); +>x : () => T +> : ^ ^^^^^^^ +>() => (void 0) : () => T +> : ^ ^^^^^^^ +>(void 0) : T +> : ^ +>(void 0) : any +> : ^^^ +>(void 0) : undefined +> : ^^^^^^^^^ +>void 0 : undefined +> : ^^^^^^^^^ +>0 : 0 +> : ^ + +export {x}; +>x : () => T +> : ^ ^^^^^^^ + +=== subfolder2/index.mts === +// esm format file +const x = () => (void 0); +>x : () => T +> : ^ ^^^^^^^ +>() => (void 0) : () => T +> : ^ ^^^^^^^ +>(void 0) : T +> : ^ +>(void 0) : any +> : ^^^ +>(void 0) : undefined +> : ^^^^^^^^^ +>void 0 : undefined +> : ^^^^^^^^^ +>0 : 0 +> : ^ + +export {x}; +>x : () => T +> : ^ ^^^^^^^ + +=== subfolder2/another/index.ts === +// esm format file +const x = () => (void 0); +>x : () => T +> : ^ ^^^^^^^ +>() => (void 0) : () => T +> : ^ ^^^^^^^ +>(void 0) : T +> : ^ +>(void 0) : any +> : ^^^ +>(void 0) : undefined +> : ^^^^^^^^^ +>void 0 : undefined +> : ^^^^^^^^^ +>0 : 0 +> : ^ + +export {x}; +>x : () => T +> : ^ ^^^^^^^ + +=== subfolder2/another/index.mts === +// esm format file +const x = () => (void 0); +>x : () => T +> : ^ ^^^^^^^ +>() => (void 0) : () => T +> : ^ ^^^^^^^ +>(void 0) : T +> : ^ +>(void 0) : any +> : ^^^ +>(void 0) : undefined +> : ^^^^^^^^^ +>void 0 : undefined +> : ^^^^^^^^^ +>0 : 0 +> : ^ + +export {x}; +>x : () => T +> : ^ ^^^^^^^ + +=== subfolder2/another/index.cts === +// cjs format file +const x = () => (void 0); +>x : () => T +> : ^ ^^^^^^^ +>() => (void 0) : () => T +> : ^ ^^^^^^^ +>(void 0) : T +> : ^ +>(void 0) : any +> : ^^^ +>(void 0) : undefined +> : ^^^^^^^^^ +>void 0 : undefined +> : ^^^^^^^^^ +>0 : 0 +> : ^ + +export {x}; +>x : () => T +> : ^ ^^^^^^^ + +=== index.mts === +// esm format file +const x = () => (void 0); +>x : () => T +> : ^ ^^^^^^^ +>() => (void 0) : () => T +> : ^ ^^^^^^^ +>(void 0) : T +> : ^ +>(void 0) : any +> : ^^^ +>(void 0) : undefined +> : ^^^^^^^^^ +>void 0 : undefined +> : ^^^^^^^^^ +>0 : 0 +> : ^ + +export {x}; +>x : () => T +> : ^ ^^^^^^^ + +=== index.cts === +// cjs format file +const x = () => (void 0); +>x : () => T +> : ^ ^^^^^^^ +>() => (void 0) : () => T +> : ^ ^^^^^^^ +>(void 0) : T +> : ^ +>(void 0) : any +> : ^^^ +>(void 0) : undefined +> : ^^^^^^^^^ +>void 0 : undefined +> : ^^^^^^^^^ +>0 : 0 +> : ^ + +export {x}; +>x : () => T +> : ^ ^^^^^^^ + +=== index.ts === +// esm format file +const x = () => (void 0); +>x : () => T +> : ^ ^^^^^^^ +>() => (void 0) : () => T +> : ^ ^^^^^^^ +>(void 0) : T +> : ^ +>(void 0) : any +> : ^^^ +>(void 0) : undefined +> : ^^^^^^^^^ +>void 0 : undefined +> : ^^^^^^^^^ +>0 : 0 +> : ^ + +export {x}; +>x : () => T +> : ^ ^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node20).errors.txt b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node20).errors.txt new file mode 100644 index 0000000000000..6f76f35748756 --- /dev/null +++ b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node20).errors.txt @@ -0,0 +1,38 @@ +subfolder/index.ts(2,10): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. +subfolder/index.ts(3,7): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. +subfolder/index.ts(4,7): error TS2725: Class name cannot be 'Object' when targeting ES5 with module Node20. +subfolder/index.ts(5,14): error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. + + +==== subfolder/index.ts (4 errors) ==== + // cjs format file + function require() {} + ~~~~~~~ +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. + const exports = {}; + ~~~~~~~ +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. + class Object {} + ~~~~~~ +!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module Node20. + export const __esModule = false; + ~~~~~~~~~~ +!!! error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. + export {require, exports, Object}; +==== index.ts (0 errors) ==== + // esm format file + function require() {} + const exports = {}; + class Object {} + export const __esModule = false; + export {require, exports, Object}; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node20).js b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node20).js new file mode 100644 index 0000000000000..3b196cd32c98b --- /dev/null +++ b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node20).js @@ -0,0 +1,64 @@ +//// [tests/cases/conformance/node/nodeModulesGeneratedNameCollisions.ts] //// + +//// [index.ts] +// cjs format file +function require() {} +const exports = {}; +class Object {} +export const __esModule = false; +export {require, exports, Object}; +//// [index.ts] +// esm format file +function require() {} +const exports = {}; +class Object {} +export const __esModule = false; +export {require, exports, Object}; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Object = exports.exports = exports.__esModule = void 0; +exports.require = require; +// cjs format file +function require() { } +const exports = {}; +exports.exports = exports; +class Object { +} +exports.Object = Object; +exports.__esModule = false; +//// [index.js] +// esm format file +function require() { } +const exports = {}; +class Object { +} +export const __esModule = false; +export { require, exports, Object }; + + +//// [index.d.ts] +declare function require(): void; +declare const exports: {}; +declare class Object { +} +export declare const __esModule = false; +export { require, exports, Object }; +//// [index.d.ts] +declare function require(): void; +declare const exports: {}; +declare class Object { +} +export declare const __esModule = false; +export { require, exports, Object }; diff --git a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node20).symbols b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node20).symbols new file mode 100644 index 0000000000000..a30d4a614f899 --- /dev/null +++ b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node20).symbols @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/node/nodeModulesGeneratedNameCollisions.ts] //// + +=== subfolder/index.ts === +// cjs format file +function require() {} +>require : Symbol(require, Decl(index.ts, 0, 0)) + +const exports = {}; +>exports : Symbol(exports, Decl(index.ts, 2, 5)) + +class Object {} +>Object : Symbol(Object, Decl(index.ts, 2, 19)) + +export const __esModule = false; +>__esModule : Symbol(__esModule, Decl(index.ts, 4, 12)) + +export {require, exports, Object}; +>require : Symbol(require, Decl(index.ts, 5, 8)) +>exports : Symbol(exports, Decl(index.ts, 5, 16)) +>Object : Symbol(Object, Decl(index.ts, 5, 25)) + +=== index.ts === +// esm format file +function require() {} +>require : Symbol(require, Decl(index.ts, 0, 0)) + +const exports = {}; +>exports : Symbol(exports, Decl(index.ts, 2, 5)) + +class Object {} +>Object : Symbol(Object, Decl(index.ts, 2, 19)) + +export const __esModule = false; +>__esModule : Symbol(__esModule, Decl(index.ts, 4, 12)) + +export {require, exports, Object}; +>require : Symbol(require, Decl(index.ts, 5, 8)) +>exports : Symbol(exports, Decl(index.ts, 5, 16)) +>Object : Symbol(Object, Decl(index.ts, 5, 25)) + diff --git a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node20).types b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node20).types new file mode 100644 index 0000000000000..c1875847654cd --- /dev/null +++ b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node20).types @@ -0,0 +1,62 @@ +//// [tests/cases/conformance/node/nodeModulesGeneratedNameCollisions.ts] //// + +=== subfolder/index.ts === +// cjs format file +function require() {} +>require : () => void +> : ^^^^^^^^^^ + +const exports = {}; +>exports : {} +> : ^^ +>{} : {} +> : ^^ + +class Object {} +>Object : Object +> : ^^^^^^ + +export const __esModule = false; +>__esModule : false +> : ^^^^^ +>false : false +> : ^^^^^ + +export {require, exports, Object}; +>require : () => void +> : ^^^^^^^^^^ +>exports : {} +> : ^^ +>Object : typeof Object +> : ^^^^^^^^^^^^^ + +=== index.ts === +// esm format file +function require() {} +>require : () => void +> : ^^^^^^^^^^ + +const exports = {}; +>exports : {} +> : ^^ +>{} : {} +> : ^^ + +class Object {} +>Object : Object +> : ^^^^^^ + +export const __esModule = false; +>__esModule : false +> : ^^^^^ +>false : false +> : ^^^^^ + +export {require, exports, Object}; +>require : () => void +> : ^^^^^^^^^^ +>exports : {} +> : ^^ +>Object : typeof Object +> : ^^^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportAssertions(module=node16).errors.txt index 87c7929eb2580..fd0b3b9ea497a 100644 --- a/tests/baselines/reference/nodeModulesImportAssertions(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=node16).errors.txt @@ -1,15 +1,15 @@ -index.ts(1,35): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -otherc.cts(1,35): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +index.ts(1,35): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +otherc.cts(1,35): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== index.ts (1 errors) ==== import json from "./package.json" assert { type: "json" }; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== otherc.cts (1 errors) ==== import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine ==== package.json (0 errors) ==== { diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=node20).errors.txt b/tests/baselines/reference/nodeModulesImportAssertions(module=node20).errors.txt new file mode 100644 index 0000000000000..1b09957ba0b0d --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=node20).errors.txt @@ -0,0 +1,19 @@ +index.ts(1,35): error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. +otherc.cts(1,35): error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. + + +==== index.ts (1 errors) ==== + import json from "./package.json" assert { type: "json" }; + ~~~~~~ +!!! error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. +==== otherc.cts (1 errors) ==== + import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions + ~~~~~~ +!!! error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. + const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine +==== package.json (0 errors) ==== + { + "name": "pkg", + "private": true, + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=node20).js b/tests/baselines/reference/nodeModulesImportAssertions(module=node20).js new file mode 100644 index 0000000000000..091166d523cd1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=node20).js @@ -0,0 +1,20 @@ +//// [tests/cases/conformance/node/nodeModulesImportAssertions.ts] //// + +//// [index.ts] +import json from "./package.json" assert { type: "json" }; +//// [otherc.cts] +import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions +const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine +//// [package.json] +{ + "name": "pkg", + "private": true, + "type": "module" +} + +//// [index.js] +export {}; +//// [otherc.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=node20).symbols b/tests/baselines/reference/nodeModulesImportAssertions(module=node20).symbols new file mode 100644 index 0000000000000..881cb771218da --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=node20).symbols @@ -0,0 +1,27 @@ +//// [tests/cases/conformance/node/nodeModulesImportAssertions.ts] //// + +=== index.ts === +import json from "./package.json" assert { type: "json" }; +>json : Symbol(json, Decl(index.ts, 0, 6)) + +=== otherc.cts === +import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions +>json : Symbol(json, Decl(otherc.cts, 0, 6)) + +const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine +>json2 : Symbol(json2, Decl(otherc.cts, 1, 5)) +>"./package.json" : Symbol("package", Decl(package.json, 0, 0)) +>assert : Symbol(assert, Decl(otherc.cts, 1, 40)) +>type : Symbol(type, Decl(otherc.cts, 1, 50)) + +=== package.json === +{ + "name": "pkg", +>"name" : Symbol("name", Decl(package.json, 0, 1)) + + "private": true, +>"private" : Symbol("private", Decl(package.json, 1, 18)) + + "type": "module" +>"type" : Symbol("type", Decl(package.json, 2, 20)) +} diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=node20).types b/tests/baselines/reference/nodeModulesImportAssertions(module=node20).types new file mode 100644 index 0000000000000..9780c35bba0cc --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=node20).types @@ -0,0 +1,57 @@ +//// [tests/cases/conformance/node/nodeModulesImportAssertions.ts] //// + +=== index.ts === +import json from "./package.json" assert { type: "json" }; +>json : { name: string; private: boolean; type: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>type : any +> : ^^^ + +=== otherc.cts === +import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions +>json : { name: string; private: boolean; type: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>type : any +> : ^^^ + +const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine +>json2 : Promise<{ default: { name: string; private: boolean; type: string; }; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import("./package.json", { assert: { type: "json" } }) : Promise<{ default: { name: string; private: boolean; type: string; }; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"./package.json" : "./package.json" +> : ^^^^^^^^^^^^^^^^ +>{ assert: { type: "json" } } : { assert: { type: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>assert : { type: string; } +> : ^^^^^^^^^^^^^^^^^ +>{ type: "json" } : { type: string; } +> : ^^^^^^^^^^^^^^^^^ +>type : string +> : ^^^^^^ +>"json" : "json" +> : ^^^^^^ + +=== package.json === +{ +>{ "name": "pkg", "private": true, "type": "module"} : { name: string; private: boolean; type: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + "name": "pkg", +>"name" : string +> : ^^^^^^ +>"pkg" : "pkg" +> : ^^^^^ + + "private": true, +>"private" : boolean +> : ^^^^^^^ +>true : true +> : ^^^^ + + "type": "module" +>"type" : string +> : ^^^^^^ +>"module" : "module" +> : ^^^^^^^^ +} diff --git a/tests/baselines/reference/nodeModulesImportAssignments(module=node20).js b/tests/baselines/reference/nodeModulesImportAssignments(module=node20).js new file mode 100644 index 0000000000000..c73ff1177a58e --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssignments(module=node20).js @@ -0,0 +1,65 @@ +//// [tests/cases/conformance/node/nodeModulesImportAssignments.ts] //// + +//// [index.ts] +// cjs format file +import fs = require("fs"); +fs.readFile; +export import fs2 = require("fs"); +//// [index.ts] +// esm format file +import fs = require("fs"); +fs.readFile; +export import fs2 = require("fs"); +//// [file.ts] +// esm format file +const __require = null; +const _createRequire = null; +import fs = require("fs"); +fs.readFile; +export import fs2 = require("fs"); +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const fs = require("fs"); +fs.readFile; +exports.fs2 = require("fs"); +//// [index.js] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +// esm format file +const fs = __require("fs"); +fs.readFile; +const fs2 = __require("fs"); +export { fs2 }; +//// [file.js] +import { createRequire as _createRequire_1 } from "module"; +const __require_1 = _createRequire_1(import.meta.url); +// esm format file +const __require = null; +const _createRequire = null; +const fs = __require_1("fs"); +fs.readFile; +const fs2 = __require_1("fs"); +export { fs2 }; + + +//// [index.d.ts] +export import fs2 = require("fs"); +//// [index.d.ts] +export import fs2 = require("fs"); +//// [file.d.ts] +export import fs2 = require("fs"); diff --git a/tests/baselines/reference/nodeModulesImportAssignments(module=node20).symbols b/tests/baselines/reference/nodeModulesImportAssignments(module=node20).symbols new file mode 100644 index 0000000000000..0833a1e78f70d --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssignments(module=node20).symbols @@ -0,0 +1,45 @@ +//// [tests/cases/conformance/node/nodeModulesImportAssignments.ts] //// + +=== subfolder/index.ts === +// cjs format file +import fs = require("fs"); +>fs : Symbol(fs, Decl(index.ts, 0, 0)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.ts, 0, 0)) + +export import fs2 = require("fs"); +>fs2 : Symbol(fs2, Decl(index.ts, 2, 12)) + +=== index.ts === +// esm format file +import fs = require("fs"); +>fs : Symbol(fs, Decl(index.ts, 0, 0)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.ts, 0, 0)) + +export import fs2 = require("fs"); +>fs2 : Symbol(fs2, Decl(index.ts, 2, 12)) + +=== file.ts === +// esm format file +const __require = null; +>__require : Symbol(__require, Decl(file.ts, 1, 5)) + +const _createRequire = null; +>_createRequire : Symbol(_createRequire, Decl(file.ts, 2, 5)) + +import fs = require("fs"); +>fs : Symbol(fs, Decl(file.ts, 2, 28)) + +fs.readFile; +>fs : Symbol(fs, Decl(file.ts, 2, 28)) + +export import fs2 = require("fs"); +>fs2 : Symbol(fs2, Decl(file.ts, 4, 12)) + +=== types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportAssignments(module=node20).types b/tests/baselines/reference/nodeModulesImportAssignments(module=node20).types new file mode 100644 index 0000000000000..f73668aaa7a8f --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssignments(module=node20).types @@ -0,0 +1,63 @@ +//// [tests/cases/conformance/node/nodeModulesImportAssignments.ts] //// + +=== subfolder/index.ts === +// cjs format file +import fs = require("fs"); +>fs : any +> : ^^^ + +fs.readFile; +>fs.readFile : any +>fs : any +> : ^^^ +>readFile : any +> : ^^^ + +export import fs2 = require("fs"); +>fs2 : any +> : ^^^ + +=== index.ts === +// esm format file +import fs = require("fs"); +>fs : any +> : ^^^ + +fs.readFile; +>fs.readFile : any +>fs : any +> : ^^^ +>readFile : any +> : ^^^ + +export import fs2 = require("fs"); +>fs2 : any +> : ^^^ + +=== file.ts === +// esm format file +const __require = null; +>__require : any + +const _createRequire = null; +>_createRequire : any + +import fs = require("fs"); +>fs : any +> : ^^^ + +fs.readFile; +>fs.readFile : any +>fs : any +> : ^^^ +>readFile : any +> : ^^^ + +export import fs2 = require("fs"); +>fs2 : any +> : ^^^ + +=== types.d.ts === +declare module "fs"; +>"fs" : any + diff --git a/tests/baselines/reference/nodeModulesImportAttributes(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportAttributes(module=node16).errors.txt index 5d2fe738900b5..0e3d535577812 100644 --- a/tests/baselines/reference/nodeModulesImportAttributes(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=node16).errors.txt @@ -1,15 +1,15 @@ -index.ts(1,35): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -otherc.cts(1,35): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +index.ts(1,35): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +otherc.cts(1,35): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== index.ts (1 errors) ==== import json from "./package.json" with { type: "json" }; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== otherc.cts (1 errors) ==== import json from "./package.json" with { type: "json" }; // should error, cjs mode imports don't support attributes ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. const json2 = import("./package.json", { with: { type: "json" } }); // should be fine ==== package.json (0 errors) ==== { diff --git a/tests/baselines/reference/nodeModulesImportAttributes(module=node20).errors.txt b/tests/baselines/reference/nodeModulesImportAttributes(module=node20).errors.txt new file mode 100644 index 0000000000000..8f85517984cb6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=node20).errors.txt @@ -0,0 +1,17 @@ +otherc.cts(1,35): error TS2856: Import attributes are not allowed on statements that compile to CommonJS 'require' calls. + + +==== index.ts (0 errors) ==== + import json from "./package.json" with { type: "json" }; +==== otherc.cts (1 errors) ==== + import json from "./package.json" with { type: "json" }; // should error, cjs mode imports don't support attributes + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2856: Import attributes are not allowed on statements that compile to CommonJS 'require' calls. + const json2 = import("./package.json", { with: { type: "json" } }); // should be fine +==== package.json (0 errors) ==== + { + "name": "pkg", + "private": true, + "type": "module" + } + \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAttributes(module=node20).js b/tests/baselines/reference/nodeModulesImportAttributes(module=node20).js new file mode 100644 index 0000000000000..fb3984fd32c68 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=node20).js @@ -0,0 +1,21 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributes.ts] //// + +//// [index.ts] +import json from "./package.json" with { type: "json" }; +//// [otherc.cts] +import json from "./package.json" with { type: "json" }; // should error, cjs mode imports don't support attributes +const json2 = import("./package.json", { with: { type: "json" } }); // should be fine +//// [package.json] +{ + "name": "pkg", + "private": true, + "type": "module" +} + + +//// [index.js] +export {}; +//// [otherc.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const json2 = import("./package.json", { with: { type: "json" } }); // should be fine diff --git a/tests/baselines/reference/nodeModulesImportAttributes(module=node20).symbols b/tests/baselines/reference/nodeModulesImportAttributes(module=node20).symbols new file mode 100644 index 0000000000000..6666db3e5b459 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=node20).symbols @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributes.ts] //// + +=== index.ts === +import json from "./package.json" with { type: "json" }; +>json : Symbol(json, Decl(index.ts, 0, 6)) + +=== otherc.cts === +import json from "./package.json" with { type: "json" }; // should error, cjs mode imports don't support attributes +>json : Symbol(json, Decl(otherc.cts, 0, 6)) + +const json2 = import("./package.json", { with: { type: "json" } }); // should be fine +>json2 : Symbol(json2, Decl(otherc.cts, 1, 5)) +>"./package.json" : Symbol("package", Decl(package.json, 0, 0)) +>with : Symbol(with, Decl(otherc.cts, 1, 40)) +>type : Symbol(type, Decl(otherc.cts, 1, 48)) + +=== package.json === +{ + "name": "pkg", +>"name" : Symbol("name", Decl(package.json, 0, 1)) + + "private": true, +>"private" : Symbol("private", Decl(package.json, 1, 18)) + + "type": "module" +>"type" : Symbol("type", Decl(package.json, 2, 20)) +} + diff --git a/tests/baselines/reference/nodeModulesImportAttributes(module=node20).types b/tests/baselines/reference/nodeModulesImportAttributes(module=node20).types new file mode 100644 index 0000000000000..6f07805d83b53 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=node20).types @@ -0,0 +1,58 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributes.ts] //// + +=== index.ts === +import json from "./package.json" with { type: "json" }; +>json : { name: string; private: boolean; type: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>type : any +> : ^^^ + +=== otherc.cts === +import json from "./package.json" with { type: "json" }; // should error, cjs mode imports don't support attributes +>json : { name: string; private: boolean; type: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>type : any +> : ^^^ + +const json2 = import("./package.json", { with: { type: "json" } }); // should be fine +>json2 : Promise<{ default: { name: string; private: boolean; type: string; }; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import("./package.json", { with: { type: "json" } }) : Promise<{ default: { name: string; private: boolean; type: string; }; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"./package.json" : "./package.json" +> : ^^^^^^^^^^^^^^^^ +>{ with: { type: "json" } } : { with: { type: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>with : { type: string; } +> : ^^^^^^^^^^^^^^^^^ +>{ type: "json" } : { type: string; } +> : ^^^^^^^^^^^^^^^^^ +>type : string +> : ^^^^^^ +>"json" : "json" +> : ^^^^^^ + +=== package.json === +{ +>{ "name": "pkg", "private": true, "type": "module"} : { name: string; private: boolean; type: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + "name": "pkg", +>"name" : string +> : ^^^^^^ +>"pkg" : "pkg" +> : ^^^^^ + + "private": true, +>"private" : boolean +> : ^^^^^^^ +>true : true +> : ^^^^ + + "type": "module" +>"type" : string +> : ^^^^^^ +>"module" : "module" +> : ^^^^^^^^ +} + diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).errors.txt index dc92388a5f008..3e2efccd7764f 100644 --- a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).errors.txt @@ -1,6 +1,6 @@ -/index.ts(6,50): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +/index.ts(6,50): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. /index.ts(7,14): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. -/index.ts(7,49): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +/index.ts(7,49): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== /index.ts (3 errors) ==== @@ -11,12 +11,12 @@ import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; ~~~~~~~~~~~~~~~ !!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export interface Loc extends Req, Imp {} export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node20).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node20).errors.txt new file mode 100644 index 0000000000000..bf4698ad28e95 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node20).errors.txt @@ -0,0 +1,37 @@ +/index.ts(6,50): error TS2856: Import attributes are not allowed on statements that compile to CommonJS 'require' calls. +/index.ts(7,14): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. +/index.ts(7,49): error TS2856: Import attributes are not allowed on statements that compile to CommonJS 'require' calls. + + +==== /index.ts (3 errors) ==== + import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; + import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + + export interface LocalInterface extends RequireInterface, ImportInterface {} + + import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2856: Import attributes are not allowed on statements that compile to CommonJS 'require' calls. + import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2856: Import attributes are not allowed on statements that compile to CommonJS 'require' calls. + export interface Loc extends Req, Imp {} + + export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; + export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node20).js b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node20).js new file mode 100644 index 0000000000000..7175dbf9479d7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node20).js @@ -0,0 +1,45 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [index.d.ts] +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +export interface LocalInterface extends RequireInterface, ImportInterface { +} +import { type RequireInterface as Req } from "pkg" with { "resolution-mode": "require" }; +import { type ImportInterface as Imp } from "pkg" with { "resolution-mode": "import" }; +export interface Loc extends Req, Imp { +} +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node20).symbols b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node20).symbols new file mode 100644 index 0000000000000..b2c93c67d55e4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node20).symbols @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) + +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +export interface LocalInterface extends RequireInterface, ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 1, 80)) +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) + +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export interface Loc extends Req, Imp {} +>Loc : Symbol(Loc, Decl(index.ts, 6, 85)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 9, 13)) + +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 10, 13)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node20).types b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node20).types new file mode 100644 index 0000000000000..107dc1327d766 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node20).types @@ -0,0 +1,41 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : RequireInterface +> : ^^^^^^^^^^^^^^^^ + +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : ImportInterface +> : ^^^^^^^^^^^^^^^ + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : any +> : ^^^ +>Req : any +> : ^^^ + +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : any +> : ^^^ +>Imp : any +> : ^^^ + +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : RequireInterface +> : ^^^^^^^^^^^^^^^^ + +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : ImportInterface +> : ^^^^^^^^^^^^^^^ + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).errors.txt index 1bd8e26f0ac51..374290f2fe1fc 100644 --- a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).errors.txt @@ -1,6 +1,6 @@ /index.ts(6,14): error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. -/index.ts(6,50): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -/index.ts(7,49): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +/index.ts(6,50): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +/index.ts(7,49): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== /index.ts (3 errors) ==== @@ -13,10 +13,10 @@ ~~~~~~~~~~~~~~~~ !!! error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export interface Loc extends Req, Imp {} export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node20).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node20).errors.txt new file mode 100644 index 0000000000000..5c93150f88f13 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node20).errors.txt @@ -0,0 +1,42 @@ +/index.ts(6,14): error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. +/index.ts(6,50): error TS1454: `resolution-mode` can only be set for type-only imports. +/index.ts(7,49): error TS1454: `resolution-mode` can only be set for type-only imports. + + +==== /index.ts (3 errors) ==== + import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; + import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + + export interface LocalInterface extends RequireInterface, ImportInterface {} + + import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1454: `resolution-mode` can only be set for type-only imports. + import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1454: `resolution-mode` can only be set for type-only imports. + export interface Loc extends Req, Imp {} + + export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; + export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} +==== /package.json (0 errors) ==== + { + "private": true, + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node20).js b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node20).js new file mode 100644 index 0000000000000..afe399f85b0ad --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node20).js @@ -0,0 +1,49 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [index.ts] +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + + +//// [index.js] +export {}; + + +//// [index.d.ts] +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +export interface LocalInterface extends RequireInterface, ImportInterface { +} +import { type RequireInterface as Req } from "pkg" with { "resolution-mode": "require" }; +import { type ImportInterface as Imp } from "pkg" with { "resolution-mode": "import" }; +export interface Loc extends Req, Imp { +} +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node20).symbols b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node20).symbols new file mode 100644 index 0000000000000..d76777ff60b36 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node20).symbols @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) + +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +export interface LocalInterface extends RequireInterface, ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 1, 80)) +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +>Req : Symbol(Req, Decl(index.ts, 5, 8)) + +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export interface Loc extends Req, Imp {} +>Loc : Symbol(Loc, Decl(index.ts, 6, 85)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 9, 13)) + +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 10, 13)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node20).types b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node20).types new file mode 100644 index 0000000000000..79bd80a1c7f46 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node20).types @@ -0,0 +1,41 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : RequireInterface +> : ^^^^^^^^^^^^^^^^ + +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : ImportInterface +> : ^^^^^^^^^^^^^^^ + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : any +> : ^^^ +>Req : any +> : ^^^ + +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : any +> : ^^^ +>Imp : any +> : ^^^ + +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : RequireInterface +> : ^^^^^^^^^^^^^^^^ + +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : ImportInterface +> : ^^^^^^^^^^^^^^^ + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).errors.txt index 4bd1844e4824d..9a813ef6db3fa 100644 --- a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).errors.txt @@ -1,15 +1,15 @@ -/index.ts(2,45): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +/index.ts(2,45): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. /index.ts(2,71): error TS1453: `resolution-mode` should be either `require` or `import`. /index.ts(4,10): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. -/index.ts(4,39): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -/index.ts(6,76): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +/index.ts(4,39): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +/index.ts(6,76): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== /index.ts (5 errors) ==== // incorrect mode import type { RequireInterface } from "pkg" with { "resolution-mode": "foobar" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ~~~~~~~~ !!! error TS1453: `resolution-mode` should be either `require` or `import`. // not type-only @@ -17,11 +17,11 @@ ~~~~~~~~~~~~~~~ !!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. // not exclusively type-only import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" with { "resolution-mode": "require" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export interface LocalInterface extends RequireInterface, ImportInterface {} diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node20).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node20).errors.txt new file mode 100644 index 0000000000000..c45ca1322b3a8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node20).errors.txt @@ -0,0 +1,43 @@ +/index.ts(2,45): error TS2856: Import attributes are not allowed on statements that compile to CommonJS 'require' calls. +/index.ts(2,71): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(4,10): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. +/index.ts(4,39): error TS2856: Import attributes are not allowed on statements that compile to CommonJS 'require' calls. +/index.ts(6,76): error TS2856: Import attributes are not allowed on statements that compile to CommonJS 'require' calls. + + +==== /index.ts (5 errors) ==== + // incorrect mode + import type { RequireInterface } from "pkg" with { "resolution-mode": "foobar" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2856: Import attributes are not allowed on statements that compile to CommonJS 'require' calls. + ~~~~~~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + // not type-only + import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2856: Import attributes are not allowed on statements that compile to CommonJS 'require' calls. + // not exclusively type-only + import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" with { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2856: Import attributes are not allowed on statements that compile to CommonJS 'require' calls. + + export interface LocalInterface extends RequireInterface, ImportInterface {} + + + + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node20).js b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node20).js new file mode 100644 index 0000000000000..988072b042c93 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node20).js @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +// incorrect mode +import type { RequireInterface } from "pkg" with { "resolution-mode": "foobar" }; +// not type-only +import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" with { "resolution-mode": "require" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + + + + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [index.d.ts] +import type { RequireInterface } from "pkg"; +import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +export interface LocalInterface extends RequireInterface, ImportInterface { +} diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node20).symbols b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node20).symbols new file mode 100644 index 0000000000000..33a5f17944412 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node20).symbols @@ -0,0 +1,30 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts] //// + +=== /index.ts === +// incorrect mode +import type { RequireInterface } from "pkg" with { "resolution-mode": "foobar" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 1, 13)) + +// not type-only +import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 3, 8)) + +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) +>Req2 : Symbol(Req2, Decl(index.ts, 5, 37)) + +export interface LocalInterface extends RequireInterface, ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 5, 113)) +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 1, 13)) +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 3, 8)) + + + + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node20).types b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node20).types new file mode 100644 index 0000000000000..d432212769fe8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node20).types @@ -0,0 +1,32 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts] //// + +=== /index.ts === +// incorrect mode +import type { RequireInterface } from "pkg" with { "resolution-mode": "foobar" }; +>RequireInterface : RequireInterface +> : ^^^^^^^^^^^^^^^^ + +// not type-only +import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : any +> : ^^^ + +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : any +> : ^^^ +>Req : any +> : ^^^ +>RequireInterface : any +> : ^^^ +>Req2 : any +> : ^^^ + +export interface LocalInterface extends RequireInterface, ImportInterface {} + + + + +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node20).js b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node20).js new file mode 100644 index 0000000000000..44948d9ed5250 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node20).js @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +export type LocalInterface = + & import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; + + +//// [index.d.ts] +export type LocalInterface = import("pkg", { with: { "resolution-mode": "require" } }).RequireInterface & import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; +export declare const a: import("pkg", { with: { "resolution-mode": "require" } }).RequireInterface; +export declare const b: import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node20).symbols b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node20).symbols new file mode 100644 index 0000000000000..1f0e1652f5505 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node20).symbols @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts] //// + +=== /index.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) + + & import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface); +>a : Symbol(a, Decl(index.ts, 4, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); +>b : Symbol(b, Decl(index.ts, 5, 12)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node20).types b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node20).types new file mode 100644 index 0000000000000..1c9297e238011 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node20).types @@ -0,0 +1,34 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts] //// + +=== /index.ts === +export type LocalInterface = +>LocalInterface : LocalInterface +> : ^^^^^^^^^^^^^^ + + & import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any : any + +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); +>b : import("/node_modules/pkg/import").ImportInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface) : import("/node_modules/pkg/import").ImportInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface : import("/node_modules/pkg/import").ImportInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any : any + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node20).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node20).errors.txt new file mode 100644 index 0000000000000..1075b870f1ada --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node20).errors.txt @@ -0,0 +1,314 @@ +/index.ts(2,49): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(5,76): error TS1453: `resolution-mode` should be either `require` or `import`. +/other.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other.ts(3,22): error TS1005: 'with' expected. +/other.ts(3,39): error TS1005: ';' expected. +/other.ts(3,50): error TS1128: Declaration or statement expected. +/other.ts(3,51): error TS1128: Declaration or statement expected. +/other.ts(3,52): error TS1128: Declaration or statement expected. +/other.ts(3,53): error TS2304: Cannot find name 'RequireInterface'. +/other.ts(4,22): error TS2353: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. +/other.ts(4,52): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/other.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other.ts(6,49): error TS1005: 'with' expected. +/other.ts(6,66): error TS1005: ';' expected. +/other.ts(6,77): error TS1128: Declaration or statement expected. +/other.ts(6,78): error TS1128: Declaration or statement expected. +/other.ts(6,79): error TS1128: Declaration or statement expected. +/other.ts(6,80): error TS1434: Unexpected keyword or identifier. +/other.ts(6,80): error TS2304: Cannot find name 'RequireInterface'. +/other.ts(6,96): error TS1128: Declaration or statement expected. +/other.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other.ts(7,49): error TS1005: 'with' expected. +/other.ts(7,66): error TS1005: ';' expected. +/other.ts(7,76): error TS1128: Declaration or statement expected. +/other.ts(7,77): error TS1128: Declaration or statement expected. +/other.ts(7,78): error TS1128: Declaration or statement expected. +/other.ts(7,79): error TS1434: Unexpected keyword or identifier. +/other.ts(7,79): error TS2304: Cannot find name 'ImportInterface'. +/other.ts(7,94): error TS1128: Declaration or statement expected. +/other2.ts(3,30): error TS1463: 'resolution-mode' is the only valid key for type import attributes. +/other2.ts(4,30): error TS1463: 'resolution-mode' is the only valid key for type import attributes. +/other2.ts(4,50): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +/other2.ts(6,57): error TS1463: 'resolution-mode' is the only valid key for type import attributes. +/other2.ts(7,57): error TS1463: 'resolution-mode' is the only valid key for type import attributes. +/other2.ts(7,77): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +/other3.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other3.ts(3,21): error TS1005: '{' expected. +/other3.ts(3,23): error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. +/other3.ts(3,55): error TS1005: ';' expected. +/other3.ts(3,56): error TS1128: Declaration or statement expected. +/other3.ts(3,57): error TS2304: Cannot find name 'RequireInterface'. +/other3.ts(4,21): error TS2322: Type '{ "resolution-mode": string; }[]' is not assignable to type 'ImportCallOptions'. + Types of property 'with' are incompatible. + Type '(index: number, value: { "resolution-mode": string; }) => { "resolution-mode": string; }[]' is not assignable to type 'ImportAttributes'. + Index signature for type 'string' is missing in type '(index: number, value: { "resolution-mode": string; }) => { "resolution-mode": string; }[]'. +/other3.ts(4,56): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/other3.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other3.ts(6,48): error TS1005: '{' expected. +/other3.ts(6,50): error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. +/other3.ts(6,100): error TS1005: ',' expected. +/other3.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other3.ts(7,48): error TS1005: '{' expected. +/other3.ts(7,50): error TS2538: Type '{ "resolution-mode": "import"; }' cannot be used as an index type. +/other3.ts(7,98): error TS1005: ',' expected. +/other4.ts(6,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other4.ts(6,21): error TS1005: '{' expected. +/other4.ts(6,21): error TS2448: Block-scoped variable 'Attribute1' used before its declaration. +/other4.ts(6,31): error TS1128: Declaration or statement expected. +/other4.ts(6,32): error TS1128: Declaration or statement expected. +/other4.ts(6,33): error TS2448: Block-scoped variable 'RequireInterface' used before its declaration. +/other4.ts(7,21): error TS2448: Block-scoped variable 'Attribute2' used before its declaration. +/other4.ts(7,33): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/other4.ts(9,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other4.ts(9,48): error TS1005: '{' expected. +/other4.ts(9,58): error TS1005: ',' expected. +/other4.ts(9,59): error TS1134: Variable declaration expected. +/other4.ts(9,76): error TS1005: ',' expected. +/other4.ts(10,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other4.ts(10,48): error TS1005: '{' expected. +/other4.ts(10,58): error TS1005: ',' expected. +/other4.ts(10,59): error TS1134: Variable declaration expected. +/other4.ts(10,75): error TS1005: ',' expected. +/other5.ts(2,29): error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. +/other5.ts(3,29): error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. +/other5.ts(3,35): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +/other5.ts(5,56): error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. +/other5.ts(6,56): error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. +/other5.ts(6,62): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} + +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} + +==== /index.ts (2 errors) ==== + export type LocalInterface = + & import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface + ~~~~~~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + + export const a = (null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface); + ~~~~~~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); + +==== /other.ts (27 errors) ==== + // missing with: + export type LocalInterface = + & import("pkg", {"resolution-mode": "require"}).RequireInterface + ~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~~~~~~~~ +!!! error TS1005: 'with' expected. +!!! related TS1007 /other.ts:3:21: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + & import("pkg", {"resolution-mode": "import"}).ImportInterface; + ~~~~~~~~~~~~~~~~~ +!!! error TS2353: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); + ~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~~~~~~~~ +!!! error TS1005: 'with' expected. +!!! related TS1007 /other.ts:6:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS1434: Unexpected keyword or identifier. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + ~ +!!! error TS1128: Declaration or statement expected. + export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); + ~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~~~~~~~~ +!!! error TS1005: 'with' expected. +!!! related TS1007 /other.ts:7:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~ +!!! error TS1434: Unexpected keyword or identifier. + ~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'ImportInterface'. + ~ +!!! error TS1128: Declaration or statement expected. + +==== /other2.ts (6 errors) ==== + // wrong attribute key + export type LocalInterface = + & import("pkg", { with: {"bad": "require"} }).RequireInterface + ~~~~~ +!!! error TS1463: 'resolution-mode' is the only valid key for type import attributes. + & import("pkg", { with: {"bad": "import"} }).ImportInterface; + ~~~~~ +!!! error TS1463: 'resolution-mode' is the only valid key for type import attributes. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + + export const a = (null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface); + ~~~~~ +!!! error TS1463: 'resolution-mode' is the only valid key for type import attributes. + export const b = (null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface); + ~~~~~ +!!! error TS1463: 'resolution-mode' is the only valid key for type import attributes. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + +==== /other3.ts (16 errors) ==== + // Array instead of object-y thing + export type LocalInterface = + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other3.ts:3:21: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type '{ "resolution-mode": string; }[]' is not assignable to type 'ImportCallOptions'. +!!! error TS2322: Types of property 'with' are incompatible. +!!! error TS2322: Type '(index: number, value: { "resolution-mode": string; }) => { "resolution-mode": string; }[]' is not assignable to type 'ImportAttributes'. +!!! error TS2322: Index signature for type 'string' is missing in type '(index: number, value: { "resolution-mode": string; }) => { "resolution-mode": string; }[]'. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other3.ts:6:48: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. + ~ +!!! error TS1005: ',' expected. + export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other3.ts:7:48: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2538: Type '{ "resolution-mode": "import"; }' cannot be used as an index type. + ~ +!!! error TS1005: ',' expected. + +==== /other4.ts (18 errors) ==== + // Indirected attribute objecty-thing - not allowed + type Attribute1 = { with: {"resolution-mode": "require"} }; + type Attribute2 = { with: {"resolution-mode": "import"} }; + + export type LocalInterface = + & import("pkg", Attribute1).RequireInterface + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other4.ts:6:21: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~ +!!! error TS2448: Block-scoped variable 'Attribute1' used before its declaration. +!!! related TS2728 /other4.ts:9:48: 'Attribute1' is declared here. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2448: Block-scoped variable 'RequireInterface' used before its declaration. +!!! related TS2728 /other4.ts:9:60: 'RequireInterface' is declared here. + & import("pkg", Attribute2).ImportInterface; + ~~~~~~~~~~ +!!! error TS2448: Block-scoped variable 'Attribute2' used before its declaration. +!!! related TS2728 /other4.ts:10:48: 'Attribute2' is declared here. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", Attribute1).RequireInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other4.ts:9:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1134: Variable declaration expected. + ~ +!!! error TS1005: ',' expected. + export const b = (null as any as import("pkg", Attribute2).ImportInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other4.ts:10:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1134: Variable declaration expected. + ~ +!!! error TS1005: ',' expected. + +==== /other5.ts (6 errors) ==== + export type LocalInterface = + & import("pkg", { with: {} }).RequireInterface + ~~ +!!! error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. + & import("pkg", { with: {} }).ImportInterface; + ~~ +!!! error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + + export const a = (null as any as import("pkg", { with: {} }).RequireInterface); + ~~ +!!! error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. + export const b = (null as any as import("pkg", { with: {} }).ImportInterface); + ~~ +!!! error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node20).js b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node20).js new file mode 100644 index 0000000000000..c64b30d4e5bba --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node20).js @@ -0,0 +1,153 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} + +//// [require.d.ts] +export interface RequireInterface {} + +//// [index.ts] +export type LocalInterface = + & import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); + +//// [other.ts] +// missing with: +export type LocalInterface = + & import("pkg", {"resolution-mode": "require"}).RequireInterface + & import("pkg", {"resolution-mode": "import"}).ImportInterface; + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); + +//// [other2.ts] +// wrong attribute key +export type LocalInterface = + & import("pkg", { with: {"bad": "require"} }).RequireInterface + & import("pkg", { with: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface); + +//// [other3.ts] +// Array instead of object-y thing +export type LocalInterface = + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); + +//// [other4.ts] +// Indirected attribute objecty-thing - not allowed +type Attribute1 = { with: {"resolution-mode": "require"} }; +type Attribute2 = { with: {"resolution-mode": "import"} }; + +export type LocalInterface = + & import("pkg", Attribute1).RequireInterface + & import("pkg", Attribute2).ImportInterface; + +export const a = (null as any as import("pkg", Attribute1).RequireInterface); +export const b = (null as any as import("pkg", Attribute2).ImportInterface); + +//// [other5.ts] +export type LocalInterface = + & import("pkg", { with: {} }).RequireInterface + & import("pkg", { with: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {} }).ImportInterface); + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; +//// [other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +"resolution-mode"; +"require"; +RequireInterface + & import("pkg", { "resolution-mode": "import" }).ImportInterface; +exports.a = null; +"resolution-mode"; +"require"; +RequireInterface; +; +exports.b = null; +"resolution-mode"; +"import"; +ImportInterface; +; +//// [other2.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; +//// [other3.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +RequireInterface + & import("pkg", [{ "resolution-mode": "import" }]).ImportInterface; +exports.a = null.RequireInterface; +exports.b = null.ImportInterface; +//// [other4.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImportInterface = exports.Attribute2 = exports.b = exports.RequireInterface = exports.Attribute1 = exports.a = void 0; +exports.Attribute1; +exports.RequireInterface + & import("pkg", exports.Attribute2).ImportInterface; +exports.a = null; +exports.b = null; +//// [other5.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; + + +//// [index.d.ts] +export type LocalInterface = import("pkg", { with: { "resolution-mode": "foobar" } }).RequireInterface & import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; +export declare const a: import("pkg", { with: { "resolution-mode": "foobar" } }).RequireInterface; +export declare const b: import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; +//// [other.d.ts] +export type LocalInterface = import("pkg", { with: {} }); +export declare const a: import("pkg", { with: {} }); +export declare const b: import("pkg", { with: {} }); +//// [other2.d.ts] +export type LocalInterface = import("pkg", { with: { "bad": "require" } }).RequireInterface & import("pkg", { with: { "bad": "import" } }).ImportInterface; +export declare const a: import("pkg", { with: { "bad": "require" } }).RequireInterface; +export declare const b: import("pkg", { with: { "bad": "import" } }).ImportInterface; +//// [other3.d.ts] +export type LocalInterface = import("pkg", { with: {} })[{ + "resolution-mode": "require"; +}]; +export declare const a: any; +export declare const b: any; +//// [other4.d.ts] +export type LocalInterface = import("pkg", { with: {} }); +export declare const a: import("pkg", { with: {} }), Attribute1: any, RequireInterface: any; +export declare const b: import("pkg", { with: {} }), Attribute2: any, ImportInterface: any; +//// [other5.d.ts] +export type LocalInterface = import("pkg", { with: {} }).RequireInterface & import("pkg", { with: {} }).ImportInterface; +export declare const a: import("pkg", { with: {} }).RequireInterface; +export declare const b: import("pkg", { with: {} }).ImportInterface; diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node20).symbols b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node20).symbols new file mode 100644 index 0000000000000..8a23a85dd4673 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node20).symbols @@ -0,0 +1,130 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts] //// + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +=== /index.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) + + & import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface); +>a : Symbol(a, Decl(index.ts, 4, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); +>b : Symbol(b, Decl(index.ts, 5, 12)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /other.ts === +// missing with: +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other.ts, 0, 0)) + + & import("pkg", {"resolution-mode": "require"}).RequireInterface + & import("pkg", {"resolution-mode": "import"}).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other.ts, 3, 21)) + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +>a : Symbol(a, Decl(other.ts, 5, 12)) + +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); +>b : Symbol(b, Decl(other.ts, 6, 12)) + +=== /other2.ts === +// wrong attribute key +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other2.ts, 0, 0)) + + & import("pkg", { with: {"bad": "require"} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { with: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface); +>a : Symbol(a, Decl(other2.ts, 5, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface); +>b : Symbol(b, Decl(other2.ts, 6, 12)) + +=== /other3.ts === +// Array instead of object-y thing +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other3.ts, 0, 0)) + + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 2, 23)) + + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 3, 23)) + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +>a : Symbol(a, Decl(other3.ts, 5, 12)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 5, 50)) + +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); +>b : Symbol(b, Decl(other3.ts, 6, 12)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 6, 50)) + +=== /other4.ts === +// Indirected attribute objecty-thing - not allowed +type Attribute1 = { with: {"resolution-mode": "require"} }; +>Attribute1 : Symbol(Attribute1, Decl(other4.ts, 0, 0), Decl(other4.ts, 8, 46)) +>with : Symbol(with, Decl(other4.ts, 1, 19)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other4.ts, 1, 27)) + +type Attribute2 = { with: {"resolution-mode": "import"} }; +>Attribute2 : Symbol(Attribute2, Decl(other4.ts, 1, 59), Decl(other4.ts, 9, 46)) +>with : Symbol(with, Decl(other4.ts, 2, 19)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other4.ts, 2, 27)) + +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other4.ts, 2, 58)) + + & import("pkg", Attribute1).RequireInterface +>Attribute1 : Symbol(Attribute1, Decl(other4.ts, 8, 46)) +>RequireInterface : Symbol(RequireInterface, Decl(other4.ts, 8, 59)) + + & import("pkg", Attribute2).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>Attribute2 : Symbol(Attribute2, Decl(other4.ts, 9, 46)) + +export const a = (null as any as import("pkg", Attribute1).RequireInterface); +>a : Symbol(a, Decl(other4.ts, 8, 12)) +>Attribute1 : Symbol(Attribute1, Decl(other4.ts, 8, 46)) +>RequireInterface : Symbol(RequireInterface, Decl(other4.ts, 8, 59)) + +export const b = (null as any as import("pkg", Attribute2).ImportInterface); +>b : Symbol(b, Decl(other4.ts, 9, 12)) +>Attribute2 : Symbol(Attribute2, Decl(other4.ts, 9, 46)) +>ImportInterface : Symbol(ImportInterface, Decl(other4.ts, 9, 59)) + +=== /other5.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other5.ts, 0, 0)) + + & import("pkg", { with: {} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { with: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {} }).RequireInterface); +>a : Symbol(a, Decl(other5.ts, 4, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { with: {} }).ImportInterface); +>b : Symbol(b, Decl(other5.ts, 5, 12)) + diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node20).types b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node20).types new file mode 100644 index 0000000000000..c1e5b7e23e6a1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node20).types @@ -0,0 +1,293 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts] //// + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} + +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} + +=== /index.ts === +export type LocalInterface = +>LocalInterface : LocalInterface +> : ^^^^^^^^^^^^^^ + + & import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any : any +> : ^^^ + +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); +>b : import("/node_modules/pkg/import").ImportInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface) : import("/node_modules/pkg/import").ImportInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface : import("/node_modules/pkg/import").ImportInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any : any +> : ^^^ + +=== /other.ts === +// missing with: +export type LocalInterface = +>LocalInterface : any +> : ^^^ + + & import("pkg", {"resolution-mode": "require"}).RequireInterface +>"resolution-mode" : "resolution-mode" +> : ^^^^^^^^^^^^^^^^^ +>"require" : "require" +> : ^^^^^^^^^ +>RequireInterface & import("pkg", {"resolution-mode": "import"}).ImportInterface : number +> : ^^^^^^ +>RequireInterface : any +> : ^^^ + + & import("pkg", {"resolution-mode": "import"}).ImportInterface; +>import("pkg", {"resolution-mode": "import"}).ImportInterface : any +> : ^^^ +>import("pkg", {"resolution-mode": "import"}) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"pkg" : "pkg" +> : ^^^^^ +>{"resolution-mode": "import"} : { "resolution-mode": string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"resolution-mode" : string +> : ^^^^^^ +>"import" : "import" +> : ^^^^^^^^ +>ImportInterface : any +> : ^^^ + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +>a : any +> : ^^^ +>(null as any as import("pkg", { : any +> : ^^^ +>null as any as import("pkg", { : any +> : ^^^ +>null as any : any +> : ^^^ +>"resolution-mode" : "resolution-mode" +> : ^^^^^^^^^^^^^^^^^ +>"require" : "require" +> : ^^^^^^^^^ +>RequireInterface : any +> : ^^^ + +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); +>b : any +> : ^^^ +>(null as any as import("pkg", { : any +> : ^^^ +>null as any as import("pkg", { : any +> : ^^^ +>null as any : any +> : ^^^ +>"resolution-mode" : "resolution-mode" +> : ^^^^^^^^^^^^^^^^^ +>"import" : "import" +> : ^^^^^^^^ +>ImportInterface : any +> : ^^^ + +=== /other2.ts === +// wrong attribute key +export type LocalInterface = +>LocalInterface : any +> : ^^^ + + & import("pkg", { with: {"bad": "require"} }).RequireInterface + & import("pkg", { with: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any : any +> : ^^^ + +export const b = (null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface); +>b : any +> : ^^^ +>(null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface) : any +> : ^^^ +>null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface : any +> : ^^^ +>null as any : any +> : ^^^ + +=== /other3.ts === +// Array instead of object-y thing +export type LocalInterface = +>LocalInterface : any +> : ^^^ + + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface +>"resolution-mode" : "require" +> : ^^^^^^^^^ +>RequireInterface & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : number +> : ^^^^^^ +>RequireInterface : any +> : ^^^ + + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; +>import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : any +> : ^^^ +>import("pkg", [ {"resolution-mode": "import"} ]) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"pkg" : "pkg" +> : ^^^^^ +>[ {"resolution-mode": "import"} ] : { "resolution-mode": string; }[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{"resolution-mode": "import"} : { "resolution-mode": string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"resolution-mode" : string +> : ^^^^^^ +>"import" : "import" +> : ^^^^^^^^ +>ImportInterface : any +> : ^^^ + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +>a : any +> : ^^^ +>(null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface : any +> : ^^^ +>(null as any as import("pkg", [ {"resolution-mode": "require"} ]) : any +> : ^^^ +>null as any as import("pkg", [ {"resolution-mode": "require"} ] : any +> : ^^^ +>null as any : any +> : ^^^ +>"resolution-mode" : "require" +> : ^^^^^^^^^ +>RequireInterface : any +> : ^^^ + +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); +>b : any +> : ^^^ +>(null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : any +> : ^^^ +>(null as any as import("pkg", [ {"resolution-mode": "import"} ]) : any +> : ^^^ +>null as any as import("pkg", [ {"resolution-mode": "import"} ] : any +> : ^^^ +>null as any : any +> : ^^^ +>"resolution-mode" : "import" +> : ^^^^^^^^ +>ImportInterface : any +> : ^^^ + +=== /other4.ts === +// Indirected attribute objecty-thing - not allowed +type Attribute1 = { with: {"resolution-mode": "require"} }; +>Attribute1 : Attribute1 +> : ^^^^^^^^^^ +>with : { "resolution-mode": "require"; } +> : ^^^^^^^^^^^^^^^^^^^^^ ^^^ +>"resolution-mode" : "require" +> : ^^^^^^^^^ + +type Attribute2 = { with: {"resolution-mode": "import"} }; +>Attribute2 : Attribute2 +> : ^^^^^^^^^^ +>with : { "resolution-mode": "import"; } +> : ^^^^^^^^^^^^^^^^^^^^^ ^^^ +>"resolution-mode" : "import" +> : ^^^^^^^^ + +export type LocalInterface = +>LocalInterface : any +> : ^^^ + + & import("pkg", Attribute1).RequireInterface +>Attribute1 : any +> : ^^^ +>RequireInterface & import("pkg", Attribute2).ImportInterface : number +> : ^^^^^^ +>RequireInterface : any +> : ^^^ + + & import("pkg", Attribute2).ImportInterface; +>import("pkg", Attribute2).ImportInterface : any +> : ^^^ +>import("pkg", Attribute2) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"pkg" : "pkg" +> : ^^^^^ +>Attribute2 : any +> : ^^^ +>ImportInterface : any +> : ^^^ + +export const a = (null as any as import("pkg", Attribute1).RequireInterface); +>a : any +> : ^^^ +>(null as any as import("pkg", : any +> : ^^^ +>null as any as import("pkg", : any +> : ^^^ +>null as any : any +> : ^^^ +>Attribute1 : any +> : ^^^ +>RequireInterface : any +> : ^^^ + +export const b = (null as any as import("pkg", Attribute2).ImportInterface); +>b : any +> : ^^^ +>(null as any as import("pkg", : any +> : ^^^ +>null as any as import("pkg", : any +> : ^^^ +>null as any : any +> : ^^^ +>Attribute2 : any +> : ^^^ +>ImportInterface : any +> : ^^^ + +=== /other5.ts === +export type LocalInterface = +>LocalInterface : any +> : ^^^ + + & import("pkg", { with: {} }).RequireInterface + & import("pkg", { with: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(null as any as import("pkg", { with: {} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any as import("pkg", { with: {} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any : any +> : ^^^ + +export const b = (null as any as import("pkg", { with: {} }).ImportInterface); +>b : any +> : ^^^ +>(null as any as import("pkg", { with: {} }).ImportInterface) : any +> : ^^^ +>null as any as import("pkg", { with: {} }).ImportInterface : any +> : ^^^ +>null as any : any +> : ^^^ + diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node20).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node20).errors.txt new file mode 100644 index 0000000000000..05c2a81067dde --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node20).errors.txt @@ -0,0 +1,36 @@ +subfolder/index.ts(2,9): error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. +subfolder/index.ts(4,1): error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + + +==== subfolder/index.ts (2 errors) ==== + // cjs format file + import {default as _fs} from "fs"; + ~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + _fs.readFile; + import * as fs from "fs"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + fs.readFile; +==== index.ts (0 errors) ==== + // esm format file + import {default as _fs} from "fs"; + _fs.readFile; + import * as fs from "fs"; + fs.readFile; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== types.d.ts (0 errors) ==== + declare module "fs"; + declare module "tslib" { + export {}; + // intentionally missing all helpers + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node20).js b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node20).js new file mode 100644 index 0000000000000..4712d65a0999e --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node20).js @@ -0,0 +1,52 @@ +//// [tests/cases/conformance/node/nodeModulesImportHelpersCollisions.ts] //// + +//// [index.ts] +// cjs format file +import {default as _fs} from "fs"; +_fs.readFile; +import * as fs from "fs"; +fs.readFile; +//// [index.ts] +// esm format file +import {default as _fs} from "fs"; +_fs.readFile; +import * as fs from "fs"; +fs.readFile; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; +declare module "tslib" { + export {}; + // intentionally missing all helpers +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +// cjs format file +const fs_1 = tslib_1.__importDefault(require("fs")); +fs_1.default.readFile; +const fs = tslib_1.__importStar(require("fs")); +fs.readFile; +//// [index.js] +// esm format file +import { default as _fs } from "fs"; +_fs.readFile; +import * as fs from "fs"; +fs.readFile; + + +//// [index.d.ts] +export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node20).symbols b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node20).symbols new file mode 100644 index 0000000000000..100e1481edf0d --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node20).symbols @@ -0,0 +1,42 @@ +//// [tests/cases/conformance/node/nodeModulesImportHelpersCollisions.ts] //// + +=== subfolder/index.ts === +// cjs format file +import {default as _fs} from "fs"; +>default : Symbol(_fs, Decl(types.d.ts, 0, 0)) +>_fs : Symbol(_fs, Decl(index.ts, 1, 8)) + +_fs.readFile; +>_fs : Symbol(_fs, Decl(index.ts, 1, 8)) + +import * as fs from "fs"; +>fs : Symbol(fs, Decl(index.ts, 3, 6)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.ts, 3, 6)) + +=== index.ts === +// esm format file +import {default as _fs} from "fs"; +>default : Symbol(_fs, Decl(types.d.ts, 0, 0)) +>_fs : Symbol(_fs, Decl(index.ts, 1, 8)) + +_fs.readFile; +>_fs : Symbol(_fs, Decl(index.ts, 1, 8)) + +import * as fs from "fs"; +>fs : Symbol(fs, Decl(index.ts, 3, 6)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.ts, 3, 6)) + +=== types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + +declare module "tslib" { +>"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node20).types b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node20).types new file mode 100644 index 0000000000000..6290a2888be05 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node20).types @@ -0,0 +1,70 @@ +//// [tests/cases/conformance/node/nodeModulesImportHelpersCollisions.ts] //// + +=== subfolder/index.ts === +// cjs format file +import {default as _fs} from "fs"; +>default : any +> : ^^^ +>_fs : any +> : ^^^ + +_fs.readFile; +>_fs.readFile : any +> : ^^^ +>_fs : any +> : ^^^ +>readFile : any +> : ^^^ + +import * as fs from "fs"; +>fs : any +> : ^^^ + +fs.readFile; +>fs.readFile : any +> : ^^^ +>fs : any +> : ^^^ +>readFile : any +> : ^^^ + +=== index.ts === +// esm format file +import {default as _fs} from "fs"; +>default : any +> : ^^^ +>_fs : any +> : ^^^ + +_fs.readFile; +>_fs.readFile : any +> : ^^^ +>_fs : any +> : ^^^ +>readFile : any +> : ^^^ + +import * as fs from "fs"; +>fs : any +> : ^^^ + +fs.readFile; +>fs.readFile : any +> : ^^^ +>fs : any +> : ^^^ +>readFile : any +> : ^^^ + +=== types.d.ts === +declare module "fs"; +>"fs" : any +> : ^^^ + +declare module "tslib" { +>"tslib" : typeof import("tslib") +> : ^^^^^^^^^^^^^^^^^^^^^^ + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node20).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node20).errors.txt new file mode 100644 index 0000000000000..176b3d13fe10e --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node20).errors.txt @@ -0,0 +1,32 @@ +subfolder/index.ts(2,1): error TS2343: This syntax requires an imported helper named '__exportStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. +subfolder/index.ts(3,1): error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + + +==== subfolder/index.ts (2 errors) ==== + // cjs format file + export * from "fs"; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__exportStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + export * as fs from "fs"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. +==== index.ts (0 errors) ==== + // esm format file + export * from "fs"; + export * as fs from "fs"; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== types.d.ts (0 errors) ==== + declare module "fs"; + declare module "tslib" { + export {}; + // intentionally missing all helpers + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node20).js b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node20).js new file mode 100644 index 0000000000000..c058d00e216e0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node20).js @@ -0,0 +1,47 @@ +//// [tests/cases/conformance/node/nodeModulesImportHelpersCollisions2.ts] //// + +//// [index.ts] +// cjs format file +export * from "fs"; +export * as fs from "fs"; +//// [index.ts] +// esm format file +export * from "fs"; +export * as fs from "fs"; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; +declare module "tslib" { + export {}; + // intentionally missing all helpers +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fs = void 0; +const tslib_1 = require("tslib"); +// cjs format file +tslib_1.__exportStar(require("fs"), exports); +exports.fs = tslib_1.__importStar(require("fs")); +//// [index.js] +// esm format file +export * from "fs"; +export * as fs from "fs"; + + +//// [index.d.ts] +export * from "fs"; +export * as fs from "fs"; +//// [index.d.ts] +export * from "fs"; +export * as fs from "fs"; diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node20).symbols b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node20).symbols new file mode 100644 index 0000000000000..e41469a2edb5c --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node20).symbols @@ -0,0 +1,24 @@ +//// [tests/cases/conformance/node/nodeModulesImportHelpersCollisions2.ts] //// + +=== subfolder/index.ts === +// cjs format file +export * from "fs"; +export * as fs from "fs"; +>fs : Symbol(fs, Decl(index.ts, 2, 6)) + +=== index.ts === +// esm format file +export * from "fs"; +export * as fs from "fs"; +>fs : Symbol(fs, Decl(index.ts, 2, 6)) + +=== types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + +declare module "tslib" { +>"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node20).types b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node20).types new file mode 100644 index 0000000000000..84f5d49b9c0c3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node20).types @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/node/nodeModulesImportHelpersCollisions2.ts] //// + +=== subfolder/index.ts === +// cjs format file +export * from "fs"; +export * as fs from "fs"; +>fs : any +> : ^^^ + +=== index.ts === +// esm format file +export * from "fs"; +export * as fs from "fs"; +>fs : any +> : ^^^ + +=== types.d.ts === +declare module "fs"; +>"fs" : any +> : ^^^ + +declare module "tslib" { +>"tslib" : typeof import("tslib") +> : ^^^^^^^^^^^^^^^^^^^^^^ + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node20).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node20).errors.txt new file mode 100644 index 0000000000000..a5f7cf4be1399 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node20).errors.txt @@ -0,0 +1,27 @@ +subfolder/index.ts(2,9): error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + + +==== subfolder/index.ts (1 errors) ==== + // cjs format file + export {default} from "fs"; + ~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. +==== index.ts (0 errors) ==== + // esm format file + export {default} from "fs"; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== types.d.ts (0 errors) ==== + declare module "fs"; + declare module "tslib" { + export {}; + // intentionally missing all helpers + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node20).js b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node20).js new file mode 100644 index 0000000000000..381f1b8ba964b --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node20).js @@ -0,0 +1,42 @@ +//// [tests/cases/conformance/node/nodeModulesImportHelpersCollisions3.ts] //// + +//// [index.ts] +// cjs format file +export {default} from "fs"; +//// [index.ts] +// esm format file +export {default} from "fs"; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; +declare module "tslib" { + export {}; + // intentionally missing all helpers +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; +var tslib_1 = require("tslib"); +// cjs format file +var fs_1 = require("fs"); +Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(fs_1).default; } }); +//// [index.js] +// esm format file +export { default } from "fs"; + + +//// [index.d.ts] +export { default } from "fs"; +//// [index.d.ts] +export { default } from "fs"; diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node20).symbols b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node20).symbols new file mode 100644 index 0000000000000..db6b4d5b50a13 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node20).symbols @@ -0,0 +1,22 @@ +//// [tests/cases/conformance/node/nodeModulesImportHelpersCollisions3.ts] //// + +=== subfolder/index.ts === +// cjs format file +export {default} from "fs"; +>default : Symbol(default, Decl(index.ts, 1, 8)) + +=== index.ts === +// esm format file +export {default} from "fs"; +>default : Symbol(default, Decl(index.ts, 1, 8)) + +=== types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + +declare module "tslib" { +>"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node20).types b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node20).types new file mode 100644 index 0000000000000..fe3a6a4729b0b --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node20).types @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/node/nodeModulesImportHelpersCollisions3.ts] //// + +=== subfolder/index.ts === +// cjs format file +export {default} from "fs"; +>default : any +> : ^^^ + +=== index.ts === +// esm format file +export {default} from "fs"; +>default : any +> : ^^^ + +=== types.d.ts === +declare module "fs"; +>"fs" : any +> : ^^^ + +declare module "tslib" { +>"tslib" : typeof import("tslib") +> : ^^^^^^^^^^^^^^^^^^^^^^ + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=node20).errors.txt b/tests/baselines/reference/nodeModulesImportMeta(module=node20).errors.txt new file mode 100644 index 0000000000000..dc4849ff5093c --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportMeta(module=node20).errors.txt @@ -0,0 +1,23 @@ +subfolder/index.ts(2,11): error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. + + +==== subfolder/index.ts (1 errors) ==== + // cjs format file + const x = import.meta.url; + ~~~~~~~~~~~ +!!! error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. + export {x}; +==== index.ts (0 errors) ==== + // esm format file + const x = import.meta.url; + export {x}; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=node20).js b/tests/baselines/reference/nodeModulesImportMeta(module=node20).js new file mode 100644 index 0000000000000..aa962a90bd346 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportMeta(module=node20).js @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/node/nodeModulesImportMeta.ts] //// + +//// [index.ts] +// cjs format file +const x = import.meta.url; +export {x}; +//// [index.ts] +// esm format file +const x = import.meta.url; +export {x}; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = import.meta.url; +exports.x = x; +//// [index.js] +// esm format file +const x = import.meta.url; +export { x }; + + +//// [index.d.ts] +declare const x: string; +export { x }; +//// [index.d.ts] +declare const x: string; +export { x }; diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=node20).symbols b/tests/baselines/reference/nodeModulesImportMeta(module=node20).symbols new file mode 100644 index 0000000000000..dd1b136815bf7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportMeta(module=node20).symbols @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/node/nodeModulesImportMeta.ts] //// + +=== subfolder/index.ts === +// cjs format file +const x = import.meta.url; +>x : Symbol(x, Decl(index.ts, 1, 5)) +>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) +>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) +>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +=== index.ts === +// esm format file +const x = import.meta.url; +>x : Symbol(x, Decl(index.ts, 1, 5)) +>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) +>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) +>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=node20).types b/tests/baselines/reference/nodeModulesImportMeta(module=node20).types new file mode 100644 index 0000000000000..b64e4b920275f --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportMeta(module=node20).types @@ -0,0 +1,38 @@ +//// [tests/cases/conformance/node/nodeModulesImportMeta.ts] //// + +=== subfolder/index.ts === +// cjs format file +const x = import.meta.url; +>x : string +> : ^^^^^^ +>import.meta.url : string +> : ^^^^^^ +>import.meta : ImportMeta +> : ^^^^^^^^^^ +>meta : ImportMeta +> : ^^^^^^^^^^ +>url : string +> : ^^^^^^ + +export {x}; +>x : string +> : ^^^^^^ + +=== index.ts === +// esm format file +const x = import.meta.url; +>x : string +> : ^^^^^^ +>import.meta.url : string +> : ^^^^^^ +>import.meta : ImportMeta +> : ^^^^^^^^^^ +>meta : ImportMeta +> : ^^^^^^^^^^ +>url : string +> : ^^^^^^ + +export {x}; +>x : string +> : ^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).errors.txt index 550ef21197815..cb0de887d53dd 100644 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).errors.txt @@ -1,6 +1,6 @@ -/index.ts(6,50): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +/index.ts(6,50): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. /index.ts(7,14): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. -/index.ts(7,49): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +/index.ts(7,49): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== /index.ts (3 errors) ==== @@ -11,12 +11,12 @@ import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; ~~~~~~~~~~~~~~~ !!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export interface Loc extends Req, Imp {} export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node20).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node20).errors.txt new file mode 100644 index 0000000000000..d2c0a64f66744 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node20).errors.txt @@ -0,0 +1,37 @@ +/index.ts(6,50): error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. +/index.ts(7,14): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. +/index.ts(7,49): error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. + + +==== /index.ts (3 errors) ==== + import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + + export interface LocalInterface extends RequireInterface, ImportInterface {} + + import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; + ~~~~~~ +!!! error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. + import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. + ~~~~~~ +!!! error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. + export interface Loc extends Req, Imp {} + + export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node20).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node20).js new file mode 100644 index 0000000000000..1b8bc65976edc --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node20).js @@ -0,0 +1,45 @@ +//// [tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit1.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; +import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [index.d.ts] +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +export interface LocalInterface extends RequireInterface, ImportInterface { +} +import { type RequireInterface as Req } from "pkg" assert { "resolution-mode": "require" }; +import { type ImportInterface as Imp } from "pkg" assert { "resolution-mode": "import" }; +export interface Loc extends Req, Imp { +} +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node20).symbols b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node20).symbols new file mode 100644 index 0000000000000..97a76656c4050 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node20).symbols @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit1.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) + +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +export interface LocalInterface extends RequireInterface, ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 1, 82)) +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) + +import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export interface Loc extends Req, Imp {} +>Loc : Symbol(Loc, Decl(index.ts, 6, 87)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 9, 13)) + +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 10, 13)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node20).types b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node20).types new file mode 100644 index 0000000000000..27ce52d60a048 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node20).types @@ -0,0 +1,41 @@ +//// [tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit1.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : RequireInterface +> : ^^^^^^^^^^^^^^^^ + +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : ImportInterface +> : ^^^^^^^^^^^^^^^ + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : any +> : ^^^ +>Req : any +> : ^^^ + +import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : any +> : ^^^ +>Imp : any +> : ^^^ + +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : RequireInterface +> : ^^^^^^^^^^^^^^^^ + +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : ImportInterface +> : ^^^^^^^^^^^^^^^ + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).errors.txt index 1604272f9e21a..c07a16f9e9aa5 100644 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).errors.txt @@ -1,6 +1,6 @@ /index.ts(6,14): error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. -/index.ts(6,50): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -/index.ts(7,49): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +/index.ts(6,50): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +/index.ts(7,49): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== /index.ts (3 errors) ==== @@ -13,10 +13,10 @@ ~~~~~~~~~~~~~~~~ !!! error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export interface Loc extends Req, Imp {} export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node20).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node20).errors.txt new file mode 100644 index 0000000000000..77b7ff5cd3914 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node20).errors.txt @@ -0,0 +1,42 @@ +/index.ts(6,14): error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. +/index.ts(6,50): error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. +/index.ts(7,49): error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. + + +==== /index.ts (3 errors) ==== + import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + + export interface LocalInterface extends RequireInterface, ImportInterface {} + + import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. + ~~~~~~ +!!! error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. + import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; + ~~~~~~ +!!! error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. + export interface Loc extends Req, Imp {} + + export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} +==== /package.json (0 errors) ==== + { + "private": true, + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node20).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node20).js new file mode 100644 index 0000000000000..fad19d466a6ac --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node20).js @@ -0,0 +1,49 @@ +//// [tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit2.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [index.ts] +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; +import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + + +//// [index.js] +export {}; + + +//// [index.d.ts] +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +export interface LocalInterface extends RequireInterface, ImportInterface { +} +import { type RequireInterface as Req } from "pkg" assert { "resolution-mode": "require" }; +import { type ImportInterface as Imp } from "pkg" assert { "resolution-mode": "import" }; +export interface Loc extends Req, Imp { +} +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node20).symbols b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node20).symbols new file mode 100644 index 0000000000000..8d280aee6ffa1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node20).symbols @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit2.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) + +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +export interface LocalInterface extends RequireInterface, ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 1, 82)) +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; +>Req : Symbol(Req, Decl(index.ts, 5, 8)) + +import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export interface Loc extends Req, Imp {} +>Loc : Symbol(Loc, Decl(index.ts, 6, 87)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 9, 13)) + +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 10, 13)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node20).types b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node20).types new file mode 100644 index 0000000000000..60e006fe4390a --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node20).types @@ -0,0 +1,41 @@ +//// [tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit2.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : RequireInterface +> : ^^^^^^^^^^^^^^^^ + +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : ImportInterface +> : ^^^^^^^^^^^^^^^ + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : any +> : ^^^ +>Req : any +> : ^^^ + +import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : any +> : ^^^ +>Imp : any +> : ^^^ + +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : RequireInterface +> : ^^^^^^^^^^^^^^^^ + +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : ImportInterface +> : ^^^^^^^^^^^^^^^ + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).errors.txt index 1bf72bb46af00..01bef5234cff9 100644 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).errors.txt @@ -1,15 +1,15 @@ -/index.ts(2,45): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +/index.ts(2,45): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. /index.ts(2,73): error TS1453: `resolution-mode` should be either `require` or `import`. /index.ts(4,10): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. -/index.ts(4,39): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -/index.ts(6,76): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +/index.ts(4,39): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +/index.ts(6,76): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== /index.ts (5 errors) ==== // incorrect mode import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ~~~~~~~~ !!! error TS1453: `resolution-mode` should be either `require` or `import`. // not type-only @@ -17,11 +17,11 @@ ~~~~~~~~~~~~~~~ !!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. // not exclusively type-only import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" assert { "resolution-mode": "require" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export interface LocalInterface extends RequireInterface, ImportInterface {} diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node20).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node20).errors.txt new file mode 100644 index 0000000000000..11d577b0ea7d6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node20).errors.txt @@ -0,0 +1,43 @@ +/index.ts(2,45): error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. +/index.ts(2,73): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(4,10): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. +/index.ts(4,39): error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. +/index.ts(6,76): error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. + + +==== /index.ts (5 errors) ==== + // incorrect mode + import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; + ~~~~~~ +!!! error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. + ~~~~~~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + // not type-only + import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. + ~~~~~~ +!!! error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. + // not exclusively type-only + import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" assert { "resolution-mode": "require" }; + ~~~~~~ +!!! error TS2880: Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'. + + export interface LocalInterface extends RequireInterface, ImportInterface {} + + + + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node20).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node20).js new file mode 100644 index 0000000000000..3b2af2656d08b --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node20).js @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesImportModeDeclarationEmitErrors1.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +// incorrect mode +import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; +// not type-only +import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" assert { "resolution-mode": "require" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + + + + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [index.d.ts] +import type { RequireInterface } from "pkg"; +import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +export interface LocalInterface extends RequireInterface, ImportInterface { +} diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node20).symbols b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node20).symbols new file mode 100644 index 0000000000000..b209c65c177c1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node20).symbols @@ -0,0 +1,30 @@ +//// [tests/cases/conformance/node/nodeModulesImportModeDeclarationEmitErrors1.ts] //// + +=== /index.ts === +// incorrect mode +import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 1, 13)) + +// not type-only +import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 3, 8)) + +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) +>Req2 : Symbol(Req2, Decl(index.ts, 5, 37)) + +export interface LocalInterface extends RequireInterface, ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 5, 115)) +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 1, 13)) +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 3, 8)) + + + + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node20).types b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node20).types new file mode 100644 index 0000000000000..b9bc7c1552479 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node20).types @@ -0,0 +1,32 @@ +//// [tests/cases/conformance/node/nodeModulesImportModeDeclarationEmitErrors1.ts] //// + +=== /index.ts === +// incorrect mode +import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; +>RequireInterface : RequireInterface +> : ^^^^^^^^^^^^^^^^ + +// not type-only +import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : any +> : ^^^ + +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : any +> : ^^^ +>Req : any +> : ^^^ +>RequireInterface : any +> : ^^^ +>Req2 : any +> : ^^^ + +export interface LocalInterface extends RequireInterface, ImportInterface {} + + + + +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node20).js b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node20).js new file mode 100644 index 0000000000000..a60b20a63d224 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node20).js @@ -0,0 +1,80 @@ +//// [tests/cases/conformance/node/nodeModulesImportResolutionIntoExport.ts] //// + +//// [index.ts] +// esm format file +import * as type from "#type"; +type; +//// [index.mts] +// esm format file +import * as type from "#type"; +type; +//// [index.cts] +// esm format file +import * as type from "#type"; +type; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.cjs", + "imports": { + "#type": "package" + } +} + +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// esm format file +const type = __importStar(require("#type")); +type; +//// [index.js] +// esm format file +import * as type from "#type"; +type; +//// [index.mjs] +// esm format file +import * as type from "#type"; +type; + + +//// [index.d.cts] +export {}; +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; diff --git a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node20).symbols b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node20).symbols new file mode 100644 index 0000000000000..81f53360e0ce2 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node20).symbols @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/node/nodeModulesImportResolutionIntoExport.ts] //// + +=== index.ts === +// esm format file +import * as type from "#type"; +>type : Symbol(type, Decl(index.ts, 1, 6)) + +type; +>type : Symbol(type, Decl(index.ts, 1, 6)) + +=== index.mts === +// esm format file +import * as type from "#type"; +>type : Symbol(type, Decl(index.mts, 1, 6)) + +type; +>type : Symbol(type, Decl(index.mts, 1, 6)) + +=== index.cts === +// esm format file +import * as type from "#type"; +>type : Symbol(type, Decl(index.cts, 1, 6)) + +type; +>type : Symbol(type, Decl(index.cts, 1, 6)) + diff --git a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node20).types b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node20).types new file mode 100644 index 0000000000000..594635bc9aee3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node20).types @@ -0,0 +1,32 @@ +//// [tests/cases/conformance/node/nodeModulesImportResolutionIntoExport.ts] //// + +=== index.ts === +// esm format file +import * as type from "#type"; +>type : typeof type +> : ^^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +=== index.mts === +// esm format file +import * as type from "#type"; +>type : typeof type +> : ^^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +=== index.cts === +// esm format file +import * as type from "#type"; +>type : typeof type +> : ^^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node20).errors.txt b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node20).errors.txt new file mode 100644 index 0000000000000..01d8a2fd08354 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node20).errors.txt @@ -0,0 +1,33 @@ +index.cts(2,23): error TS2307: Cannot find module '#type' or its corresponding type declarations. +index.mts(2,23): error TS2307: Cannot find module '#type' or its corresponding type declarations. +index.ts(2,23): error TS2307: Cannot find module '#type' or its corresponding type declarations. + + +==== index.ts (1 errors) ==== + // esm format file + import * as type from "#type"; + ~~~~~~~ +!!! error TS2307: Cannot find module '#type' or its corresponding type declarations. + type; +==== index.mts (1 errors) ==== + // esm format file + import * as type from "#type"; + ~~~~~~~ +!!! error TS2307: Cannot find module '#type' or its corresponding type declarations. + type; +==== index.cts (1 errors) ==== + // esm format file + import * as type from "#type"; + ~~~~~~~ +!!! error TS2307: Cannot find module '#type' or its corresponding type declarations. + type; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "package", + "imports": { + "#type": "package" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node20).js b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node20).js new file mode 100644 index 0000000000000..fa6401e1a49a4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node20).js @@ -0,0 +1,80 @@ +//// [tests/cases/conformance/node/nodeModulesImportResolutionNoCycle.ts] //// + +//// [index.ts] +// esm format file +import * as type from "#type"; +type; +//// [index.mts] +// esm format file +import * as type from "#type"; +type; +//// [index.cts] +// esm format file +import * as type from "#type"; +type; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "package", + "imports": { + "#type": "package" + } +} + +//// [index.js] +// esm format file +import * as type from "#type"; +type; +//// [index.mjs] +// esm format file +import * as type from "#type"; +type; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// esm format file +const type = __importStar(require("#type")); +type; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node20).symbols b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node20).symbols new file mode 100644 index 0000000000000..06c86181b6d0d --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node20).symbols @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/node/nodeModulesImportResolutionNoCycle.ts] //// + +=== index.ts === +// esm format file +import * as type from "#type"; +>type : Symbol(type, Decl(index.ts, 1, 6)) + +type; +>type : Symbol(type, Decl(index.ts, 1, 6)) + +=== index.mts === +// esm format file +import * as type from "#type"; +>type : Symbol(type, Decl(index.mts, 1, 6)) + +type; +>type : Symbol(type, Decl(index.mts, 1, 6)) + +=== index.cts === +// esm format file +import * as type from "#type"; +>type : Symbol(type, Decl(index.cts, 1, 6)) + +type; +>type : Symbol(type, Decl(index.cts, 1, 6)) + diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node20).types b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node20).types new file mode 100644 index 0000000000000..d00dcba79df38 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node20).types @@ -0,0 +1,32 @@ +//// [tests/cases/conformance/node/nodeModulesImportResolutionNoCycle.ts] //// + +=== index.ts === +// esm format file +import * as type from "#type"; +>type : any +> : ^^^ + +type; +>type : any +> : ^^^ + +=== index.mts === +// esm format file +import * as type from "#type"; +>type : any +> : ^^^ + +type; +>type : any +> : ^^^ + +=== index.cts === +// esm format file +import * as type from "#type"; +>type : any +> : ^^^ + +type; +>type : any +> : ^^^ + diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node20).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node20).js new file mode 100644 index 0000000000000..6c0a3531fac79 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node20).js @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmit1.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +export type LocalInterface = + & import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface); +export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; + + +//// [index.d.ts] +export type LocalInterface = import("pkg", { assert: { "resolution-mode": "require" } }).RequireInterface & import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node20).symbols b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node20).symbols new file mode 100644 index 0000000000000..7558565243724 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node20).symbols @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmit1.ts] //// + +=== /index.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) + + & import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +export const a = (null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface); +>a : Symbol(a, Decl(index.ts, 4, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); +>b : Symbol(b, Decl(index.ts, 5, 12)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node20).types b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node20).types new file mode 100644 index 0000000000000..87c7913723785 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node20).types @@ -0,0 +1,34 @@ +//// [tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmit1.ts] //// + +=== /index.ts === +export type LocalInterface = +>LocalInterface : LocalInterface +> : ^^^^^^^^^^^^^^ + + & import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any : any + +export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); +>b : import("/node_modules/pkg/import").ImportInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface) : import("/node_modules/pkg/import").ImportInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface : import("/node_modules/pkg/import").ImportInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any : any + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node20).errors.txt b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node20).errors.txt new file mode 100644 index 0000000000000..632a556e1395f --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node20).errors.txt @@ -0,0 +1,308 @@ +/index.ts(2,51): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(5,78): error TS1453: `resolution-mode` should be either `require` or `import`. +/other.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other.ts(3,22): error TS1005: 'with' expected. +/other.ts(3,39): error TS1005: ';' expected. +/other.ts(3,50): error TS1128: Declaration or statement expected. +/other.ts(3,51): error TS1128: Declaration or statement expected. +/other.ts(3,52): error TS1128: Declaration or statement expected. +/other.ts(3,53): error TS2304: Cannot find name 'RequireInterface'. +/other.ts(4,22): error TS2353: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. +/other.ts(4,52): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/other.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other.ts(6,49): error TS1005: 'with' expected. +/other.ts(6,66): error TS1005: ';' expected. +/other.ts(6,77): error TS1128: Declaration or statement expected. +/other.ts(6,78): error TS1128: Declaration or statement expected. +/other.ts(6,79): error TS1128: Declaration or statement expected. +/other.ts(6,80): error TS1434: Unexpected keyword or identifier. +/other.ts(6,80): error TS2304: Cannot find name 'RequireInterface'. +/other.ts(6,96): error TS1128: Declaration or statement expected. +/other.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other.ts(7,49): error TS1005: 'with' expected. +/other.ts(7,66): error TS1005: ';' expected. +/other.ts(7,76): error TS1128: Declaration or statement expected. +/other.ts(7,77): error TS1128: Declaration or statement expected. +/other.ts(7,78): error TS1128: Declaration or statement expected. +/other.ts(7,79): error TS1434: Unexpected keyword or identifier. +/other.ts(7,79): error TS2304: Cannot find name 'ImportInterface'. +/other.ts(7,94): error TS1128: Declaration or statement expected. +/other2.ts(3,32): error TS1455: `resolution-mode` is the only valid key for type import assertions. +/other2.ts(4,32): error TS1455: `resolution-mode` is the only valid key for type import assertions. +/other2.ts(4,52): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +/other2.ts(6,59): error TS1455: `resolution-mode` is the only valid key for type import assertions. +/other2.ts(7,59): error TS1455: `resolution-mode` is the only valid key for type import assertions. +/other2.ts(7,79): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +/other3.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other3.ts(3,21): error TS1005: '{' expected. +/other3.ts(3,23): error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. +/other3.ts(3,55): error TS1005: ';' expected. +/other3.ts(3,56): error TS1128: Declaration or statement expected. +/other3.ts(3,57): error TS2304: Cannot find name 'RequireInterface'. +/other3.ts(4,21): error TS2322: Type '{ "resolution-mode": string; }[]' is not assignable to type 'ImportCallOptions'. + Types of property 'with' are incompatible. + Type '(index: number, value: { "resolution-mode": string; }) => { "resolution-mode": string; }[]' is not assignable to type 'ImportAttributes'. + Index signature for type 'string' is missing in type '(index: number, value: { "resolution-mode": string; }) => { "resolution-mode": string; }[]'. +/other3.ts(4,56): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/other3.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other3.ts(6,48): error TS1005: '{' expected. +/other3.ts(6,50): error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. +/other3.ts(6,100): error TS1005: ',' expected. +/other3.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other3.ts(7,48): error TS1005: '{' expected. +/other3.ts(7,50): error TS2538: Type '{ "resolution-mode": "import"; }' cannot be used as an index type. +/other3.ts(7,98): error TS1005: ',' expected. +/other4.ts(6,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other4.ts(6,21): error TS1005: '{' expected. +/other4.ts(6,21): error TS2448: Block-scoped variable 'Asserts1' used before its declaration. +/other4.ts(6,29): error TS1128: Declaration or statement expected. +/other4.ts(6,30): error TS1128: Declaration or statement expected. +/other4.ts(6,31): error TS2448: Block-scoped variable 'RequireInterface' used before its declaration. +/other4.ts(7,21): error TS2448: Block-scoped variable 'Asserts2' used before its declaration. +/other4.ts(7,31): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/other4.ts(9,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other4.ts(9,48): error TS1005: '{' expected. +/other4.ts(9,56): error TS1005: ',' expected. +/other4.ts(9,57): error TS1134: Variable declaration expected. +/other4.ts(9,74): error TS1005: ',' expected. +/other4.ts(10,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other4.ts(10,48): error TS1005: '{' expected. +/other4.ts(10,56): error TS1005: ',' expected. +/other4.ts(10,57): error TS1134: Variable declaration expected. +/other4.ts(10,73): error TS1005: ',' expected. +/other5.ts(2,31): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. +/other5.ts(3,31): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. +/other5.ts(3,37): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +/other5.ts(5,58): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. +/other5.ts(6,58): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. +/other5.ts(6,64): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} +==== /index.ts (2 errors) ==== + export type LocalInterface = + & import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface + ~~~~~~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; + + export const a = (null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface); + ~~~~~~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); +==== /other.ts (27 errors) ==== + // missing assert: + export type LocalInterface = + & import("pkg", {"resolution-mode": "require"}).RequireInterface + ~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~~~~~~~~ +!!! error TS1005: 'with' expected. +!!! related TS1007 /other.ts:3:21: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + & import("pkg", {"resolution-mode": "import"}).ImportInterface; + ~~~~~~~~~~~~~~~~~ +!!! error TS2353: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); + ~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~~~~~~~~ +!!! error TS1005: 'with' expected. +!!! related TS1007 /other.ts:6:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS1434: Unexpected keyword or identifier. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + ~ +!!! error TS1128: Declaration or statement expected. + export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); + ~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~~~~~~~~ +!!! error TS1005: 'with' expected. +!!! related TS1007 /other.ts:7:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~ +!!! error TS1434: Unexpected keyword or identifier. + ~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'ImportInterface'. + ~ +!!! error TS1128: Declaration or statement expected. +==== /other2.ts (6 errors) ==== + // wrong assertion key + export type LocalInterface = + & import("pkg", { assert: {"bad": "require"} }).RequireInterface + ~~~~~ +!!! error TS1455: `resolution-mode` is the only valid key for type import assertions. + & import("pkg", { assert: {"bad": "import"} }).ImportInterface; + ~~~~~ +!!! error TS1455: `resolution-mode` is the only valid key for type import assertions. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + + export const a = (null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface); + ~~~~~ +!!! error TS1455: `resolution-mode` is the only valid key for type import assertions. + export const b = (null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface); + ~~~~~ +!!! error TS1455: `resolution-mode` is the only valid key for type import assertions. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +==== /other3.ts (16 errors) ==== + // Array instead of object-y thing + export type LocalInterface = + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other3.ts:3:21: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type '{ "resolution-mode": string; }[]' is not assignable to type 'ImportCallOptions'. +!!! error TS2322: Types of property 'with' are incompatible. +!!! error TS2322: Type '(index: number, value: { "resolution-mode": string; }) => { "resolution-mode": string; }[]' is not assignable to type 'ImportAttributes'. +!!! error TS2322: Index signature for type 'string' is missing in type '(index: number, value: { "resolution-mode": string; }) => { "resolution-mode": string; }[]'. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other3.ts:6:48: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. + ~ +!!! error TS1005: ',' expected. + export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other3.ts:7:48: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2538: Type '{ "resolution-mode": "import"; }' cannot be used as an index type. + ~ +!!! error TS1005: ',' expected. +==== /other4.ts (18 errors) ==== + // Indirected assertion objecty-thing - not allowed + type Asserts1 = { assert: {"resolution-mode": "require"} }; + type Asserts2 = { assert: {"resolution-mode": "import"} }; + + export type LocalInterface = + & import("pkg", Asserts1).RequireInterface + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other4.ts:6:21: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~ +!!! error TS2448: Block-scoped variable 'Asserts1' used before its declaration. +!!! related TS2728 /other4.ts:9:48: 'Asserts1' is declared here. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2448: Block-scoped variable 'RequireInterface' used before its declaration. +!!! related TS2728 /other4.ts:9:58: 'RequireInterface' is declared here. + & import("pkg", Asserts2).ImportInterface; + ~~~~~~~~ +!!! error TS2448: Block-scoped variable 'Asserts2' used before its declaration. +!!! related TS2728 /other4.ts:10:48: 'Asserts2' is declared here. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", Asserts1).RequireInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other4.ts:9:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1134: Variable declaration expected. + ~ +!!! error TS1005: ',' expected. + export const b = (null as any as import("pkg", Asserts2).ImportInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other4.ts:10:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1134: Variable declaration expected. + ~ +!!! error TS1005: ',' expected. +==== /other5.ts (6 errors) ==== + export type LocalInterface = + & import("pkg", { assert: {} }).RequireInterface + ~~ +!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. + & import("pkg", { assert: {} }).ImportInterface; + ~~ +!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + + export const a = (null as any as import("pkg", { assert: {} }).RequireInterface); + ~~ +!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. + export const b = (null as any as import("pkg", { assert: {} }).ImportInterface); + ~~ +!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node20).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node20).js new file mode 100644 index 0000000000000..813770edf9748 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node20).js @@ -0,0 +1,147 @@ +//// [tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmitErrors1.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +export type LocalInterface = + & import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface); +export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); +//// [other.ts] +// missing assert: +export type LocalInterface = + & import("pkg", {"resolution-mode": "require"}).RequireInterface + & import("pkg", {"resolution-mode": "import"}).ImportInterface; + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); +//// [other2.ts] +// wrong assertion key +export type LocalInterface = + & import("pkg", { assert: {"bad": "require"} }).RequireInterface + & import("pkg", { assert: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface); +export const b = (null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface); +//// [other3.ts] +// Array instead of object-y thing +export type LocalInterface = + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); +//// [other4.ts] +// Indirected assertion objecty-thing - not allowed +type Asserts1 = { assert: {"resolution-mode": "require"} }; +type Asserts2 = { assert: {"resolution-mode": "import"} }; + +export type LocalInterface = + & import("pkg", Asserts1).RequireInterface + & import("pkg", Asserts2).ImportInterface; + +export const a = (null as any as import("pkg", Asserts1).RequireInterface); +export const b = (null as any as import("pkg", Asserts2).ImportInterface); +//// [other5.ts] +export type LocalInterface = + & import("pkg", { assert: {} }).RequireInterface + & import("pkg", { assert: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {} }).RequireInterface); +export const b = (null as any as import("pkg", { assert: {} }).ImportInterface); + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; +//// [other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +"resolution-mode"; +"require"; +RequireInterface + & import("pkg", { "resolution-mode": "import" }).ImportInterface; +exports.a = null; +"resolution-mode"; +"require"; +RequireInterface; +; +exports.b = null; +"resolution-mode"; +"import"; +ImportInterface; +; +//// [other2.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; +//// [other3.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +RequireInterface + & import("pkg", [{ "resolution-mode": "import" }]).ImportInterface; +exports.a = null.RequireInterface; +exports.b = null.ImportInterface; +//// [other4.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImportInterface = exports.Asserts2 = exports.b = exports.RequireInterface = exports.Asserts1 = exports.a = void 0; +exports.Asserts1; +exports.RequireInterface + & import("pkg", exports.Asserts2).ImportInterface; +exports.a = null; +exports.b = null; +//// [other5.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; + + +//// [index.d.ts] +export type LocalInterface = import("pkg", { assert: { "resolution-mode": "foobar" } }).RequireInterface & import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; +//// [other.d.ts] +export type LocalInterface = import("pkg", { with: {} }); +export declare const a: import("pkg", { with: {} }); +export declare const b: import("pkg", { with: {} }); +//// [other2.d.ts] +export type LocalInterface = import("pkg", { assert: { "bad": "require" } }).RequireInterface & import("pkg", { assert: { "bad": "import" } }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: any; +//// [other3.d.ts] +export type LocalInterface = import("pkg", { with: {} })[{ + "resolution-mode": "require"; +}]; +export declare const a: any; +export declare const b: any; +//// [other4.d.ts] +export type LocalInterface = import("pkg", { with: {} }); +export declare const a: import("pkg", { with: {} }), Asserts1: any, RequireInterface: any; +export declare const b: import("pkg", { with: {} }), Asserts2: any, ImportInterface: any; +//// [other5.d.ts] +export type LocalInterface = import("pkg", { assert: {} }).RequireInterface & import("pkg", { assert: {} }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: any; diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node20).symbols b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node20).symbols new file mode 100644 index 0000000000000..ea0f4216cd5c7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node20).symbols @@ -0,0 +1,130 @@ +//// [tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmitErrors1.ts] //// + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +=== /index.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) + + & import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +export const a = (null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface); +>a : Symbol(a, Decl(index.ts, 4, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); +>b : Symbol(b, Decl(index.ts, 5, 12)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /other.ts === +// missing assert: +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other.ts, 0, 0)) + + & import("pkg", {"resolution-mode": "require"}).RequireInterface + & import("pkg", {"resolution-mode": "import"}).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other.ts, 3, 21)) + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +>a : Symbol(a, Decl(other.ts, 5, 12)) + +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); +>b : Symbol(b, Decl(other.ts, 6, 12)) + +=== /other2.ts === +// wrong assertion key +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other2.ts, 0, 0)) + + & import("pkg", { assert: {"bad": "require"} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { assert: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface); +>a : Symbol(a, Decl(other2.ts, 5, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface); +>b : Symbol(b, Decl(other2.ts, 6, 12)) + +=== /other3.ts === +// Array instead of object-y thing +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other3.ts, 0, 0)) + + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 2, 23)) + + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 3, 23)) + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +>a : Symbol(a, Decl(other3.ts, 5, 12)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 5, 50)) + +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); +>b : Symbol(b, Decl(other3.ts, 6, 12)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 6, 50)) + +=== /other4.ts === +// Indirected assertion objecty-thing - not allowed +type Asserts1 = { assert: {"resolution-mode": "require"} }; +>Asserts1 : Symbol(Asserts1, Decl(other4.ts, 0, 0), Decl(other4.ts, 8, 46)) +>assert : Symbol(assert, Decl(other4.ts, 1, 17)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other4.ts, 1, 27)) + +type Asserts2 = { assert: {"resolution-mode": "import"} }; +>Asserts2 : Symbol(Asserts2, Decl(other4.ts, 1, 59), Decl(other4.ts, 9, 46)) +>assert : Symbol(assert, Decl(other4.ts, 2, 17)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other4.ts, 2, 27)) + +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other4.ts, 2, 58)) + + & import("pkg", Asserts1).RequireInterface +>Asserts1 : Symbol(Asserts1, Decl(other4.ts, 8, 46)) +>RequireInterface : Symbol(RequireInterface, Decl(other4.ts, 8, 57)) + + & import("pkg", Asserts2).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>Asserts2 : Symbol(Asserts2, Decl(other4.ts, 9, 46)) + +export const a = (null as any as import("pkg", Asserts1).RequireInterface); +>a : Symbol(a, Decl(other4.ts, 8, 12)) +>Asserts1 : Symbol(Asserts1, Decl(other4.ts, 8, 46)) +>RequireInterface : Symbol(RequireInterface, Decl(other4.ts, 8, 57)) + +export const b = (null as any as import("pkg", Asserts2).ImportInterface); +>b : Symbol(b, Decl(other4.ts, 9, 12)) +>Asserts2 : Symbol(Asserts2, Decl(other4.ts, 9, 46)) +>ImportInterface : Symbol(ImportInterface, Decl(other4.ts, 9, 57)) + +=== /other5.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other5.ts, 0, 0)) + + & import("pkg", { assert: {} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { assert: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {} }).RequireInterface); +>a : Symbol(a, Decl(other5.ts, 4, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { assert: {} }).ImportInterface); +>b : Symbol(b, Decl(other5.ts, 5, 12)) + diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node20).types b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node20).types new file mode 100644 index 0000000000000..a38ebca6a3f1d --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node20).types @@ -0,0 +1,291 @@ +//// [tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmitErrors1.ts] //// + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} +=== /index.ts === +export type LocalInterface = +>LocalInterface : LocalInterface +> : ^^^^^^^^^^^^^^ + + & import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any : any +> : ^^^ + +export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); +>b : import("/node_modules/pkg/import").ImportInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface) : import("/node_modules/pkg/import").ImportInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface : import("/node_modules/pkg/import").ImportInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any : any +> : ^^^ + +=== /other.ts === +// missing assert: +export type LocalInterface = +>LocalInterface : any +> : ^^^ + + & import("pkg", {"resolution-mode": "require"}).RequireInterface +>"resolution-mode" : "resolution-mode" +> : ^^^^^^^^^^^^^^^^^ +>"require" : "require" +> : ^^^^^^^^^ +>RequireInterface & import("pkg", {"resolution-mode": "import"}).ImportInterface : number +> : ^^^^^^ +>RequireInterface : any +> : ^^^ + + & import("pkg", {"resolution-mode": "import"}).ImportInterface; +>import("pkg", {"resolution-mode": "import"}).ImportInterface : any +> : ^^^ +>import("pkg", {"resolution-mode": "import"}) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"pkg" : "pkg" +> : ^^^^^ +>{"resolution-mode": "import"} : { "resolution-mode": string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"resolution-mode" : string +> : ^^^^^^ +>"import" : "import" +> : ^^^^^^^^ +>ImportInterface : any +> : ^^^ + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +>a : any +> : ^^^ +>(null as any as import("pkg", { : any +> : ^^^ +>null as any as import("pkg", { : any +> : ^^^ +>null as any : any +> : ^^^ +>"resolution-mode" : "resolution-mode" +> : ^^^^^^^^^^^^^^^^^ +>"require" : "require" +> : ^^^^^^^^^ +>RequireInterface : any +> : ^^^ + +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); +>b : any +> : ^^^ +>(null as any as import("pkg", { : any +> : ^^^ +>null as any as import("pkg", { : any +> : ^^^ +>null as any : any +> : ^^^ +>"resolution-mode" : "resolution-mode" +> : ^^^^^^^^^^^^^^^^^ +>"import" : "import" +> : ^^^^^^^^ +>ImportInterface : any +> : ^^^ + +=== /other2.ts === +// wrong assertion key +export type LocalInterface = +>LocalInterface : any +> : ^^^ + + & import("pkg", { assert: {"bad": "require"} }).RequireInterface + & import("pkg", { assert: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any : any +> : ^^^ + +export const b = (null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface); +>b : any +> : ^^^ +>(null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface) : any +> : ^^^ +>null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface : any +> : ^^^ +>null as any : any +> : ^^^ + +=== /other3.ts === +// Array instead of object-y thing +export type LocalInterface = +>LocalInterface : any +> : ^^^ + + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface +>"resolution-mode" : "require" +> : ^^^^^^^^^ +>RequireInterface & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : number +> : ^^^^^^ +>RequireInterface : any +> : ^^^ + + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; +>import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : any +> : ^^^ +>import("pkg", [ {"resolution-mode": "import"} ]) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"pkg" : "pkg" +> : ^^^^^ +>[ {"resolution-mode": "import"} ] : { "resolution-mode": string; }[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{"resolution-mode": "import"} : { "resolution-mode": string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"resolution-mode" : string +> : ^^^^^^ +>"import" : "import" +> : ^^^^^^^^ +>ImportInterface : any +> : ^^^ + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +>a : any +> : ^^^ +>(null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface : any +> : ^^^ +>(null as any as import("pkg", [ {"resolution-mode": "require"} ]) : any +> : ^^^ +>null as any as import("pkg", [ {"resolution-mode": "require"} ] : any +> : ^^^ +>null as any : any +> : ^^^ +>"resolution-mode" : "require" +> : ^^^^^^^^^ +>RequireInterface : any +> : ^^^ + +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); +>b : any +> : ^^^ +>(null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : any +> : ^^^ +>(null as any as import("pkg", [ {"resolution-mode": "import"} ]) : any +> : ^^^ +>null as any as import("pkg", [ {"resolution-mode": "import"} ] : any +> : ^^^ +>null as any : any +> : ^^^ +>"resolution-mode" : "import" +> : ^^^^^^^^ +>ImportInterface : any +> : ^^^ + +=== /other4.ts === +// Indirected assertion objecty-thing - not allowed +type Asserts1 = { assert: {"resolution-mode": "require"} }; +>Asserts1 : Asserts1 +> : ^^^^^^^^ +>assert : { "resolution-mode": "require"; } +> : ^^^^^^^^^^^^^^^^^^^^^ ^^^ +>"resolution-mode" : "require" +> : ^^^^^^^^^ + +type Asserts2 = { assert: {"resolution-mode": "import"} }; +>Asserts2 : Asserts2 +> : ^^^^^^^^ +>assert : { "resolution-mode": "import"; } +> : ^^^^^^^^^^^^^^^^^^^^^ ^^^ +>"resolution-mode" : "import" +> : ^^^^^^^^ + +export type LocalInterface = +>LocalInterface : any +> : ^^^ + + & import("pkg", Asserts1).RequireInterface +>Asserts1 : any +> : ^^^ +>RequireInterface & import("pkg", Asserts2).ImportInterface : number +> : ^^^^^^ +>RequireInterface : any +> : ^^^ + + & import("pkg", Asserts2).ImportInterface; +>import("pkg", Asserts2).ImportInterface : any +> : ^^^ +>import("pkg", Asserts2) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"pkg" : "pkg" +> : ^^^^^ +>Asserts2 : any +> : ^^^ +>ImportInterface : any +> : ^^^ + +export const a = (null as any as import("pkg", Asserts1).RequireInterface); +>a : any +> : ^^^ +>(null as any as import("pkg", : any +> : ^^^ +>null as any as import("pkg", : any +> : ^^^ +>null as any : any +> : ^^^ +>Asserts1 : any +> : ^^^ +>RequireInterface : any +> : ^^^ + +export const b = (null as any as import("pkg", Asserts2).ImportInterface); +>b : any +> : ^^^ +>(null as any as import("pkg", : any +> : ^^^ +>null as any as import("pkg", : any +> : ^^^ +>null as any : any +> : ^^^ +>Asserts2 : any +> : ^^^ +>ImportInterface : any +> : ^^^ + +=== /other5.ts === +export type LocalInterface = +>LocalInterface : any +> : ^^^ + + & import("pkg", { assert: {} }).RequireInterface + & import("pkg", { assert: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(null as any as import("pkg", { assert: {} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any as import("pkg", { assert: {} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>null as any : any +> : ^^^ + +export const b = (null as any as import("pkg", { assert: {} }).ImportInterface); +>b : any +> : ^^^ +>(null as any as import("pkg", { assert: {} }).ImportInterface) : any +> : ^^^ +>null as any as import("pkg", { assert: {} }).ImportInterface : any +> : ^^^ +>null as any : any +> : ^^^ + diff --git a/tests/baselines/reference/nodeModulesJson(module=node16).errors.txt b/tests/baselines/reference/nodeModulesJson(module=node16).errors.txt index 8977f188ced9e..f0a9b3b5f8c30 100644 --- a/tests/baselines/reference/nodeModulesJson(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesJson(module=node16).errors.txt @@ -1,11 +1,11 @@ -/loosey.cts(1,36): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +/loosey.cts(1,36): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. /loosey.cts(6,9): error TS2339: Property 'default' does not exist on type '{ version: number; }'. -/main.mts(5,36): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -/main.mts(6,52): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -/main.mts(9,47): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +/main.mts(5,36): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +/main.mts(6,52): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +/main.mts(9,47): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. /main.mts(10,10): error TS1544: Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to 'Node16'. -/main.mts(10,41): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -/main.mts(11,42): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +/main.mts(10,41): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +/main.mts(11,42): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. /main.mts(12,9): error TS2339: Property 'version' does not exist on type '{ default: { version: number; }; }'. @@ -50,23 +50,23 @@ import config from "./config.json" with { type: "json" }; // Ok ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import { default as config1 } from "./config.json" with { type: "json" }; // Ok ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import config2 from "./config.json"; // Error in nodenext, no attribute import type config2Type from "./config.json"; // Ok, type-only import type config2Type2 from "./config.json" with { type: "json" }; // Error, import attributes not allowed on type-only imports ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import { version } from "./config.json" with { type: "json" }; // Error, named import ~~~~~~~ !!! error TS1544: Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to 'Node16'. ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import * as config3 from "./config.json" with { type: "json" }; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. config3.version; // Error ~~~~~~~ !!! error TS2339: Property 'version' does not exist on type '{ default: { version: number; }; }'. @@ -75,7 +75,7 @@ ==== /loosey.cts (2 errors) ==== import config from "./config.json" with { type: "json" }; // Error ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. import config2 from "./config.json"; // Ok import { version } from "./config.json"; // Ok import * as config3 from "./config.json"; diff --git a/tests/baselines/reference/nodeModulesJson(module=node20).errors.txt b/tests/baselines/reference/nodeModulesJson(module=node20).errors.txt new file mode 100644 index 0000000000000..d828b1b8da6c8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesJson(module=node20).errors.txt @@ -0,0 +1,83 @@ +/loosey.cts(1,36): error TS2856: Import attributes are not allowed on statements that compile to CommonJS 'require' calls. +/loosey.cts(6,9): error TS2339: Property 'default' does not exist on type '{ version: number; }'. +/main.mts(2,22): error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'Node20'. +/main.mts(3,19): error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'Node20'. +/main.mts(7,21): error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'Node20'. +/main.mts(9,47): error TS2857: Import attributes cannot be used with type-only imports or exports. +/main.mts(10,10): error TS1544: Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to 'Node20'. +/main.mts(12,9): error TS2339: Property 'version' does not exist on type '{ default: { version: number; }; }'. + + +==== /node_modules/not.json/package.json (0 errors) ==== + { + "name": "not.json", + "version": "1.0.0", + "type": "module", + "exports": "./index.js" + } + +==== /node_modules/not.json/index.d.ts (0 errors) ==== + export function oops(json: string): any; + +==== /node_modules/actually-json/package.json (0 errors) ==== + { + "name": "actually-json", + "version": "1.0.0", + "type": "module", + "exports": { + ".": "./index.json", + "./typed": "./typed.d.json.ts" + } + } + +==== /node_modules/actually-json/index.json (0 errors) ==== + {} + +==== /node_modules/actually-json/typed.d.json.ts (0 errors) ==== + declare const _default: {}; + export default _default; + +==== /config.json (0 errors) ==== + { + "version": 1 + } + +==== /main.mts (6 errors) ==== + import { oops } from "not.json"; // Ok + import moreOops from "actually-json"; // Error in nodenext + ~~~~~~~~~~~~~~~ +!!! error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'Node20'. + import typed from "actually-json/typed"; // Error in nodenext + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'Node20'. + + import config from "./config.json" with { type: "json" }; // Ok + import { default as config1 } from "./config.json" with { type: "json" }; // Ok + import config2 from "./config.json"; // Error in nodenext, no attribute + ~~~~~~~~~~~~~~~ +!!! error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'Node20'. + import type config2Type from "./config.json"; // Ok, type-only + import type config2Type2 from "./config.json" with { type: "json" }; // Error, import attributes not allowed on type-only imports + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2857: Import attributes cannot be used with type-only imports or exports. + import { version } from "./config.json" with { type: "json" }; // Error, named import + ~~~~~~~ +!!! error TS1544: Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to 'Node20'. + import * as config3 from "./config.json" with { type: "json" }; + config3.version; // Error + ~~~~~~~ +!!! error TS2339: Property 'version' does not exist on type '{ default: { version: number; }; }'. + config3.default; // Ok + +==== /loosey.cts (2 errors) ==== + import config from "./config.json" with { type: "json" }; // Error + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2856: Import attributes are not allowed on statements that compile to CommonJS 'require' calls. + import config2 from "./config.json"; // Ok + import { version } from "./config.json"; // Ok + import * as config3 from "./config.json"; + config3.version; // Ok + config3.default; // Error + ~~~~~~~ +!!! error TS2339: Property 'default' does not exist on type '{ version: number; }'. + \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesJson(module=node20).symbols b/tests/baselines/reference/nodeModulesJson(module=node20).symbols new file mode 100644 index 0000000000000..52d983d5b9516 --- /dev/null +++ b/tests/baselines/reference/nodeModulesJson(module=node20).symbols @@ -0,0 +1,85 @@ +//// [tests/cases/conformance/node/nodeModulesJson.ts] //// + +=== /node_modules/not.json/index.d.ts === +export function oops(json: string): any; +>oops : Symbol(oops, Decl(index.d.ts, 0, 0)) +>json : Symbol(json, Decl(index.d.ts, 0, 21)) + +=== /node_modules/actually-json/index.json === + +{} + +=== /node_modules/actually-json/typed.d.json.ts === +declare const _default: {}; +>_default : Symbol(_default, Decl(typed.d.json.ts, 0, 13)) + +export default _default; +>_default : Symbol(_default, Decl(typed.d.json.ts, 0, 13)) + +=== /config.json === +{ + "version": 1 +>"version" : Symbol("version", Decl(config.json, 0, 1)) +} + +=== /main.mts === +import { oops } from "not.json"; // Ok +>oops : Symbol(oops, Decl(main.mts, 0, 8)) + +import moreOops from "actually-json"; // Error in nodenext +>moreOops : Symbol(moreOops, Decl(main.mts, 1, 6)) + +import typed from "actually-json/typed"; // Error in nodenext +>typed : Symbol(typed, Decl(main.mts, 2, 6)) + +import config from "./config.json" with { type: "json" }; // Ok +>config : Symbol(config, Decl(main.mts, 4, 6)) + +import { default as config1 } from "./config.json" with { type: "json" }; // Ok +>default : Symbol(config, Decl(config.json, 0, 0)) +>config1 : Symbol(config1, Decl(main.mts, 5, 8)) + +import config2 from "./config.json"; // Error in nodenext, no attribute +>config2 : Symbol(config2, Decl(main.mts, 6, 6)) + +import type config2Type from "./config.json"; // Ok, type-only +>config2Type : Symbol(config2Type, Decl(main.mts, 7, 6)) + +import type config2Type2 from "./config.json" with { type: "json" }; // Error, import attributes not allowed on type-only imports +>config2Type2 : Symbol(config2Type2, Decl(main.mts, 8, 6)) + +import { version } from "./config.json" with { type: "json" }; // Error, named import +>version : Symbol(version, Decl(main.mts, 9, 8)) + +import * as config3 from "./config.json" with { type: "json" }; +>config3 : Symbol(config3, Decl(main.mts, 10, 6)) + +config3.version; // Error +>config3 : Symbol(config3, Decl(main.mts, 10, 6)) + +config3.default; // Ok +>config3.default : Symbol("/config") +>config3 : Symbol(config3, Decl(main.mts, 10, 6)) +>default : Symbol("/config") + +=== /loosey.cts === +import config from "./config.json" with { type: "json" }; // Error +>config : Symbol(config, Decl(loosey.cts, 0, 6)) + +import config2 from "./config.json"; // Ok +>config2 : Symbol(config2, Decl(loosey.cts, 1, 6)) + +import { version } from "./config.json"; // Ok +>version : Symbol(version, Decl(loosey.cts, 2, 8)) + +import * as config3 from "./config.json"; +>config3 : Symbol(config3, Decl(loosey.cts, 3, 6)) + +config3.version; // Ok +>config3.version : Symbol(version, Decl(config.json, 0, 1)) +>config3 : Symbol(config3, Decl(loosey.cts, 3, 6)) +>version : Symbol(version, Decl(config.json, 0, 1)) + +config3.default; // Error +>config3 : Symbol(config3, Decl(loosey.cts, 3, 6)) + diff --git a/tests/baselines/reference/nodeModulesJson(module=node20).types b/tests/baselines/reference/nodeModulesJson(module=node20).types new file mode 100644 index 0000000000000..37ac9a196dd4e --- /dev/null +++ b/tests/baselines/reference/nodeModulesJson(module=node20).types @@ -0,0 +1,139 @@ +//// [tests/cases/conformance/node/nodeModulesJson.ts] //// + +=== /node_modules/not.json/index.d.ts === +export function oops(json: string): any; +>oops : (json: string) => any +> : ^ ^^ ^^^^^ +>json : string +> : ^^^^^^ + +=== /node_modules/actually-json/index.json === +{} +>{} : {} +> : ^^ + +=== /node_modules/actually-json/typed.d.json.ts === +declare const _default: {}; +>_default : {} +> : ^^ + +export default _default; +>_default : {} +> : ^^ + +=== /config.json === +{ +>{ "version": 1} : { version: number; } +> : ^^^^^^^^^^^^^^^^^^^^ + + "version": 1 +>"version" : number +> : ^^^^^^ +>1 : 1 +> : ^ +} + +=== /main.mts === +import { oops } from "not.json"; // Ok +>oops : (json: string) => any +> : ^ ^^ ^^^^^ + +import moreOops from "actually-json"; // Error in nodenext +>moreOops : {} +> : ^^ + +import typed from "actually-json/typed"; // Error in nodenext +>typed : typeof typed +> : ^^^^^^^^^^^^ + +import config from "./config.json" with { type: "json" }; // Ok +>config : { version: number; } +> : ^^^^^^^^^^^^^^^^^^^^ +>type : any +> : ^^^ + +import { default as config1 } from "./config.json" with { type: "json" }; // Ok +>default : { version: number; } +> : ^^^^^^^^^^^^^^^^^^^^ +>config1 : { version: number; } +> : ^^^^^^^^^^^^^^^^^^^^ +>type : any +> : ^^^ + +import config2 from "./config.json"; // Error in nodenext, no attribute +>config2 : { version: number; } +> : ^^^^^^^^^^^^^^^^^^^^ + +import type config2Type from "./config.json"; // Ok, type-only +>config2Type : any +> : ^^^ + +import type config2Type2 from "./config.json" with { type: "json" }; // Error, import attributes not allowed on type-only imports +>config2Type2 : any +> : ^^^ +>type : any +> : ^^^ + +import { version } from "./config.json" with { type: "json" }; // Error, named import +>version : number +> : ^^^^^^ +>type : any +> : ^^^ + +import * as config3 from "./config.json" with { type: "json" }; +>config3 : { default: { version: number; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>type : any +> : ^^^ + +config3.version; // Error +>config3.version : any +> : ^^^ +>config3 : { default: { version: number; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>version : any +> : ^^^ + +config3.default; // Ok +>config3.default : { version: number; } +> : ^^^^^^^^^^^^^^^^^^^^ +>config3 : { default: { version: number; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>default : { version: number; } +> : ^^^^^^^^^^^^^^^^^^^^ + +=== /loosey.cts === +import config from "./config.json" with { type: "json" }; // Error +>config : { version: number; } +> : ^^^^^^^^^^^^^^^^^^^^ +>type : any +> : ^^^ + +import config2 from "./config.json"; // Ok +>config2 : { version: number; } +> : ^^^^^^^^^^^^^^^^^^^^ + +import { version } from "./config.json"; // Ok +>version : number +> : ^^^^^^ + +import * as config3 from "./config.json"; +>config3 : { version: number; } +> : ^^^^^^^^^^^^^^^^^^^^ + +config3.version; // Ok +>config3.version : number +> : ^^^^^^ +>config3 : { version: number; } +> : ^^^^^^^^^^^^^^^^^^^^ +>version : number +> : ^^^^^^ + +config3.default; // Error +>config3.default : any +> : ^^^ +>config3 : { version: number; } +> : ^^^^^^^^^^^^^^^^^^^^ +>default : any +> : ^^^ + diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=node20).errors.txt b/tests/baselines/reference/nodeModulesPackageExports(module=node20).errors.txt new file mode 100644 index 0000000000000..451122bc5b66b --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageExports(module=node20).errors.txt @@ -0,0 +1,94 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. + + +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. +==== index.ts (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + import * as typei from "inner"; + cjsi; + mjsi; + typei; +==== index.mts (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + import * as typei from "inner"; + cjsi; + mjsi; + typei; +==== index.cts (0 errors) ==== + // cjs format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + import * as typei from "inner"; + cjsi; + mjsi; + typei; +==== node_modules/inner/index.d.ts (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/mjs"; + import * as type from "inner"; + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + import * as type from "inner"; + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/index.d.cts (0 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + import * as type from "inner"; + export { cjs }; + export { mjs }; + export { type }; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=node20).js b/tests/baselines/reference/nodeModulesPackageExports(module=node20).js new file mode 100644 index 0000000000000..7d1a5738c7346 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageExports(module=node20).js @@ -0,0 +1,175 @@ +//// [tests/cases/conformance/node/nodeModulesPackageExports.ts] //// + +//// [index.ts] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.mts] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.cts] +// cjs format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +export { cjs }; +export { mjs }; +export { type }; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} + +//// [index.mjs] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjs = __importStar(require("package/cjs")); +const mjs = __importStar(require("package/mjs")); +const type = __importStar(require("package")); +cjs; +mjs; +type; +const cjsi = __importStar(require("inner/cjs")); +const mjsi = __importStar(require("inner/mjs")); +const typei = __importStar(require("inner")); +cjsi; +mjsi; +typei; +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; + + +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=node20).symbols b/tests/baselines/reference/nodeModulesPackageExports(module=node20).symbols new file mode 100644 index 0000000000000..9e1ccdd9c0683 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageExports(module=node20).symbols @@ -0,0 +1,176 @@ +//// [tests/cases/conformance/node/nodeModulesPackageExports.ts] //// + +=== index.ts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.ts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.ts, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.ts, 9, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) + +typei; +>typei : Symbol(typei, Decl(index.ts, 9, 6)) + +=== index.mts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.mts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.mts, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.mts, 9, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) + +typei; +>typei : Symbol(typei, Decl(index.mts, 9, 6)) + +=== index.cts === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.cts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.cts, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.cts, 9, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) + +typei; +>typei : Symbol(typei, Decl(index.cts, 9, 6)) + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) + +export { type }; +>type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) + +export { type }; +>type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) + diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=node20).types b/tests/baselines/reference/nodeModulesPackageExports(module=node20).types new file mode 100644 index 0000000000000..536830b78cd02 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageExports(module=node20).types @@ -0,0 +1,230 @@ +//// [tests/cases/conformance/node/nodeModulesPackageExports.ts] //// + +=== index.ts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "package/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "package"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs"; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +import * as typei from "inner"; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +typei; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +=== index.mts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "package/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "package"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs"; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +import * as typei from "inner"; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +typei; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +=== index.cts === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "package/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "package"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs"; +>mjsi : typeof cjsi.mjs +> : ^^^^^^^^^^^^^^^ + +import * as typei from "inner"; +>typei : typeof cjsi.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.mjs +> : ^^^^^^^^^^^^^^^ + +typei; +>typei : typeof cjsi.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "inner"; +>type : typeof mjs.cjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +export { type }; +>type : typeof mjs.cjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs"; +>mjs : typeof cjs.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^ + +import * as type from "inner"; +>type : typeof cjs.cjs.mjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^ + +export { type }; +>type : typeof cjs.cjs.mjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs"; +>mjs : typeof cjs.mjs +> : ^^^^^^^^^^^^^^ + +import * as type from "inner"; +>type : typeof cjs.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs.mjs +> : ^^^^^^^^^^^^^^ + +export { type }; +>type : typeof cjs.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=node20).js b/tests/baselines/reference/nodeModulesPackageImports(module=node20).js new file mode 100644 index 0000000000000..c25d1005e93d5 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node20).js @@ -0,0 +1,106 @@ +//// [tests/cases/conformance/node/nodeModulesPackageImports.ts] //// + +//// [index.ts] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [index.mts] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [index.cts] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js", + "imports": { + "#cjs": "./index.cjs", + "#mjs": "./index.mjs", + "#type": "./index.js" + } +} + +//// [index.mjs] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// esm format file +const cjs = __importStar(require("#cjs")); +const mjs = __importStar(require("#mjs")); +const type = __importStar(require("#type")); +cjs; +mjs; +type; +//// [index.js] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; + + +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=node20).symbols b/tests/baselines/reference/nodeModulesPackageImports(module=node20).symbols new file mode 100644 index 0000000000000..2004395af751e --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node20).symbols @@ -0,0 +1,62 @@ +//// [tests/cases/conformance/node/nodeModulesPackageImports.ts] //// + +=== index.ts === +// esm format file +import * as cjs from "#cjs"; +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +import * as mjs from "#mjs"; +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +import * as type from "#type"; +>type : Symbol(type, Decl(index.ts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.ts, 3, 6)) + +=== index.mts === +// esm format file +import * as cjs from "#cjs"; +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +import * as mjs from "#mjs"; +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +import * as type from "#type"; +>type : Symbol(type, Decl(index.mts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.mts, 3, 6)) + +=== index.cts === +// esm format file +import * as cjs from "#cjs"; +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +import * as mjs from "#mjs"; +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +import * as type from "#type"; +>type : Symbol(type, Decl(index.cts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.cts, 3, 6)) + diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=node20).trace.json b/tests/baselines/reference/nodeModulesPackageImports(module=node20).trace.json new file mode 100644 index 0000000000000..a9e2d084cde50 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node20).trace.json @@ -0,0 +1,1052 @@ +[ + "Found 'package.json' at '/.src/package.json'.", + "======== Resolving module '#cjs' from '/.src/index.ts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Using 'imports' subpath '#cjs' with target './index.cjs'.", + "File name '/.src/index.cjs' has a '.cjs' extension - stripping it.", + "File '/.src/index.cts' exists - use it as a name resolution result.", + "======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ========", + "======== Resolving module '#mjs' from '/.src/index.ts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Using 'imports' subpath '#mjs' with target './index.mjs'.", + "File name '/.src/index.mjs' has a '.mjs' extension - stripping it.", + "File '/.src/index.mts' exists - use it as a name resolution result.", + "======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ========", + "======== Resolving module '#type' from '/.src/index.ts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Using 'imports' subpath '#type' with target './index.js'.", + "File name '/.src/index.js' has a '.js' extension - stripping it.", + "File '/.src/index.ts' exists - use it as a name resolution result.", + "======== Module name '#type' was successfully resolved to '/.src/index.ts'. ========", + "======== Resolving module '#cjs' from '/.src/index.cts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Using 'imports' subpath '#cjs' with target './index.cjs'.", + "File name '/.src/index.cjs' has a '.cjs' extension - stripping it.", + "File '/.src/index.cts' exists - use it as a name resolution result.", + "======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ========", + "======== Resolving module '#mjs' from '/.src/index.cts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Using 'imports' subpath '#mjs' with target './index.mjs'.", + "File name '/.src/index.mjs' has a '.mjs' extension - stripping it.", + "File '/.src/index.mts' exists - use it as a name resolution result.", + "======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ========", + "======== Resolving module '#type' from '/.src/index.cts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Using 'imports' subpath '#type' with target './index.js'.", + "File name '/.src/index.js' has a '.js' extension - stripping it.", + "File '/.src/index.ts' exists - use it as a name resolution result.", + "======== Module name '#type' was successfully resolved to '/.src/index.ts'. ========", + "======== Resolving module '#cjs' from '/.src/index.mts'. ========", + "Resolution for module '#cjs' was found in cache from location '/.src'.", + "======== Module name '#cjs' was successfully resolved to '/.src/index.cts'. ========", + "======== Resolving module '#mjs' from '/.src/index.mts'. ========", + "Resolution for module '#mjs' was found in cache from location '/.src'.", + "======== Module name '#mjs' was successfully resolved to '/.src/index.mts'. ========", + "======== Resolving module '#type' from '/.src/index.mts'. ========", + "Resolution for module '#type' was found in cache from location '/.src'.", + "======== Module name '#type' was successfully resolved to '/.src/index.ts'. ========", + "File '/.ts/package.json' does not exist.", + "File '/package.json' does not exist.", + "======== Resolving module '@typescript/lib-es2023' from '/.src/__lib_node_modules_lookup_lib.es2023.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023'", + "Loading module '@typescript/lib-es2023' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022' from '/.src/__lib_node_modules_lookup_lib.es2022.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022'", + "Loading module '@typescript/lib-es2022' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021' from '/.src/__lib_node_modules_lookup_lib.es2021.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021'", + "Loading module '@typescript/lib-es2021' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020' from '/.src/__lib_node_modules_lookup_lib.es2020.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020'", + "Loading module '@typescript/lib-es2020' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019' from '/.src/__lib_node_modules_lookup_lib.es2019.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019'", + "Loading module '@typescript/lib-es2019' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018' from '/.src/__lib_node_modules_lookup_lib.es2018.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018'", + "Loading module '@typescript/lib-es2018' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017' from '/.src/__lib_node_modules_lookup_lib.es2017.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017'", + "Loading module '@typescript/lib-es2017' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2016' from '/.src/__lib_node_modules_lookup_lib.es2016.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2016' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016'", + "Loading module '@typescript/lib-es2016' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2016' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015' from '/.src/__lib_node_modules_lookup_lib.es2015.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015'", + "Loading module '@typescript/lib-es2015' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es5'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es5'", + "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es5' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-decorators' from '/.src/__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators'", + "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-decorators' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-decorators/legacy' from '/.src/__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators/legacy'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators/legacy'", + "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/core' from '/.src/__lib_node_modules_lookup_lib.es2015.core.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/core' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/core'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/core'", + "Loading module '@typescript/lib-es2015/core' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/core' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/collection' from '/.src/__lib_node_modules_lookup_lib.es2015.collection.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/collection' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/collection'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/collection'", + "Loading module '@typescript/lib-es2015/collection' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/collection' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/iterable' from '/.src/__lib_node_modules_lookup_lib.es2015.iterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/iterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/iterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/iterable'", + "Loading module '@typescript/lib-es2015/iterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/iterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/symbol' from '/.src/__lib_node_modules_lookup_lib.es2015.symbol.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/symbol' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol'", + "Loading module '@typescript/lib-es2015/symbol' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/symbol' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/generator' from '/.src/__lib_node_modules_lookup_lib.es2015.generator.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/generator' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/generator'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/generator'", + "Loading module '@typescript/lib-es2015/generator' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/generator' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/promise' from '/.src/__lib_node_modules_lookup_lib.es2015.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/promise'", + "Loading module '@typescript/lib-es2015/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/proxy' from '/.src/__lib_node_modules_lookup_lib.es2015.proxy.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/proxy' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/proxy'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/proxy'", + "Loading module '@typescript/lib-es2015/proxy' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/proxy' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/reflect' from '/.src/__lib_node_modules_lookup_lib.es2015.reflect.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/reflect' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/reflect'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/reflect'", + "Loading module '@typescript/lib-es2015/reflect' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/reflect' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/symbol-wellknown' from '/.src/__lib_node_modules_lookup_lib.es2015.symbol.wellknown.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/symbol-wellknown' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol-wellknown'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol-wellknown'", + "Loading module '@typescript/lib-es2015/symbol-wellknown' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/symbol-wellknown' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2016/array-include' from '/.src/__lib_node_modules_lookup_lib.es2016.array.include.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2016/array-include' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/array-include'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/array-include'", + "Loading module '@typescript/lib-es2016/array-include' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2016/array-include' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2016/intl' from '/.src/__lib_node_modules_lookup_lib.es2016.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2016/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/intl'", + "Loading module '@typescript/lib-es2016/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2016/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/arraybuffer' from '/.src/__lib_node_modules_lookup_lib.es2017.arraybuffer.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/arraybuffer' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/arraybuffer'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/arraybuffer'", + "Loading module '@typescript/lib-es2017/arraybuffer' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/arraybuffer' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/date' from '/.src/__lib_node_modules_lookup_lib.es2017.date.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/date' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/date'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/date'", + "Loading module '@typescript/lib-es2017/date' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/date' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/intl' from '/.src/__lib_node_modules_lookup_lib.es2017.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/intl'", + "Loading module '@typescript/lib-es2017/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/object' from '/.src/__lib_node_modules_lookup_lib.es2017.object.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/object' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/object'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/object'", + "Loading module '@typescript/lib-es2017/object' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/object' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/sharedmemory' from '/.src/__lib_node_modules_lookup_lib.es2017.sharedmemory.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/sharedmemory' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/sharedmemory'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/sharedmemory'", + "Loading module '@typescript/lib-es2017/sharedmemory' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/sharedmemory' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/string' from '/.src/__lib_node_modules_lookup_lib.es2017.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/string'", + "Loading module '@typescript/lib-es2017/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/typedarrays' from '/.src/__lib_node_modules_lookup_lib.es2017.typedarrays.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/typedarrays' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/typedarrays'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/typedarrays'", + "Loading module '@typescript/lib-es2017/typedarrays' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/typedarrays' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/asynciterable' from '/.src/__lib_node_modules_lookup_lib.es2018.asynciterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/asynciterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asynciterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asynciterable'", + "Loading module '@typescript/lib-es2018/asynciterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/asynciterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/asyncgenerator' from '/.src/__lib_node_modules_lookup_lib.es2018.asyncgenerator.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/asyncgenerator' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asyncgenerator'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asyncgenerator'", + "Loading module '@typescript/lib-es2018/asyncgenerator' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/asyncgenerator' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/promise' from '/.src/__lib_node_modules_lookup_lib.es2018.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/promise'", + "Loading module '@typescript/lib-es2018/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/regexp' from '/.src/__lib_node_modules_lookup_lib.es2018.regexp.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/regexp' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/regexp'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/regexp'", + "Loading module '@typescript/lib-es2018/regexp' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/regexp' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/intl' from '/.src/__lib_node_modules_lookup_lib.es2018.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/intl'", + "Loading module '@typescript/lib-es2018/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/array' from '/.src/__lib_node_modules_lookup_lib.es2019.array.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/array' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/array'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/array'", + "Loading module '@typescript/lib-es2019/array' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/array' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/object' from '/.src/__lib_node_modules_lookup_lib.es2019.object.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/object' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/object'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/object'", + "Loading module '@typescript/lib-es2019/object' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/object' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/string' from '/.src/__lib_node_modules_lookup_lib.es2019.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/string'", + "Loading module '@typescript/lib-es2019/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/symbol' from '/.src/__lib_node_modules_lookup_lib.es2019.symbol.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/symbol' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/symbol'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/symbol'", + "Loading module '@typescript/lib-es2019/symbol' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/symbol' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/intl' from '/.src/__lib_node_modules_lookup_lib.es2019.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/intl'", + "Loading module '@typescript/lib-es2019/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/bigint' from '/.src/__lib_node_modules_lookup_lib.es2020.bigint.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/bigint' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/bigint'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/bigint'", + "Loading module '@typescript/lib-es2020/bigint' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/bigint' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/intl' from '/.src/__lib_node_modules_lookup_lib.es2020.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/intl'", + "Loading module '@typescript/lib-es2020/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/date' from '/.src/__lib_node_modules_lookup_lib.es2020.date.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/date' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/date'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/date'", + "Loading module '@typescript/lib-es2020/date' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/date' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/number' from '/.src/__lib_node_modules_lookup_lib.es2020.number.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/number' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/number'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/number'", + "Loading module '@typescript/lib-es2020/number' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/number' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/promise' from '/.src/__lib_node_modules_lookup_lib.es2020.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/promise'", + "Loading module '@typescript/lib-es2020/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/sharedmemory' from '/.src/__lib_node_modules_lookup_lib.es2020.sharedmemory.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/sharedmemory' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/sharedmemory'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/sharedmemory'", + "Loading module '@typescript/lib-es2020/sharedmemory' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/sharedmemory' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/string' from '/.src/__lib_node_modules_lookup_lib.es2020.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/string'", + "Loading module '@typescript/lib-es2020/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/symbol-wellknown' from '/.src/__lib_node_modules_lookup_lib.es2020.symbol.wellknown.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/symbol-wellknown' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/symbol-wellknown'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/symbol-wellknown'", + "Loading module '@typescript/lib-es2020/symbol-wellknown' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/symbol-wellknown' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/promise' from '/.src/__lib_node_modules_lookup_lib.es2021.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/promise'", + "Loading module '@typescript/lib-es2021/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/string' from '/.src/__lib_node_modules_lookup_lib.es2021.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/string'", + "Loading module '@typescript/lib-es2021/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/weakref' from '/.src/__lib_node_modules_lookup_lib.es2021.weakref.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/weakref' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/weakref'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/weakref'", + "Loading module '@typescript/lib-es2021/weakref' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/weakref' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/intl' from '/.src/__lib_node_modules_lookup_lib.es2021.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/intl'", + "Loading module '@typescript/lib-es2021/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/array' from '/.src/__lib_node_modules_lookup_lib.es2022.array.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/array' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/array'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/array'", + "Loading module '@typescript/lib-es2022/array' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/array' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/error' from '/.src/__lib_node_modules_lookup_lib.es2022.error.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/error' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/error'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/error'", + "Loading module '@typescript/lib-es2022/error' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/error' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/intl' from '/.src/__lib_node_modules_lookup_lib.es2022.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/intl'", + "Loading module '@typescript/lib-es2022/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/object' from '/.src/__lib_node_modules_lookup_lib.es2022.object.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/object' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/object'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/object'", + "Loading module '@typescript/lib-es2022/object' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/object' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/regexp' from '/.src/__lib_node_modules_lookup_lib.es2022.regexp.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/regexp' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/regexp'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/regexp'", + "Loading module '@typescript/lib-es2022/regexp' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/regexp' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/string' from '/.src/__lib_node_modules_lookup_lib.es2022.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/string'", + "Loading module '@typescript/lib-es2022/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2023/array' from '/.src/__lib_node_modules_lookup_lib.es2023.array.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/array' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/array'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/array'", + "Loading module '@typescript/lib-es2023/array' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/array' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2023/collection' from '/.src/__lib_node_modules_lookup_lib.es2023.collection.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/collection' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/collection'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/collection'", + "Loading module '@typescript/lib-es2023/collection' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom'", + "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-webworker/importscripts' from '/.src/__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-webworker/importscripts'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-webworker/importscripts'", + "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-scripthost' from '/.src/__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-scripthost'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-scripthost'", + "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-scripthost' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-dom/iterable' from '/.src/__lib_node_modules_lookup_lib.dom.iterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom/iterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/iterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/iterable'", + "Loading module '@typescript/lib-dom/iterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom/iterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-dom/asynciterable' from '/.src/__lib_node_modules_lookup_lib.dom.asynciterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom/asynciterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/asynciterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/asynciterable'", + "Loading module '@typescript/lib-dom/asynciterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom/asynciterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups." +] \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=node20).types b/tests/baselines/reference/nodeModulesPackageImports(module=node20).types new file mode 100644 index 0000000000000..7cddffea56c0b --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node20).types @@ -0,0 +1,80 @@ +//// [tests/cases/conformance/node/nodeModulesPackageImports.ts] //// + +=== index.ts === +// esm format file +import * as cjs from "#cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "#mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "#type"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +=== index.mts === +// esm format file +import * as cjs from "#cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "#mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "#type"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + +=== index.cts === +// esm format file +import * as cjs from "#cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "#mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "#type"; +>type : typeof type +> : ^^^^^^^^^^^ + +cjs; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +mjs; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +type; +>type : typeof type +> : ^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node20).errors.txt b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node20).errors.txt new file mode 100644 index 0000000000000..af540307689a6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node20).errors.txt @@ -0,0 +1,69 @@ +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. + + +==== index.ts (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index"; + import * as mjsi from "inner/mjs/index"; + import * as typei from "inner/js/index"; + cjsi; + mjsi; + typei; +==== index.mts (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index"; + import * as mjsi from "inner/mjs/index"; + import * as typei from "inner/js/index"; + cjsi; + mjsi; + typei; +==== index.cts (0 errors) ==== + // cjs format file + import * as cjsi from "inner/cjs/index"; + import * as mjsi from "inner/mjs/index"; + import * as typei from "inner/js/index"; + cjsi; + mjsi; + typei; +==== node_modules/inner/index.d.ts (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/mjs/index"; + import * as type from "inner/js/index"; + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + import * as cjs from "inner/cjs/index"; + import * as mjs from "inner/mjs/index"; + import * as type from "inner/js/index"; + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/index.d.cts (0 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index"; + import * as mjs from "inner/mjs/index"; + import * as type from "inner/js/index"; + export { cjs }; + export { mjs }; + export { type }; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs/*": "./*.cjs", + "./mjs/*": "./*.mjs", + "./js/*": "./*.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node20).js b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node20).js new file mode 100644 index 0000000000000..f710ad1fe43f2 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node20).js @@ -0,0 +1,134 @@ +//// [tests/cases/conformance/node/nodeModulesPackagePatternExports.ts] //// + +//// [index.ts] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.mts] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.cts] +// cjs format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs/index"; +import * as mjs from "inner/mjs/index"; +import * as type from "inner/js/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs/index"; +import * as mjs from "inner/mjs/index"; +import * as type from "inner/js/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs/index"; +import * as mjs from "inner/mjs/index"; +import * as type from "inner/js/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs/*": "./*.cjs", + "./mjs/*": "./*.mjs", + "./js/*": "./*.js" + } +} + +//// [index.js] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjsi = __importStar(require("inner/cjs/index")); +const mjsi = __importStar(require("inner/mjs/index")); +const typei = __importStar(require("inner/js/index")); +cjsi; +mjsi; +typei; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node20).symbols b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node20).symbols new file mode 100644 index 0000000000000..40ff4714e8e00 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node20).symbols @@ -0,0 +1,122 @@ +//// [tests/cases/conformance/node/nodeModulesPackagePatternExports.ts] //// + +=== index.ts === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : Symbol(cjsi, Decl(index.ts, 1, 6)) + +import * as mjsi from "inner/mjs/index"; +>mjsi : Symbol(mjsi, Decl(index.ts, 2, 6)) + +import * as typei from "inner/js/index"; +>typei : Symbol(typei, Decl(index.ts, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.ts, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.ts, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.ts, 3, 6)) + +=== index.mts === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : Symbol(cjsi, Decl(index.mts, 1, 6)) + +import * as mjsi from "inner/mjs/index"; +>mjsi : Symbol(mjsi, Decl(index.mts, 2, 6)) + +import * as typei from "inner/js/index"; +>typei : Symbol(typei, Decl(index.mts, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.mts, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.mts, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.mts, 3, 6)) + +=== index.cts === +// cjs format file +import * as cjsi from "inner/cjs/index"; +>cjsi : Symbol(cjsi, Decl(index.cts, 1, 6)) + +import * as mjsi from "inner/mjs/index"; +>mjsi : Symbol(mjsi, Decl(index.cts, 2, 6)) + +import * as typei from "inner/js/index"; +>typei : Symbol(typei, Decl(index.cts, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.cts, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.cts, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.cts, 3, 6)) + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs/index"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner/js/index"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) + +export { type }; +>type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs/index"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner/js/index"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) + +export { type }; +>type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs/index"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner/js/index"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) + diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node20).types b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node20).types new file mode 100644 index 0000000000000..8de436002a1fa --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node20).types @@ -0,0 +1,158 @@ +//// [tests/cases/conformance/node/nodeModulesPackagePatternExports.ts] //// + +=== index.ts === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs/index"; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +import * as typei from "inner/js/index"; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +typei; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +=== index.mts === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs/index"; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +import * as typei from "inner/js/index"; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +typei; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +=== index.cts === +// cjs format file +import * as cjsi from "inner/cjs/index"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs/index"; +>mjsi : typeof cjsi.mjs +> : ^^^^^^^^^^^^^^^ + +import * as typei from "inner/js/index"; +>typei : typeof cjsi.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.mjs +> : ^^^^^^^^^^^^^^^ + +typei; +>typei : typeof cjsi.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/mjs/index"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "inner/js/index"; +>type : typeof mjs.cjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +export { type }; +>type : typeof mjs.cjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs/index"; +>mjs : typeof cjs.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^ + +import * as type from "inner/js/index"; +>type : typeof cjs.cjs.mjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^ + +export { type }; +>type : typeof cjs.cjs.mjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs/index"; +>mjs : typeof cjs.mjs +> : ^^^^^^^^^^^^^^ + +import * as type from "inner/js/index"; +>type : typeof cjs.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs.mjs +> : ^^^^^^^^^^^^^^ + +export { type }; +>type : typeof cjs.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node20).errors.txt b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node20).errors.txt new file mode 100644 index 0000000000000..2c733359bbdea --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node20).errors.txt @@ -0,0 +1,168 @@ +index.cts(2,23): error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. +index.cts(3,23): error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. +index.cts(4,24): error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. +index.mts(2,23): error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. +index.mts(3,23): error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. +index.mts(4,24): error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. +index.ts(2,23): error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. +index.ts(3,23): error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. +index.ts(4,24): error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.cts(2,22): error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.cts(3,22): error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.cts(4,23): error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.mts(2,22): error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.mts(3,22): error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.mts(4,23): error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.ts(2,22): error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.ts(3,22): error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. +node_modules/inner/exclude/index.d.ts(4,23): error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. + + +==== index.ts (3 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. + import * as mjsi from "inner/mjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. + import * as typei from "inner/js/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. + cjsi; + mjsi; + typei; + import * as cjsi2 from "inner/cjs/index"; + import * as mjsi2 from "inner/mjs/index"; + import * as typei2 from "inner/js/index"; + cjsi2; + mjsi2; + typei2; +==== index.mts (3 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. + import * as mjsi from "inner/mjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. + import * as typei from "inner/js/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. + cjsi; + mjsi; + typei; + import * as cjsi2 from "inner/cjs/index"; + import * as mjsi2 from "inner/mjs/index"; + import * as typei2 from "inner/js/index"; + cjsi2; + mjsi2; + typei2; +==== index.cts (3 errors) ==== + // cjs format file + import * as cjsi from "inner/cjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. + import * as mjsi from "inner/mjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. + import * as typei from "inner/js/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. + cjsi; + mjsi; + typei; + import * as cjsi2 from "inner/cjs/index"; + import * as mjsi2 from "inner/mjs/index"; + import * as typei2 from "inner/js/index"; + cjsi2; + mjsi2; + typei2; +==== node_modules/inner/exclude/index.d.ts (3 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. + import * as mjs from "inner/mjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. + import * as type from "inner/js/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/exclude/index.d.mts (3 errors) ==== + // esm format file + import * as cjs from "inner/cjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. + import * as mjs from "inner/mjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. + import * as type from "inner/js/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/exclude/index.d.cts (3 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/cjs/exclude/index' or its corresponding type declarations. + import * as mjs from "inner/mjs/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/mjs/exclude/index' or its corresponding type declarations. + import * as type from "inner/js/exclude/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/js/exclude/index' or its corresponding type declarations. + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/index.d.ts (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/mjs/index"; + import * as type from "inner/js/index"; + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + import * as cjs from "inner/cjs/index"; + import * as mjs from "inner/mjs/index"; + import * as type from "inner/js/index"; + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/index.d.cts (0 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index"; + import * as mjs from "inner/mjs/index"; + import * as type from "inner/js/index"; + export { cjs }; + export { mjs }; + export { type }; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs/*": "./*.cjs", + "./cjs/exclude/*": null, + "./mjs/*": "./*.mjs", + "./mjs/exclude/*": null, + "./js/*": "./*.js", + "./js/exclude/*": null + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node20).js b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node20).js new file mode 100644 index 0000000000000..5fe735dbc37b1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node20).js @@ -0,0 +1,197 @@ +//// [tests/cases/conformance/node/nodeModulesPackagePatternExportsExclude.ts] //// + +//// [index.ts] +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +import * as mjsi from "inner/mjs/exclude/index"; +import * as typei from "inner/js/exclude/index"; +cjsi; +mjsi; +typei; +import * as cjsi2 from "inner/cjs/index"; +import * as mjsi2 from "inner/mjs/index"; +import * as typei2 from "inner/js/index"; +cjsi2; +mjsi2; +typei2; +//// [index.mts] +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +import * as mjsi from "inner/mjs/exclude/index"; +import * as typei from "inner/js/exclude/index"; +cjsi; +mjsi; +typei; +import * as cjsi2 from "inner/cjs/index"; +import * as mjsi2 from "inner/mjs/index"; +import * as typei2 from "inner/js/index"; +cjsi2; +mjsi2; +typei2; +//// [index.cts] +// cjs format file +import * as cjsi from "inner/cjs/exclude/index"; +import * as mjsi from "inner/mjs/exclude/index"; +import * as typei from "inner/js/exclude/index"; +cjsi; +mjsi; +typei; +import * as cjsi2 from "inner/cjs/index"; +import * as mjsi2 from "inner/mjs/index"; +import * as typei2 from "inner/js/index"; +cjsi2; +mjsi2; +typei2; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs/exclude/index"; +import * as mjs from "inner/mjs/exclude/index"; +import * as type from "inner/js/exclude/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs/exclude/index"; +import * as mjs from "inner/mjs/exclude/index"; +import * as type from "inner/js/exclude/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs/exclude/index"; +import * as mjs from "inner/mjs/exclude/index"; +import * as type from "inner/js/exclude/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs/index"; +import * as mjs from "inner/mjs/index"; +import * as type from "inner/js/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs/index"; +import * as mjs from "inner/mjs/index"; +import * as type from "inner/js/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs/index"; +import * as mjs from "inner/mjs/index"; +import * as type from "inner/js/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs/*": "./*.cjs", + "./cjs/exclude/*": null, + "./mjs/*": "./*.mjs", + "./mjs/exclude/*": null, + "./js/*": "./*.js", + "./js/exclude/*": null + } +} + +//// [index.js] +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +import * as mjsi from "inner/mjs/exclude/index"; +import * as typei from "inner/js/exclude/index"; +cjsi; +mjsi; +typei; +import * as cjsi2 from "inner/cjs/index"; +import * as mjsi2 from "inner/mjs/index"; +import * as typei2 from "inner/js/index"; +cjsi2; +mjsi2; +typei2; +//// [index.mjs] +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +import * as mjsi from "inner/mjs/exclude/index"; +import * as typei from "inner/js/exclude/index"; +cjsi; +mjsi; +typei; +import * as cjsi2 from "inner/cjs/index"; +import * as mjsi2 from "inner/mjs/index"; +import * as typei2 from "inner/js/index"; +cjsi2; +mjsi2; +typei2; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjsi = __importStar(require("inner/cjs/exclude/index")); +const mjsi = __importStar(require("inner/mjs/exclude/index")); +const typei = __importStar(require("inner/js/exclude/index")); +cjsi; +mjsi; +typei; +const cjsi2 = __importStar(require("inner/cjs/index")); +const mjsi2 = __importStar(require("inner/mjs/index")); +const typei2 = __importStar(require("inner/js/index")); +cjsi2; +mjsi2; +typei2; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node20).symbols b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node20).symbols new file mode 100644 index 0000000000000..fd0ed5715baab --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node20).symbols @@ -0,0 +1,236 @@ +//// [tests/cases/conformance/node/nodeModulesPackagePatternExportsExclude.ts] //// + +=== index.ts === +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +>cjsi : Symbol(cjsi, Decl(index.ts, 1, 6)) + +import * as mjsi from "inner/mjs/exclude/index"; +>mjsi : Symbol(mjsi, Decl(index.ts, 2, 6)) + +import * as typei from "inner/js/exclude/index"; +>typei : Symbol(typei, Decl(index.ts, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.ts, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.ts, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.ts, 3, 6)) + +import * as cjsi2 from "inner/cjs/index"; +>cjsi2 : Symbol(cjsi2, Decl(index.ts, 7, 6)) + +import * as mjsi2 from "inner/mjs/index"; +>mjsi2 : Symbol(mjsi2, Decl(index.ts, 8, 6)) + +import * as typei2 from "inner/js/index"; +>typei2 : Symbol(typei2, Decl(index.ts, 9, 6)) + +cjsi2; +>cjsi2 : Symbol(cjsi2, Decl(index.ts, 7, 6)) + +mjsi2; +>mjsi2 : Symbol(mjsi2, Decl(index.ts, 8, 6)) + +typei2; +>typei2 : Symbol(typei2, Decl(index.ts, 9, 6)) + +=== index.mts === +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +>cjsi : Symbol(cjsi, Decl(index.mts, 1, 6)) + +import * as mjsi from "inner/mjs/exclude/index"; +>mjsi : Symbol(mjsi, Decl(index.mts, 2, 6)) + +import * as typei from "inner/js/exclude/index"; +>typei : Symbol(typei, Decl(index.mts, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.mts, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.mts, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.mts, 3, 6)) + +import * as cjsi2 from "inner/cjs/index"; +>cjsi2 : Symbol(cjsi2, Decl(index.mts, 7, 6)) + +import * as mjsi2 from "inner/mjs/index"; +>mjsi2 : Symbol(mjsi2, Decl(index.mts, 8, 6)) + +import * as typei2 from "inner/js/index"; +>typei2 : Symbol(typei2, Decl(index.mts, 9, 6)) + +cjsi2; +>cjsi2 : Symbol(cjsi2, Decl(index.mts, 7, 6)) + +mjsi2; +>mjsi2 : Symbol(mjsi2, Decl(index.mts, 8, 6)) + +typei2; +>typei2 : Symbol(typei2, Decl(index.mts, 9, 6)) + +=== index.cts === +// cjs format file +import * as cjsi from "inner/cjs/exclude/index"; +>cjsi : Symbol(cjsi, Decl(index.cts, 1, 6)) + +import * as mjsi from "inner/mjs/exclude/index"; +>mjsi : Symbol(mjsi, Decl(index.cts, 2, 6)) + +import * as typei from "inner/js/exclude/index"; +>typei : Symbol(typei, Decl(index.cts, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.cts, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.cts, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.cts, 3, 6)) + +import * as cjsi2 from "inner/cjs/index"; +>cjsi2 : Symbol(cjsi2, Decl(index.cts, 7, 6)) + +import * as mjsi2 from "inner/mjs/index"; +>mjsi2 : Symbol(mjsi2, Decl(index.cts, 8, 6)) + +import * as typei2 from "inner/js/index"; +>typei2 : Symbol(typei2, Decl(index.cts, 9, 6)) + +cjsi2; +>cjsi2 : Symbol(cjsi2, Decl(index.cts, 7, 6)) + +mjsi2; +>mjsi2 : Symbol(mjsi2, Decl(index.cts, 8, 6)) + +typei2; +>typei2 : Symbol(typei2, Decl(index.cts, 9, 6)) + +=== node_modules/inner/exclude/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/exclude/index"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs/exclude/index"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner/js/exclude/index"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs, Decl(index.d.ts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs, Decl(index.d.ts, 5, 8)) + +export { type }; +>type : Symbol(type, Decl(index.d.ts, 6, 8)) + +=== node_modules/inner/exclude/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/exclude/index"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs/exclude/index"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner/js/exclude/index"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs, Decl(index.d.mts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs, Decl(index.d.mts, 5, 8)) + +export { type }; +>type : Symbol(type, Decl(index.d.mts, 6, 8)) + +=== node_modules/inner/exclude/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/exclude/index"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs/exclude/index"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner/js/exclude/index"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs, Decl(index.d.cts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs, Decl(index.d.cts, 5, 8)) + +export { type }; +>type : Symbol(type, Decl(index.d.cts, 6, 8)) + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs/index"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner/js/index"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) + +export { type }; +>type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs/index"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner/js/index"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) + +export { type }; +>type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs/index"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner/js/index"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) + diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node20).types b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node20).types new file mode 100644 index 0000000000000..b94e493366d49 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node20).types @@ -0,0 +1,308 @@ +//// [tests/cases/conformance/node/nodeModulesPackagePatternExportsExclude.ts] //// + +=== index.ts === +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +>cjsi : any +> : ^^^ + +import * as mjsi from "inner/mjs/exclude/index"; +>mjsi : any +> : ^^^ + +import * as typei from "inner/js/exclude/index"; +>typei : any +> : ^^^ + +cjsi; +>cjsi : any +> : ^^^ + +mjsi; +>mjsi : any +> : ^^^ + +typei; +>typei : any +> : ^^^ + +import * as cjsi2 from "inner/cjs/index"; +>cjsi2 : typeof cjsi2 +> : ^^^^^^^^^^^^ + +import * as mjsi2 from "inner/mjs/index"; +>mjsi2 : typeof cjsi2.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^^ + +import * as typei2 from "inner/js/index"; +>typei2 : typeof typei2 +> : ^^^^^^^^^^^^^ + +cjsi2; +>cjsi2 : typeof cjsi2 +> : ^^^^^^^^^^^^ + +mjsi2; +>mjsi2 : typeof cjsi2.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^^ + +typei2; +>typei2 : typeof typei2 +> : ^^^^^^^^^^^^^ + +=== index.mts === +// esm format file +import * as cjsi from "inner/cjs/exclude/index"; +>cjsi : any +> : ^^^ + +import * as mjsi from "inner/mjs/exclude/index"; +>mjsi : any +> : ^^^ + +import * as typei from "inner/js/exclude/index"; +>typei : any +> : ^^^ + +cjsi; +>cjsi : any +> : ^^^ + +mjsi; +>mjsi : any +> : ^^^ + +typei; +>typei : any +> : ^^^ + +import * as cjsi2 from "inner/cjs/index"; +>cjsi2 : typeof cjsi2 +> : ^^^^^^^^^^^^ + +import * as mjsi2 from "inner/mjs/index"; +>mjsi2 : typeof cjsi2.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^^ + +import * as typei2 from "inner/js/index"; +>typei2 : typeof typei2 +> : ^^^^^^^^^^^^^ + +cjsi2; +>cjsi2 : typeof cjsi2 +> : ^^^^^^^^^^^^ + +mjsi2; +>mjsi2 : typeof cjsi2.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^^ + +typei2; +>typei2 : typeof typei2 +> : ^^^^^^^^^^^^^ + +=== index.cts === +// cjs format file +import * as cjsi from "inner/cjs/exclude/index"; +>cjsi : any +> : ^^^ + +import * as mjsi from "inner/mjs/exclude/index"; +>mjsi : any +> : ^^^ + +import * as typei from "inner/js/exclude/index"; +>typei : any +> : ^^^ + +cjsi; +>cjsi : any +> : ^^^ + +mjsi; +>mjsi : any +> : ^^^ + +typei; +>typei : any +> : ^^^ + +import * as cjsi2 from "inner/cjs/index"; +>cjsi2 : typeof cjsi2 +> : ^^^^^^^^^^^^ + +import * as mjsi2 from "inner/mjs/index"; +>mjsi2 : typeof cjsi2.mjs +> : ^^^^^^^^^^^^^^^^ + +import * as typei2 from "inner/js/index"; +>typei2 : typeof cjsi2.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ + +cjsi2; +>cjsi2 : typeof cjsi2 +> : ^^^^^^^^^^^^ + +mjsi2; +>mjsi2 : typeof cjsi2.mjs +> : ^^^^^^^^^^^^^^^^ + +typei2; +>typei2 : typeof cjsi2.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/exclude/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/exclude/index"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/mjs/exclude/index"; +>mjs : any +> : ^^^ + +import * as type from "inner/js/exclude/index"; +>type : any +> : ^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : any +> : ^^^ + +export { type }; +>type : any +> : ^^^ + +=== node_modules/inner/exclude/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/exclude/index"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/mjs/exclude/index"; +>mjs : any +> : ^^^ + +import * as type from "inner/js/exclude/index"; +>type : any +> : ^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : any +> : ^^^ + +export { type }; +>type : any +> : ^^^ + +=== node_modules/inner/exclude/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/exclude/index"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/mjs/exclude/index"; +>mjs : any +> : ^^^ + +import * as type from "inner/js/exclude/index"; +>type : any +> : ^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : any +> : ^^^ + +export { type }; +>type : any +> : ^^^ + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/mjs/index"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "inner/js/index"; +>type : typeof mjs.cjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +export { type }; +>type : typeof mjs.cjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs/index"; +>mjs : typeof cjs.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^ + +import * as type from "inner/js/index"; +>type : typeof cjs.cjs.mjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^ + +export { type }; +>type : typeof cjs.cjs.mjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs/index"; +>mjs : typeof cjs.mjs +> : ^^^^^^^^^^^^^^ + +import * as type from "inner/js/index"; +>type : typeof cjs.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs.mjs +> : ^^^^^^^^^^^^^^ + +export { type }; +>type : typeof cjs.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node20).errors.txt b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node20).errors.txt new file mode 100644 index 0000000000000..60c35df075b5d --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node20).errors.txt @@ -0,0 +1,69 @@ +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. + + +==== index.ts (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index.cjs"; + import * as mjsi from "inner/mjs/index.mjs"; + import * as typei from "inner/js/index.js"; + cjsi; + mjsi; + typei; +==== index.mts (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index.cjs"; + import * as mjsi from "inner/mjs/index.mjs"; + import * as typei from "inner/js/index.js"; + cjsi; + mjsi; + typei; +==== index.cts (0 errors) ==== + // cjs format file + import * as cjsi from "inner/cjs/index.cjs"; + import * as mjsi from "inner/mjs/index.mjs"; + import * as typei from "inner/js/index.js"; + cjsi; + mjsi; + typei; +==== node_modules/inner/index.d.ts (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index.cjs"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/mjs/index.mjs"; + import * as type from "inner/js/index.js"; + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + import * as cjs from "inner/cjs/index.cjs"; + import * as mjs from "inner/mjs/index.mjs"; + import * as type from "inner/js/index.js"; + export { cjs }; + export { mjs }; + export { type }; +==== node_modules/inner/index.d.cts (0 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index.cjs"; + import * as mjs from "inner/mjs/index.mjs"; + import * as type from "inner/js/index.js"; + export { cjs }; + export { mjs }; + export { type }; +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + } +==== node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs/*.cjs": "./*.cjs", + "./mjs/*.mjs": "./*.mjs", + "./js/*.js": "./*.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node20).js b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node20).js new file mode 100644 index 0000000000000..18a9e37f040a1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node20).js @@ -0,0 +1,134 @@ +//// [tests/cases/conformance/node/nodeModulesPackagePatternExportsTrailers.ts] //// + +//// [index.ts] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.mts] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.cts] +// cjs format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +import * as mjs from "inner/mjs/index.mjs"; +import * as type from "inner/js/index.js"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs/index.cjs"; +import * as mjs from "inner/mjs/index.mjs"; +import * as type from "inner/js/index.js"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +import * as mjs from "inner/mjs/index.mjs"; +import * as type from "inner/js/index.js"; +export { cjs }; +export { mjs }; +export { type }; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs/*.cjs": "./*.cjs", + "./mjs/*.mjs": "./*.mjs", + "./js/*.js": "./*.js" + } +} + +//// [index.js] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjsi = __importStar(require("inner/cjs/index.cjs")); +const mjsi = __importStar(require("inner/mjs/index.mjs")); +const typei = __importStar(require("inner/js/index.js")); +cjsi; +mjsi; +typei; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node20).symbols b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node20).symbols new file mode 100644 index 0000000000000..99d90e029a57c --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node20).symbols @@ -0,0 +1,122 @@ +//// [tests/cases/conformance/node/nodeModulesPackagePatternExportsTrailers.ts] //// + +=== index.ts === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : Symbol(cjsi, Decl(index.ts, 1, 6)) + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : Symbol(mjsi, Decl(index.ts, 2, 6)) + +import * as typei from "inner/js/index.js"; +>typei : Symbol(typei, Decl(index.ts, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.ts, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.ts, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.ts, 3, 6)) + +=== index.mts === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : Symbol(cjsi, Decl(index.mts, 1, 6)) + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : Symbol(mjsi, Decl(index.mts, 2, 6)) + +import * as typei from "inner/js/index.js"; +>typei : Symbol(typei, Decl(index.mts, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.mts, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.mts, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.mts, 3, 6)) + +=== index.cts === +// cjs format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : Symbol(cjsi, Decl(index.cts, 1, 6)) + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : Symbol(mjsi, Decl(index.cts, 2, 6)) + +import * as typei from "inner/js/index.js"; +>typei : Symbol(typei, Decl(index.cts, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.cts, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.cts, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.cts, 3, 6)) + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner/js/index.js"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) + +export { type }; +>type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner/js/index.js"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) + +export { type }; +>type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner/js/index.js"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) + diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node20).trace.json b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node20).trace.json new file mode 100644 index 0000000000000..2420d1091a943 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node20).trace.json @@ -0,0 +1,1111 @@ +[ + "Found 'package.json' at '/.src/package.json'.", + "======== Resolving module 'inner/cjs/index.cjs' from '/.src/index.ts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Found 'package.json' at '/.src/node_modules/inner/package.json'.", + "Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'.", + "File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it.", + "File '/.src/node_modules/inner/index.cts' does not exist.", + "File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result.", + "Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'.", + "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", + "======== Resolving module 'inner/mjs/index.mjs' from '/.src/index.ts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", + "Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'.", + "File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it.", + "File '/.src/node_modules/inner/index.mts' does not exist.", + "File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result.", + "Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'.", + "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", + "======== Resolving module 'inner/js/index.js' from '/.src/index.ts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", + "Using 'exports' subpath './js/*.js' with target './index.js'.", + "File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it.", + "File '/.src/node_modules/inner/index.ts' does not exist.", + "File '/.src/node_modules/inner/index.tsx' does not exist.", + "File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result.", + "Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'.", + "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", + "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.cts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", + "Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'.", + "File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it.", + "File '/.src/node_modules/inner/index.cts' does not exist.", + "File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result.", + "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", + "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.cts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", + "Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'.", + "File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it.", + "File '/.src/node_modules/inner/index.mts' does not exist.", + "File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result.", + "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", + "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.cts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", + "Using 'exports' subpath './js/*.js' with target './index.js'.", + "File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it.", + "File '/.src/node_modules/inner/index.ts' does not exist.", + "File '/.src/node_modules/inner/index.tsx' does not exist.", + "File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result.", + "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", + "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.mts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", + "Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'.", + "File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it.", + "File '/.src/node_modules/inner/index.cts' does not exist.", + "File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result.", + "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", + "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.mts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", + "Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'.", + "File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it.", + "File '/.src/node_modules/inner/index.mts' does not exist.", + "File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result.", + "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", + "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.mts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in ESM mode with conditions 'import', 'types', 'node'.", + "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", + "Using 'exports' subpath './js/*.js' with target './index.js'.", + "File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it.", + "File '/.src/node_modules/inner/index.ts' does not exist.", + "File '/.src/node_modules/inner/index.tsx' does not exist.", + "File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result.", + "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", + "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", + "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.ts'. ========", + "Resolution for module 'inner/cjs/index.cjs' was found in cache from location '/.src/node_modules/inner'.", + "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", + "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.ts'. ========", + "Resolution for module 'inner/mjs/index.mjs' was found in cache from location '/.src/node_modules/inner'.", + "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", + "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.ts'. ========", + "Resolution for module 'inner/js/index.js' was found in cache from location '/.src/node_modules/inner'.", + "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", + "======== Resolving module 'inner/cjs/index.cjs' from '/.src/index.mts'. ========", + "Resolution for module 'inner/cjs/index.cjs' was found in cache from location '/.src'.", + "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", + "======== Resolving module 'inner/mjs/index.mjs' from '/.src/index.mts'. ========", + "Resolution for module 'inner/mjs/index.mjs' was found in cache from location '/.src'.", + "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", + "======== Resolving module 'inner/js/index.js' from '/.src/index.mts'. ========", + "Resolution for module 'inner/js/index.js' was found in cache from location '/.src'.", + "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", + "======== Resolving module 'inner/cjs/index.cjs' from '/.src/index.cts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", + "Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'.", + "File name '/.src/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it.", + "File '/.src/node_modules/inner/index.cts' does not exist.", + "File '/.src/node_modules/inner/index.d.cts' exists - use it as a name resolution result.", + "Resolving real path for '/.src/node_modules/inner/index.d.cts', result '/.src/node_modules/inner/index.d.cts'.", + "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", + "======== Resolving module 'inner/mjs/index.mjs' from '/.src/index.cts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", + "Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'.", + "File name '/.src/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it.", + "File '/.src/node_modules/inner/index.mts' does not exist.", + "File '/.src/node_modules/inner/index.d.mts' exists - use it as a name resolution result.", + "Resolving real path for '/.src/node_modules/inner/index.d.mts', result '/.src/node_modules/inner/index.d.mts'.", + "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", + "======== Resolving module 'inner/js/index.js' from '/.src/index.cts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "File '/.src/package.json' exists according to earlier cached lookups.", + "Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", + "Using 'exports' subpath './js/*.js' with target './index.js'.", + "File name '/.src/node_modules/inner/index.js' has a '.js' extension - stripping it.", + "File '/.src/node_modules/inner/index.ts' does not exist.", + "File '/.src/node_modules/inner/index.tsx' does not exist.", + "File '/.src/node_modules/inner/index.d.ts' exists - use it as a name resolution result.", + "Resolving real path for '/.src/node_modules/inner/index.d.ts', result '/.src/node_modules/inner/index.d.ts'.", + "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", + "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.ts'. ========", + "Resolution for module 'inner/cjs/index.cjs' was found in cache from location '/.src/node_modules/inner'.", + "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", + "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.ts'. ========", + "Resolution for module 'inner/mjs/index.mjs' was found in cache from location '/.src/node_modules/inner'.", + "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", + "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.ts'. ========", + "Resolution for module 'inner/js/index.js' was found in cache from location '/.src/node_modules/inner'.", + "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", + "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.cts'. ========", + "Resolution for module 'inner/cjs/index.cjs' was found in cache from location '/.src/node_modules/inner'.", + "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", + "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.cts'. ========", + "Resolution for module 'inner/mjs/index.mjs' was found in cache from location '/.src/node_modules/inner'.", + "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", + "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.cts'. ========", + "Resolution for module 'inner/js/index.js' was found in cache from location '/.src/node_modules/inner'.", + "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", + "======== Resolving module 'inner/cjs/index.cjs' from '/.src/node_modules/inner/index.d.mts'. ========", + "Resolution for module 'inner/cjs/index.cjs' was found in cache from location '/.src/node_modules/inner'.", + "======== Module name 'inner/cjs/index.cjs' was successfully resolved to '/.src/node_modules/inner/index.d.cts'. ========", + "======== Resolving module 'inner/mjs/index.mjs' from '/.src/node_modules/inner/index.d.mts'. ========", + "Resolution for module 'inner/mjs/index.mjs' was found in cache from location '/.src/node_modules/inner'.", + "======== Module name 'inner/mjs/index.mjs' was successfully resolved to '/.src/node_modules/inner/index.d.mts'. ========", + "======== Resolving module 'inner/js/index.js' from '/.src/node_modules/inner/index.d.mts'. ========", + "Resolution for module 'inner/js/index.js' was found in cache from location '/.src/node_modules/inner'.", + "======== Module name 'inner/js/index.js' was successfully resolved to '/.src/node_modules/inner/index.d.ts'. ========", + "File '/.ts/package.json' does not exist.", + "File '/package.json' does not exist.", + "======== Resolving module '@typescript/lib-es2023' from '/.src/__lib_node_modules_lookup_lib.es2023.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023'", + "Loading module '@typescript/lib-es2023' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022' from '/.src/__lib_node_modules_lookup_lib.es2022.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022'", + "Loading module '@typescript/lib-es2022' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021' from '/.src/__lib_node_modules_lookup_lib.es2021.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021'", + "Loading module '@typescript/lib-es2021' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020' from '/.src/__lib_node_modules_lookup_lib.es2020.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020'", + "Loading module '@typescript/lib-es2020' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019' from '/.src/__lib_node_modules_lookup_lib.es2019.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019'", + "Loading module '@typescript/lib-es2019' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018' from '/.src/__lib_node_modules_lookup_lib.es2018.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018'", + "Loading module '@typescript/lib-es2018' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017' from '/.src/__lib_node_modules_lookup_lib.es2017.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017'", + "Loading module '@typescript/lib-es2017' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2016' from '/.src/__lib_node_modules_lookup_lib.es2016.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2016' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016'", + "Loading module '@typescript/lib-es2016' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2016' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015' from '/.src/__lib_node_modules_lookup_lib.es2015.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015'", + "Loading module '@typescript/lib-es2015' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es5'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es5'", + "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es5' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-decorators' from '/.src/__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators'", + "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-decorators' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-decorators/legacy' from '/.src/__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators/legacy'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators/legacy'", + "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/core' from '/.src/__lib_node_modules_lookup_lib.es2015.core.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/core' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/core'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/core'", + "Loading module '@typescript/lib-es2015/core' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/core' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/collection' from '/.src/__lib_node_modules_lookup_lib.es2015.collection.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/collection' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/collection'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/collection'", + "Loading module '@typescript/lib-es2015/collection' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/collection' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/iterable' from '/.src/__lib_node_modules_lookup_lib.es2015.iterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/iterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/iterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/iterable'", + "Loading module '@typescript/lib-es2015/iterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/iterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/symbol' from '/.src/__lib_node_modules_lookup_lib.es2015.symbol.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/symbol' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol'", + "Loading module '@typescript/lib-es2015/symbol' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/symbol' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/generator' from '/.src/__lib_node_modules_lookup_lib.es2015.generator.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/generator' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/generator'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/generator'", + "Loading module '@typescript/lib-es2015/generator' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/generator' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/promise' from '/.src/__lib_node_modules_lookup_lib.es2015.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/promise'", + "Loading module '@typescript/lib-es2015/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/proxy' from '/.src/__lib_node_modules_lookup_lib.es2015.proxy.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/proxy' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/proxy'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/proxy'", + "Loading module '@typescript/lib-es2015/proxy' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/proxy' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/reflect' from '/.src/__lib_node_modules_lookup_lib.es2015.reflect.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/reflect' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/reflect'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/reflect'", + "Loading module '@typescript/lib-es2015/reflect' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/reflect' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2015/symbol-wellknown' from '/.src/__lib_node_modules_lookup_lib.es2015.symbol.wellknown.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2015/symbol-wellknown' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol-wellknown'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2015/symbol-wellknown'", + "Loading module '@typescript/lib-es2015/symbol-wellknown' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2015/symbol-wellknown' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2016/array-include' from '/.src/__lib_node_modules_lookup_lib.es2016.array.include.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2016/array-include' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/array-include'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/array-include'", + "Loading module '@typescript/lib-es2016/array-include' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2016/array-include' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2016/intl' from '/.src/__lib_node_modules_lookup_lib.es2016.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2016/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2016/intl'", + "Loading module '@typescript/lib-es2016/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2016/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/arraybuffer' from '/.src/__lib_node_modules_lookup_lib.es2017.arraybuffer.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/arraybuffer' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/arraybuffer'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/arraybuffer'", + "Loading module '@typescript/lib-es2017/arraybuffer' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/arraybuffer' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/date' from '/.src/__lib_node_modules_lookup_lib.es2017.date.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/date' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/date'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/date'", + "Loading module '@typescript/lib-es2017/date' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/date' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/intl' from '/.src/__lib_node_modules_lookup_lib.es2017.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/intl'", + "Loading module '@typescript/lib-es2017/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/object' from '/.src/__lib_node_modules_lookup_lib.es2017.object.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/object' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/object'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/object'", + "Loading module '@typescript/lib-es2017/object' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/object' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/sharedmemory' from '/.src/__lib_node_modules_lookup_lib.es2017.sharedmemory.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/sharedmemory' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/sharedmemory'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/sharedmemory'", + "Loading module '@typescript/lib-es2017/sharedmemory' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/sharedmemory' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/string' from '/.src/__lib_node_modules_lookup_lib.es2017.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/string'", + "Loading module '@typescript/lib-es2017/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2017/typedarrays' from '/.src/__lib_node_modules_lookup_lib.es2017.typedarrays.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2017/typedarrays' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/typedarrays'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2017/typedarrays'", + "Loading module '@typescript/lib-es2017/typedarrays' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2017/typedarrays' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/asynciterable' from '/.src/__lib_node_modules_lookup_lib.es2018.asynciterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/asynciterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asynciterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asynciterable'", + "Loading module '@typescript/lib-es2018/asynciterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/asynciterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/asyncgenerator' from '/.src/__lib_node_modules_lookup_lib.es2018.asyncgenerator.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/asyncgenerator' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asyncgenerator'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/asyncgenerator'", + "Loading module '@typescript/lib-es2018/asyncgenerator' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/asyncgenerator' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/promise' from '/.src/__lib_node_modules_lookup_lib.es2018.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/promise'", + "Loading module '@typescript/lib-es2018/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/regexp' from '/.src/__lib_node_modules_lookup_lib.es2018.regexp.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/regexp' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/regexp'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/regexp'", + "Loading module '@typescript/lib-es2018/regexp' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/regexp' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2018/intl' from '/.src/__lib_node_modules_lookup_lib.es2018.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2018/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2018/intl'", + "Loading module '@typescript/lib-es2018/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2018/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/array' from '/.src/__lib_node_modules_lookup_lib.es2019.array.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/array' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/array'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/array'", + "Loading module '@typescript/lib-es2019/array' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/array' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/object' from '/.src/__lib_node_modules_lookup_lib.es2019.object.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/object' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/object'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/object'", + "Loading module '@typescript/lib-es2019/object' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/object' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/string' from '/.src/__lib_node_modules_lookup_lib.es2019.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/string'", + "Loading module '@typescript/lib-es2019/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/symbol' from '/.src/__lib_node_modules_lookup_lib.es2019.symbol.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/symbol' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/symbol'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/symbol'", + "Loading module '@typescript/lib-es2019/symbol' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/symbol' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2019/intl' from '/.src/__lib_node_modules_lookup_lib.es2019.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2019/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2019/intl'", + "Loading module '@typescript/lib-es2019/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2019/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/bigint' from '/.src/__lib_node_modules_lookup_lib.es2020.bigint.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/bigint' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/bigint'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/bigint'", + "Loading module '@typescript/lib-es2020/bigint' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/bigint' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/intl' from '/.src/__lib_node_modules_lookup_lib.es2020.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/intl'", + "Loading module '@typescript/lib-es2020/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/date' from '/.src/__lib_node_modules_lookup_lib.es2020.date.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/date' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/date'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/date'", + "Loading module '@typescript/lib-es2020/date' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/date' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/number' from '/.src/__lib_node_modules_lookup_lib.es2020.number.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/number' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/number'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/number'", + "Loading module '@typescript/lib-es2020/number' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/number' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/promise' from '/.src/__lib_node_modules_lookup_lib.es2020.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/promise'", + "Loading module '@typescript/lib-es2020/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/sharedmemory' from '/.src/__lib_node_modules_lookup_lib.es2020.sharedmemory.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/sharedmemory' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/sharedmemory'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/sharedmemory'", + "Loading module '@typescript/lib-es2020/sharedmemory' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/sharedmemory' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/string' from '/.src/__lib_node_modules_lookup_lib.es2020.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/string'", + "Loading module '@typescript/lib-es2020/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2020/symbol-wellknown' from '/.src/__lib_node_modules_lookup_lib.es2020.symbol.wellknown.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2020/symbol-wellknown' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/symbol-wellknown'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2020/symbol-wellknown'", + "Loading module '@typescript/lib-es2020/symbol-wellknown' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2020/symbol-wellknown' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/promise' from '/.src/__lib_node_modules_lookup_lib.es2021.promise.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/promise' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/promise'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/promise'", + "Loading module '@typescript/lib-es2021/promise' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/promise' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/string' from '/.src/__lib_node_modules_lookup_lib.es2021.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/string'", + "Loading module '@typescript/lib-es2021/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/weakref' from '/.src/__lib_node_modules_lookup_lib.es2021.weakref.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/weakref' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/weakref'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/weakref'", + "Loading module '@typescript/lib-es2021/weakref' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/weakref' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2021/intl' from '/.src/__lib_node_modules_lookup_lib.es2021.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2021/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2021/intl'", + "Loading module '@typescript/lib-es2021/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2021/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/array' from '/.src/__lib_node_modules_lookup_lib.es2022.array.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/array' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/array'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/array'", + "Loading module '@typescript/lib-es2022/array' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/array' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/error' from '/.src/__lib_node_modules_lookup_lib.es2022.error.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/error' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/error'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/error'", + "Loading module '@typescript/lib-es2022/error' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/error' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/intl' from '/.src/__lib_node_modules_lookup_lib.es2022.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/intl'", + "Loading module '@typescript/lib-es2022/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/object' from '/.src/__lib_node_modules_lookup_lib.es2022.object.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/object' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/object'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/object'", + "Loading module '@typescript/lib-es2022/object' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/object' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/regexp' from '/.src/__lib_node_modules_lookup_lib.es2022.regexp.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/regexp' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/regexp'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/regexp'", + "Loading module '@typescript/lib-es2022/regexp' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/regexp' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2022/string' from '/.src/__lib_node_modules_lookup_lib.es2022.string.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2022/string' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/string'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2022/string'", + "Loading module '@typescript/lib-es2022/string' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2022/string' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2023/array' from '/.src/__lib_node_modules_lookup_lib.es2023.array.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/array' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/array'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/array'", + "Loading module '@typescript/lib-es2023/array' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/array' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2023/collection' from '/.src/__lib_node_modules_lookup_lib.es2023.collection.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/collection' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/collection'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/collection'", + "Loading module '@typescript/lib-es2023/collection' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/collection' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es2023/intl'", + "Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es2023/intl' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom'", + "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-webworker/importscripts' from '/.src/__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-webworker/importscripts'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-webworker/importscripts'", + "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-scripthost' from '/.src/__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-scripthost'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-scripthost'", + "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-scripthost' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-dom/iterable' from '/.src/__lib_node_modules_lookup_lib.dom.iterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom/iterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/iterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/iterable'", + "Loading module '@typescript/lib-dom/iterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom/iterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-dom/asynciterable' from '/.src/__lib_node_modules_lookup_lib.dom.asynciterable.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom/asynciterable' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/asynciterable'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom/asynciterable'", + "Loading module '@typescript/lib-dom/asynciterable' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom/asynciterable' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups." +] \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node20).types b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node20).types new file mode 100644 index 0000000000000..c11fe2feb146f --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node20).types @@ -0,0 +1,158 @@ +//// [tests/cases/conformance/node/nodeModulesPackagePatternExportsTrailers.ts] //// + +=== index.ts === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +import * as typei from "inner/js/index.js"; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +typei; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +=== index.mts === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +import * as typei from "inner/js/index.js"; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^^ + +typei; +>typei : typeof typei +> : ^^^^^^^^^^^^ + +=== index.cts === +// cjs format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : typeof cjsi.mjs +> : ^^^^^^^^^^^^^^^ + +import * as typei from "inner/js/index.js"; +>typei : typeof cjsi.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + +cjsi; +>cjsi : typeof cjsi +> : ^^^^^^^^^^^ + +mjsi; +>mjsi : typeof cjsi.mjs +> : ^^^^^^^^^^^^^^^ + +typei; +>typei : typeof cjsi.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : any +> : ^^^ + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +import * as type from "inner/js/index.js"; +>type : typeof mjs.cjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : any +> : ^^^ + +export { mjs }; +>mjs : typeof mjs +> : ^^^^^^^^^^ + +export { type }; +>type : typeof mjs.cjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : typeof cjs.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^ + +import * as type from "inner/js/index.js"; +>type : typeof cjs.cjs.mjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs.cjs.mjs +> : ^^^^^^^^^^^^^^^^^^ + +export { type }; +>type : typeof cjs.cjs.mjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +=== node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : typeof cjs.mjs +> : ^^^^^^^^^^^^^^ + +import * as type from "inner/js/index.js"; +>type : typeof cjs.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + +export { cjs }; +>cjs : typeof cjs +> : ^^^^^^^^^^ + +export { mjs }; +>mjs : typeof cjs.mjs +> : ^^^^^^^^^^^^^^ + +export { type }; +>type : typeof cjs.mjs.cjs.type +> : ^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json index b7bf8f04e00f2..abfb98c975b56 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json @@ -4,7 +4,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'import', 'types', 'node'.", "File '/.src/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "Found 'package.json' at '/.src/node_modules/inner/package.json'.", "Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'.", @@ -17,7 +17,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'import', 'types', 'node'.", "File '/.src/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'.", @@ -30,7 +30,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'import', 'types', 'node'.", "File '/.src/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './js/*.js' with target './index.js'.", @@ -119,7 +119,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'require', 'types', 'node'.", "File '/.src/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'.", @@ -132,7 +132,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'require', 'types', 'node'.", "File '/.src/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'.", @@ -145,7 +145,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'require', 'types', 'node'.", "File '/.src/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "File '/.src/node_modules/inner/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './js/*.js' with target './index.js'.", diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).errors.txt b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).errors.txt index 25a8b3a5e995e..5a28c77e93b3e 100644 --- a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).errors.txt @@ -1,17 +1,17 @@ -index.mts(1,34): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -index.mts(3,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -index.ts(1,34): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. -index.ts(3,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +index.mts(1,34): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +index.mts(3,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +index.ts(1,34): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. +index.ts(3,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. ==== index.ts (2 errors) ==== import pkg from "./package.json" with { type: "json" }; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export const name = pkg.name; import * as ns from "./package.json" with { type: "json" }; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export const thing = ns; export const name2 = ns.default.name; ==== index.cts (0 errors) ==== @@ -23,11 +23,11 @@ index.ts(3,38): error TS2823: Import attributes are only supported when the '--m ==== index.mts (2 errors) ==== import pkg from "./package.json" with { type: "json" }; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export const name = pkg.name; import * as ns from "./package.json" with { type: "json" }; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. export const thing = ns; export const name2 = ns.default.name; ==== package.json (0 errors) ==== diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node20).js b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node20).js new file mode 100644 index 0000000000000..09afe3776dcb2 --- /dev/null +++ b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node20).js @@ -0,0 +1,130 @@ +//// [tests/cases/conformance/node/nodeModulesResolveJsonModule.ts] //// + +//// [index.ts] +import pkg from "./package.json" with { type: "json" }; +export const name = pkg.name; +import * as ns from "./package.json" with { type: "json" }; +export const thing = ns; +export const name2 = ns.default.name; +//// [index.cts] +import pkg from "./package.json"; +export const name = pkg.name; +import * as ns from "./package.json"; +export const thing = ns; +export const name2 = ns.default.name; +//// [index.mts] +import pkg from "./package.json" with { type: "json" }; +export const name = pkg.name; +import * as ns from "./package.json" with { type: "json" }; +export const thing = ns; +export const name2 = ns.default.name; +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "type": "module", + "default": "misedirection" +} + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "type": "module", + "default": "misedirection" +} +//// [index.js] +import pkg from "./package.json" with { type: "json" }; +export const name = pkg.name; +import * as ns from "./package.json" with { type: "json" }; +export const thing = ns; +export const name2 = ns.default.name; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.name2 = exports.thing = exports.name = void 0; +const package_json_1 = __importDefault(require("./package.json")); +exports.name = package_json_1.default.name; +const ns = __importStar(require("./package.json")); +exports.thing = ns; +exports.name2 = ns.default.name; +//// [index.mjs] +import pkg from "./package.json" with { type: "json" }; +export const name = pkg.name; +import * as ns from "./package.json" with { type: "json" }; +export const thing = ns; +export const name2 = ns.default.name; + + +//// [index.d.ts] +export declare const name: string; +export declare const thing: { + default: { + name: string; + version: string; + type: string; + default: string; + }; +}; +export declare const name2: string; +//// [index.d.cts] +export declare const name: string; +export declare const thing: { + default: { + name: string; + version: string; + type: string; + default: string; + }; + name: string; + version: string; + type: string; +}; +export declare const name2: string; +//// [index.d.mts] +export declare const name: string; +export declare const thing: { + default: { + name: string; + version: string; + type: string; + default: string; + }; +}; +export declare const name2: string; diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node20).symbols b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node20).symbols new file mode 100644 index 0000000000000..e38476567ace3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node20).symbols @@ -0,0 +1,91 @@ +//// [tests/cases/conformance/node/nodeModulesResolveJsonModule.ts] //// + +=== index.ts === +import pkg from "./package.json" with { type: "json" }; +>pkg : Symbol(pkg, Decl(index.ts, 0, 6)) + +export const name = pkg.name; +>name : Symbol(name, Decl(index.ts, 1, 12)) +>pkg.name : Symbol("name", Decl(package.json, 0, 1)) +>pkg : Symbol(pkg, Decl(index.ts, 0, 6)) +>name : Symbol("name", Decl(package.json, 0, 1)) + +import * as ns from "./package.json" with { type: "json" }; +>ns : Symbol(ns, Decl(index.ts, 2, 6)) + +export const thing = ns; +>thing : Symbol(thing, Decl(index.ts, 3, 12)) +>ns : Symbol(ns, Decl(index.ts, 2, 6)) + +export const name2 = ns.default.name; +>name2 : Symbol(name2, Decl(index.ts, 4, 12)) +>ns.default.name : Symbol("name", Decl(package.json, 0, 1)) +>ns.default : Symbol("package") +>ns : Symbol(ns, Decl(index.ts, 2, 6)) +>default : Symbol("package") +>name : Symbol("name", Decl(package.json, 0, 1)) + +=== index.cts === +import pkg from "./package.json"; +>pkg : Symbol(pkg, Decl(index.cts, 0, 6)) + +export const name = pkg.name; +>name : Symbol(name, Decl(index.cts, 1, 12)) +>pkg.name : Symbol("name", Decl(package.json, 0, 1)) +>pkg : Symbol(pkg, Decl(index.cts, 0, 6)) +>name : Symbol("name", Decl(package.json, 0, 1)) + +import * as ns from "./package.json"; +>ns : Symbol(ns, Decl(index.cts, 2, 6)) + +export const thing = ns; +>thing : Symbol(thing, Decl(index.cts, 3, 12)) +>ns : Symbol(ns, Decl(index.cts, 2, 6)) + +export const name2 = ns.default.name; +>name2 : Symbol(name2, Decl(index.cts, 4, 12)) +>ns.default.name : Symbol("name", Decl(package.json, 0, 1)) +>ns.default : Symbol("package") +>ns : Symbol(ns, Decl(index.cts, 2, 6)) +>default : Symbol("package") +>name : Symbol("name", Decl(package.json, 0, 1)) + +=== index.mts === +import pkg from "./package.json" with { type: "json" }; +>pkg : Symbol(pkg, Decl(index.mts, 0, 6)) + +export const name = pkg.name; +>name : Symbol(name, Decl(index.mts, 1, 12)) +>pkg.name : Symbol("name", Decl(package.json, 0, 1)) +>pkg : Symbol(pkg, Decl(index.mts, 0, 6)) +>name : Symbol("name", Decl(package.json, 0, 1)) + +import * as ns from "./package.json" with { type: "json" }; +>ns : Symbol(ns, Decl(index.mts, 2, 6)) + +export const thing = ns; +>thing : Symbol(thing, Decl(index.mts, 3, 12)) +>ns : Symbol(ns, Decl(index.mts, 2, 6)) + +export const name2 = ns.default.name; +>name2 : Symbol(name2, Decl(index.mts, 4, 12)) +>ns.default.name : Symbol("name", Decl(package.json, 0, 1)) +>ns.default : Symbol("package") +>ns : Symbol(ns, Decl(index.mts, 2, 6)) +>default : Symbol("package") +>name : Symbol("name", Decl(package.json, 0, 1)) + +=== package.json === +{ + "name": "pkg", +>"name" : Symbol("name", Decl(package.json, 0, 1)) + + "version": "0.0.1", +>"version" : Symbol("version", Decl(package.json, 1, 18)) + + "type": "module", +>"type" : Symbol("type", Decl(package.json, 2, 23)) + + "default": "misedirection" +>"default" : Symbol("default", Decl(package.json, 3, 21)) +} diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node20).types b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node20).types new file mode 100644 index 0000000000000..aa041b8d125eb --- /dev/null +++ b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node20).types @@ -0,0 +1,152 @@ +//// [tests/cases/conformance/node/nodeModulesResolveJsonModule.ts] //// + +=== index.ts === +import pkg from "./package.json" with { type: "json" }; +>pkg : { name: string; version: string; type: string; default: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>type : error + +export const name = pkg.name; +>name : string +> : ^^^^^^ +>pkg.name : string +> : ^^^^^^ +>pkg : { name: string; version: string; type: string; default: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>name : string +> : ^^^^^^ + +import * as ns from "./package.json" with { type: "json" }; +>ns : { default: { name: string; version: string; type: string; default: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>type : error + +export const thing = ns; +>thing : { default: { name: string; version: string; type: string; default: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ns : { default: { name: string; version: string; type: string; default: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +export const name2 = ns.default.name; +>name2 : string +> : ^^^^^^ +>ns.default.name : string +> : ^^^^^^ +>ns.default : { name: string; version: string; type: string; default: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ns : { default: { name: string; version: string; type: string; default: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>default : { name: string; version: string; type: string; default: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>name : string +> : ^^^^^^ + +=== index.cts === +import pkg from "./package.json"; +>pkg : { name: string; version: string; type: string; default: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +export const name = pkg.name; +>name : string +> : ^^^^^^ +>pkg.name : string +> : ^^^^^^ +>pkg : { name: string; version: string; type: string; default: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>name : string +> : ^^^^^^ + +import * as ns from "./package.json"; +>ns : { default: { name: string; version: string; type: string; default: string; }; name: string; version: string; type: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +export const thing = ns; +>thing : { default: { name: string; version: string; type: string; default: string; }; name: string; version: string; type: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ns : { default: { name: string; version: string; type: string; default: string; }; name: string; version: string; type: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +export const name2 = ns.default.name; +>name2 : string +> : ^^^^^^ +>ns.default.name : string +> : ^^^^^^ +>ns.default : { name: string; version: string; type: string; default: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ns : { default: { name: string; version: string; type: string; default: string; }; name: string; version: string; type: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>default : { name: string; version: string; type: string; default: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>name : string +> : ^^^^^^ + +=== index.mts === +import pkg from "./package.json" with { type: "json" }; +>pkg : { name: string; version: string; type: string; default: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>type : error + +export const name = pkg.name; +>name : string +> : ^^^^^^ +>pkg.name : string +> : ^^^^^^ +>pkg : { name: string; version: string; type: string; default: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>name : string +> : ^^^^^^ + +import * as ns from "./package.json" with { type: "json" }; +>ns : { default: { name: string; version: string; type: string; default: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>type : error + +export const thing = ns; +>thing : { default: { name: string; version: string; type: string; default: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ns : { default: { name: string; version: string; type: string; default: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +export const name2 = ns.default.name; +>name2 : string +> : ^^^^^^ +>ns.default.name : string +> : ^^^^^^ +>ns.default : { name: string; version: string; type: string; default: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ns : { default: { name: string; version: string; type: string; default: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>default : { name: string; version: string; type: string; default: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>name : string +> : ^^^^^^ + +=== package.json === +{ +>{ "name": "pkg", "version": "0.0.1", "type": "module", "default": "misedirection"} : { name: string; version: string; type: string; default: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + "name": "pkg", +>"name" : string +> : ^^^^^^ +>"pkg" : "pkg" +> : ^^^^^ + + "version": "0.0.1", +>"version" : string +> : ^^^^^^ +>"0.0.1" : "0.0.1" +> : ^^^^^^^ + + "type": "module", +>"type" : string +> : ^^^^^^ +>"module" : "module" +> : ^^^^^^^^ + + "default": "misedirection" +>"default" : string +> : ^^^^^^ +>"misedirection" : "misedirection" +> : ^^^^^^^^^^^^^^^ +} diff --git a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node20).js b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node20).js new file mode 100644 index 0000000000000..f317196b7b330 --- /dev/null +++ b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node20).js @@ -0,0 +1,59 @@ +//// [tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts] //// + +//// [index.ts] +// cjs format file +import {h} from "../index.js"; +import mod = require("../index.js"); +import {f as _f} from "./index.js"; +import mod2 = require("./index.js"); +export async function f() { + const mod3 = await import ("../index.js"); + const mod4 = await import ("./index.js"); + h(); +} +//// [index.ts] +// esm format file +import {h as _h} from "./index.js"; +import mod = require("./index.js"); +import {f} from "./subfolder/index.js"; +import mod2 = require("./subfolder/index.js"); +export async function h() { + const mod3 = await import ("./index.js"); + const mod4 = await import ("./subfolder/index.js"); + f(); +} +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +import { f } from "./subfolder/index.js"; +export async function h() { + const mod3 = await import("./index.js"); + const mod4 = await import("./subfolder/index.js"); + f(); +} +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.f = f; +// cjs format file +const index_js_1 = require("../index.js"); +async function f() { + const mod3 = await import("../index.js"); + const mod4 = await import("./index.js"); + (0, index_js_1.h)(); +} + + +//// [index.d.ts] +export declare function h(): Promise; +//// [index.d.ts] +export declare function f(): Promise; diff --git a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node20).symbols b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node20).symbols new file mode 100644 index 0000000000000..c6feab94f0b7b --- /dev/null +++ b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node20).symbols @@ -0,0 +1,60 @@ +//// [tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts] //// + +=== subfolder/index.ts === +// cjs format file +import {h} from "../index.js"; +>h : Symbol(h, Decl(index.ts, 1, 8)) + +import mod = require("../index.js"); +>mod : Symbol(mod, Decl(index.ts, 1, 30)) + +import {f as _f} from "./index.js"; +>f : Symbol(f, Decl(index.ts, 4, 36)) +>_f : Symbol(_f, Decl(index.ts, 3, 8)) + +import mod2 = require("./index.js"); +>mod2 : Symbol(mod2, Decl(index.ts, 3, 35)) + +export async function f() { +>f : Symbol(f, Decl(index.ts, 4, 36)) + + const mod3 = await import ("../index.js"); +>mod3 : Symbol(mod3, Decl(index.ts, 6, 9)) +>"../index.js" : Symbol(mod, Decl(index.ts, 0, 0)) + + const mod4 = await import ("./index.js"); +>mod4 : Symbol(mod4, Decl(index.ts, 7, 9)) +>"./index.js" : Symbol(mod2, Decl(index.ts, 0, 0)) + + h(); +>h : Symbol(h, Decl(index.ts, 1, 8)) +} +=== index.ts === +// esm format file +import {h as _h} from "./index.js"; +>h : Symbol(h, Decl(index.ts, 4, 46)) +>_h : Symbol(_h, Decl(index.ts, 1, 8)) + +import mod = require("./index.js"); +>mod : Symbol(mod, Decl(index.ts, 1, 35)) + +import {f} from "./subfolder/index.js"; +>f : Symbol(f, Decl(index.ts, 3, 8)) + +import mod2 = require("./subfolder/index.js"); +>mod2 : Symbol(mod2, Decl(index.ts, 3, 39)) + +export async function h() { +>h : Symbol(h, Decl(index.ts, 4, 46)) + + const mod3 = await import ("./index.js"); +>mod3 : Symbol(mod3, Decl(index.ts, 6, 9)) +>"./index.js" : Symbol(mod, Decl(index.ts, 0, 0)) + + const mod4 = await import ("./subfolder/index.js"); +>mod4 : Symbol(mod4, Decl(index.ts, 7, 9)) +>"./subfolder/index.js" : Symbol(mod2, Decl(index.ts, 0, 0)) + + f(); +>f : Symbol(f, Decl(index.ts, 3, 8)) +} diff --git a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node20).types b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node20).types new file mode 100644 index 0000000000000..508587cdb1aa9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node20).types @@ -0,0 +1,102 @@ +//// [tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts] //// + +=== subfolder/index.ts === +// cjs format file +import {h} from "../index.js"; +>h : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + +import mod = require("../index.js"); +>mod : typeof mod +> : ^^^^^^^^^^ + +import {f as _f} from "./index.js"; +>f : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +>_f : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + +import mod2 = require("./index.js"); +>mod2 : typeof mod2 +> : ^^^^^^^^^^^ + +export async function f() { +>f : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + + const mod3 = await import ("../index.js"); +>mod3 : typeof mod +> : ^^^^^^^^^^ +>await import ("../index.js") : typeof mod +> : ^^^^^^^^^^ +>import ("../index.js") : Promise +> : ^^^^^^^^^^^^^^^^^^^ +>"../index.js" : "../index.js" +> : ^^^^^^^^^^^^^ + + const mod4 = await import ("./index.js"); +>mod4 : { default: typeof mod2; f(): Promise; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>await import ("./index.js") : { default: typeof mod2; f(): Promise; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import ("./index.js") : Promise<{ default: typeof mod2; f(): Promise; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"./index.js" : "./index.js" +> : ^^^^^^^^^^^^ + + h(); +>h() : Promise +> : ^^^^^^^^^^^^^ +>h : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +} +=== index.ts === +// esm format file +import {h as _h} from "./index.js"; +>h : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +>_h : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + +import mod = require("./index.js"); +>mod : typeof mod +> : ^^^^^^^^^^ + +import {f} from "./subfolder/index.js"; +>f : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + +import mod2 = require("./subfolder/index.js"); +>mod2 : typeof mod2 +> : ^^^^^^^^^^^ + +export async function h() { +>h : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ + + const mod3 = await import ("./index.js"); +>mod3 : typeof mod +> : ^^^^^^^^^^ +>await import ("./index.js") : typeof mod +> : ^^^^^^^^^^ +>import ("./index.js") : Promise +> : ^^^^^^^^^^^^^^^^^^^ +>"./index.js" : "./index.js" +> : ^^^^^^^^^^^^ + + const mod4 = await import ("./subfolder/index.js"); +>mod4 : { default: typeof mod2; f(): Promise; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>await import ("./subfolder/index.js") : { default: typeof mod2; f(): Promise; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>import ("./subfolder/index.js") : Promise<{ default: typeof mod2; f(): Promise; }> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"./subfolder/index.js" : "./subfolder/index.js" +> : ^^^^^^^^^^^^^^^^^^^^^^ + + f(); +>f() : Promise +> : ^^^^^^^^^^^^^ +>f : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +} diff --git a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node20).errors.txt b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node20).errors.txt new file mode 100644 index 0000000000000..0fd2e5390cdaf --- /dev/null +++ b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node20).errors.txt @@ -0,0 +1,28 @@ +subfolder/index.ts(2,11): error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. +subfolder/index.ts(4,5): error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. + + +==== subfolder/index.ts (2 errors) ==== + // cjs format file + const x = await 1; + ~~~~~ +!!! error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. + export {x}; + for await (const y of []) {} + ~~~~~ +!!! error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. +==== index.ts (0 errors) ==== + // esm format file + const x = await 1; + export {x}; + for await (const y of []) {} +==== package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node20).js b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node20).js new file mode 100644 index 0000000000000..8d33777f0c4e7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node20).js @@ -0,0 +1,44 @@ +//// [tests/cases/conformance/node/nodeModulesTopLevelAwait.ts] //// + +//// [index.ts] +// cjs format file +const x = await 1; +export {x}; +for await (const y of []) {} +//// [index.ts] +// esm format file +const x = await 1; +export {x}; +for await (const y of []) {} +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = await 1; +exports.x = x; +for await (const y of []) { } +//// [index.js] +// esm format file +const x = await 1; +export { x }; +for await (const y of []) { } + + +//// [index.d.ts] +declare const x = 1; +export { x }; +//// [index.d.ts] +declare const x = 1; +export { x }; diff --git a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node20).symbols b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node20).symbols new file mode 100644 index 0000000000000..c031a3a84d991 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node20).symbols @@ -0,0 +1,24 @@ +//// [tests/cases/conformance/node/nodeModulesTopLevelAwait.ts] //// + +=== subfolder/index.ts === +// cjs format file +const x = await 1; +>x : Symbol(x, Decl(index.ts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +for await (const y of []) {} +>y : Symbol(y, Decl(index.ts, 3, 16)) + +=== index.ts === +// esm format file +const x = await 1; +>x : Symbol(x, Decl(index.ts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +for await (const y of []) {} +>y : Symbol(y, Decl(index.ts, 3, 16)) + diff --git a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node20).types b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node20).types new file mode 100644 index 0000000000000..993c334814568 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node20).types @@ -0,0 +1,42 @@ +//// [tests/cases/conformance/node/nodeModulesTopLevelAwait.ts] //// + +=== subfolder/index.ts === +// cjs format file +const x = await 1; +>x : 1 +> : ^ +>await 1 : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +for await (const y of []) {} +>y : any +> : ^^^ +>[] : undefined[] +> : ^^^^^^^^^^^ + +=== index.ts === +// esm format file +const x = await 1; +>x : 1 +> : ^ +>await 1 : 1 +> : ^ +>1 : 1 +> : ^ + +export {x}; +>x : 1 +> : ^ + +for await (const y of []) {} +>y : any +> : ^^^ +>[] : undefined[] +> : ^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node20).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node20).js new file mode 100644 index 0000000000000..fe56029e4550f --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node20).js @@ -0,0 +1,35 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit1.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + interface ImportInterface {} +} +//// [require.d.ts] +export {}; +declare global { + interface RequireInterface {} +} +//// [index.ts] +/// +export interface LocalInterface extends RequireInterface {} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// + + +//// [index.d.ts] +/// +export interface LocalInterface extends RequireInterface { +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node20).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node20).symbols new file mode 100644 index 0000000000000..e9ef3b7f0b67f --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node20).symbols @@ -0,0 +1,16 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit1.ts] //// + +=== /index.ts === +/// +export interface LocalInterface extends RequireInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) + +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node20).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node20).types new file mode 100644 index 0000000000000..12d57f77e6462 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node20).types @@ -0,0 +1,14 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit1.ts] //// + +=== /index.ts === + +/// +export interface LocalInterface extends RequireInterface {} +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : any +> : ^^^ + + interface RequireInterface {} +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node20).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node20).js new file mode 100644 index 0000000000000..86c97ee2d0bdf --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node20).js @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit2.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + interface ImportInterface {} +} +//// [require.d.ts] +export {}; +declare global { + interface RequireInterface {} +} +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [index.ts] +/// +export interface LocalInterface extends ImportInterface {} + +//// [index.js] +/// +export {}; + + +//// [index.d.ts] +/// +export interface LocalInterface extends ImportInterface { +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node20).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node20).symbols new file mode 100644 index 0000000000000..dfccc41309458 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node20).symbols @@ -0,0 +1,16 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit2.ts] //// + +=== /index.ts === +/// +export interface LocalInterface extends ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) + +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(import.d.ts, 0, 10)) + + interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node20).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node20).types new file mode 100644 index 0000000000000..fddc105efb549 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node20).types @@ -0,0 +1,14 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit2.ts] //// + +=== /index.ts === + +/// +export interface LocalInterface extends ImportInterface {} +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : any +> : ^^^ + + interface ImportInterface {} +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node20).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node20).js new file mode 100644 index 0000000000000..a8890a9178cb4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node20).js @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit3.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + interface ImportInterface {} +} +//// [require.d.ts] +export {}; +declare global { + interface RequireInterface {} +} +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [index.ts] +/// +export interface LocalInterface extends RequireInterface {} + +//// [index.js] +/// +export {}; + + +//// [index.d.ts] +/// +export interface LocalInterface extends RequireInterface { +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node20).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node20).symbols new file mode 100644 index 0000000000000..bfbd450d9dbd0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node20).symbols @@ -0,0 +1,16 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit3.ts] //// + +=== /index.ts === +/// +export interface LocalInterface extends RequireInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) + +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node20).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node20).types new file mode 100644 index 0000000000000..f56da1e5c1cb5 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node20).types @@ -0,0 +1,14 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit3.ts] //// + +=== /index.ts === + +/// +export interface LocalInterface extends RequireInterface {} +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : any +> : ^^^ + + interface RequireInterface {} +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node20).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node20).js new file mode 100644 index 0000000000000..db90df830c912 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node20).js @@ -0,0 +1,35 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit4.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + interface ImportInterface {} +} +//// [require.d.ts] +export {}; +declare global { + interface RequireInterface {} +} +//// [index.ts] +/// +export interface LocalInterface extends ImportInterface {} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// + + +//// [index.d.ts] +/// +export interface LocalInterface extends ImportInterface { +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node20).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node20).symbols new file mode 100644 index 0000000000000..e719de58b3b23 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node20).symbols @@ -0,0 +1,16 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit4.ts] //// + +=== /index.ts === +/// +export interface LocalInterface extends ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) + +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(import.d.ts, 0, 10)) + + interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node20).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node20).types new file mode 100644 index 0000000000000..4335bc3ab76a4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node20).types @@ -0,0 +1,14 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit4.ts] //// + +=== /index.ts === + +/// +export interface LocalInterface extends ImportInterface {} +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : any +> : ^^^ + + interface ImportInterface {} +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node20).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node20).js new file mode 100644 index 0000000000000..c493d944dd946 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node20).js @@ -0,0 +1,38 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit5.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + interface ImportInterface {} +} +//// [require.d.ts] +export {}; +declare global { + interface RequireInterface {} +} +//// [index.ts] +/// +/// +export interface LocalInterface extends ImportInterface, RequireInterface {} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// +/// + + +//// [index.d.ts] +/// +/// +export interface LocalInterface extends ImportInterface, RequireInterface { +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node20).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node20).symbols new file mode 100644 index 0000000000000..3508b838ed8fb --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node20).symbols @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit5.ts] //// + +=== /index.ts === +/// +/// +export interface LocalInterface extends ImportInterface, RequireInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) + +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(import.d.ts, 0, 10)) + + interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) +} +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node20).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node20).types new file mode 100644 index 0000000000000..1b71bbe867818 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node20).types @@ -0,0 +1,23 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit5.ts] //// + +=== /index.ts === + +/// +/// +export interface LocalInterface extends ImportInterface, RequireInterface {} +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : any +> : ^^^ + + interface ImportInterface {} +} +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : any +> : ^^^ + + interface RequireInterface {} +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node20).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node20).js new file mode 100644 index 0000000000000..a4f6401e19790 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node20).js @@ -0,0 +1,53 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit6.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + interface ImportInterface {} + function getInterI(): ImportInterface; +} +//// [require.d.ts] +export {}; +declare global { + interface RequireInterface {} + function getInterR(): RequireInterface; +} +//// [uses.ts] +/// +export default getInterR(); +//// [index.ts] +import obj from "./uses.js" +export default (obj as typeof obj); + +//// [uses.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// +exports.default = getInterR(); +//// [index.js] +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const uses_js_1 = __importDefault(require("./uses.js")); +exports.default = uses_js_1.default; + + +//// [uses.d.ts] +/// +declare const _default: RequireInterface; +export default _default; +//// [index.d.ts] +import obj from "./uses.js"; +declare const _default: typeof obj; +export default _default; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node20).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node20).symbols new file mode 100644 index 0000000000000..5b4a63b24e6f4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node20).symbols @@ -0,0 +1,27 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit6.ts] //// + +=== /index.ts === +import obj from "./uses.js" +>obj : Symbol(obj, Decl(index.ts, 0, 6)) + +export default (obj as typeof obj); +>obj : Symbol(obj, Decl(index.ts, 0, 6)) +>obj : Symbol(obj, Decl(index.ts, 0, 6)) + +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) + + function getInterR(): RequireInterface; +>getInterR : Symbol(getInterR, Decl(require.d.ts, 2, 33)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) +} +=== /uses.ts === +/// +export default getInterR(); +>getInterR : Symbol(getInterR, Decl(require.d.ts, 2, 33)) + diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node20).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node20).types new file mode 100644 index 0000000000000..79de08e8be8c3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node20).types @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit6.ts] //// + +=== /index.ts === +import obj from "./uses.js" +>obj : RequireInterface +> : ^^^^^^^^^^^^^^^^ + +export default (obj as typeof obj); +>(obj as typeof obj) : RequireInterface +> : ^^^^^^^^^^^^^^^^ +>obj as typeof obj : RequireInterface +> : ^^^^^^^^^^^^^^^^ +>obj : RequireInterface +> : ^^^^^^^^^^^^^^^^ +>obj : RequireInterface +> : ^^^^^^^^^^^^^^^^ + +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : typeof global +> : ^^^^^^^^^^^^^ + + interface RequireInterface {} + function getInterR(): RequireInterface; +>getInterR : () => RequireInterface +> : ^^^^^^ +} +=== /uses.ts === +/// +export default getInterR(); +>getInterR() : RequireInterface +> : ^^^^^^^^^^^^^^^^ +>getInterR : () => RequireInterface +> : ^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node20).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node20).js new file mode 100644 index 0000000000000..e6134a89881bc --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node20).js @@ -0,0 +1,139 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit7.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + interface ImportInterface { _i: any; } + function getInterI(): ImportInterface; +} +//// [require.d.ts] +export {}; +declare global { + interface RequireInterface { _r: any; } + function getInterR(): RequireInterface; +} +//// [uses.ts] +/// +export default getInterI(); +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [uses.ts] +/// +export default getInterR(); +//// [package.json] +{ + "private": true, + "type": "commonjs" +} +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [index.ts] +// only an esm file can `import` both kinds of files +import obj1 from "./sub1/uses.js" +import obj2 from "./sub2/uses.js" +export default [obj1, obj2.default] as const; + +//// [uses.js] +/// +export default getInterI(); +//// [uses.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// +exports.default = getInterR(); +//// [index.js] +// only an esm file can `import` both kinds of files +import obj1 from "./sub1/uses.js"; +import obj2 from "./sub2/uses.js"; +export default [obj1, obj2.default]; + + +//// [uses.d.ts] +/// +declare const _default: ImportInterface; +export default _default; +//// [uses.d.ts] +/// +declare const _default: RequireInterface; +export default _default; +//// [index.d.ts] +declare const _default: readonly [ImportInterface, RequireInterface]; +export default _default; + + +//// [DtsFileErrors] + + +out/index.d.ts(1,35): error TS2304: Cannot find name 'ImportInterface'. +out/index.d.ts(1,52): error TS2304: Cannot find name 'RequireInterface'. + + +==== out/index.d.ts (2 errors) ==== + declare const _default: readonly [ImportInterface, RequireInterface]; + ~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'ImportInterface'. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + export default _default; + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export {}; + declare global { + interface ImportInterface { _i: any; } + function getInterI(): ImportInterface; + } +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export {}; + declare global { + interface RequireInterface { _r: any; } + function getInterR(): RequireInterface; + } +==== out/sub1/uses.d.ts (0 errors) ==== + /// + declare const _default: ImportInterface; + export default _default; + +==== /sub1/package.json (0 errors) ==== + { + "private": true, + "type": "module" + } +==== out/sub2/uses.d.ts (0 errors) ==== + /// + declare const _default: RequireInterface; + export default _default; + +==== /sub2/package.json (0 errors) ==== + { + "private": true, + "type": "commonjs" + } +==== /package.json (0 errors) ==== + { + "private": true, + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node20).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node20).symbols new file mode 100644 index 0000000000000..26fb30363849d --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node20).symbols @@ -0,0 +1,53 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit7.ts] //// + +=== /index.ts === +// only an esm file can `import` both kinds of files +import obj1 from "./sub1/uses.js" +>obj1 : Symbol(obj1, Decl(index.ts, 1, 6)) + +import obj2 from "./sub2/uses.js" +>obj2 : Symbol(obj2, Decl(index.ts, 2, 6)) + +export default [obj1, obj2.default] as const; +>obj1 : Symbol(obj1, Decl(index.ts, 1, 6)) +>obj2.default : Symbol(obj2.default, Decl(uses.ts, 0, 0)) +>obj2 : Symbol(obj2, Decl(index.ts, 2, 6)) +>default : Symbol(obj2.default, Decl(uses.ts, 0, 0)) +>const : Symbol(const) + +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(import.d.ts, 0, 10)) + + interface ImportInterface { _i: any; } +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) +>_i : Symbol(ImportInterface._i, Decl(import.d.ts, 2, 31)) + + function getInterI(): ImportInterface; +>getInterI : Symbol(getInterI, Decl(import.d.ts, 2, 42)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) +} +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + interface RequireInterface { _r: any; } +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) +>_r : Symbol(RequireInterface._r, Decl(require.d.ts, 2, 32)) + + function getInterR(): RequireInterface; +>getInterR : Symbol(getInterR, Decl(require.d.ts, 2, 43)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) +} +=== /sub1/uses.ts === +/// +export default getInterI(); +>getInterI : Symbol(getInterI, Decl(import.d.ts, 2, 42)) + +=== /sub2/uses.ts === +/// +export default getInterR(); +>getInterR : Symbol(getInterR, Decl(require.d.ts, 2, 43)) + diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node20).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node20).types new file mode 100644 index 0000000000000..478e6741c1467 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node20).types @@ -0,0 +1,68 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit7.ts] //// + +=== /index.ts === +// only an esm file can `import` both kinds of files +import obj1 from "./sub1/uses.js" +>obj1 : ImportInterface +> : ^^^^^^^^^^^^^^^ + +import obj2 from "./sub2/uses.js" +>obj2 : typeof obj2 +> : ^^^^^^^^^^^ + +export default [obj1, obj2.default] as const; +>[obj1, obj2.default] as const : readonly [ImportInterface, RequireInterface] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[obj1, obj2.default] : readonly [ImportInterface, RequireInterface] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>obj1 : ImportInterface +> : ^^^^^^^^^^^^^^^ +>obj2.default : RequireInterface +> : ^^^^^^^^^^^^^^^^ +>obj2 : typeof obj2 +> : ^^^^^^^^^^^ +>default : RequireInterface +> : ^^^^^^^^^^^^^^^^ + +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : typeof global +> : ^^^^^^^^^^^^^ + + interface ImportInterface { _i: any; } +>_i : any + + function getInterI(): ImportInterface; +>getInterI : () => ImportInterface +> : ^^^^^^ +} +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : typeof global +> : ^^^^^^^^^^^^^ + + interface RequireInterface { _r: any; } +>_r : any + + function getInterR(): RequireInterface; +>getInterR : () => RequireInterface +> : ^^^^^^ +} +=== /sub1/uses.ts === +/// +export default getInterI(); +>getInterI() : ImportInterface +> : ^^^^^^^^^^^^^^^ +>getInterI : () => ImportInterface +> : ^^^^^^ + +=== /sub2/uses.ts === +/// +export default getInterR(); +>getInterR() : RequireInterface +> : ^^^^^^^^^^^^^^^^ +>getInterR : () => RequireInterface +> : ^^^^^^ + diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node20).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node20).errors.txt new file mode 100644 index 0000000000000..c9a6ac79317f9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node20).errors.txt @@ -0,0 +1,29 @@ +/index.ts(2,1): error TS2304: Cannot find name 'foo'. + + +==== /index.ts (1 errors) ==== + /// + foo; + ~~~ +!!! error TS2304: Cannot find name 'foo'. + bar; // bar should resolve while foo should not, since index.js is cjs + export {}; +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export {}; + declare global { + var foo: number; + } +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export {}; + declare global { + var bar: number; + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node20).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node20).js new file mode 100644 index 0000000000000..df6436da900a7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node20).js @@ -0,0 +1,33 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride1.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + var foo: number; +} +//// [require.d.ts] +export {}; +declare global { + var bar: number; +} +//// [index.ts] +/// +foo; +bar; // bar should resolve while foo should not, since index.js is cjs +export {}; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// +foo; +bar; // bar should resolve while foo should not, since index.js is cjs diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node20).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node20).symbols new file mode 100644 index 0000000000000..0959d385ada08 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node20).symbols @@ -0,0 +1,17 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride1.ts] //// + +=== /index.ts === +/// +foo; +bar; // bar should resolve while foo should not, since index.js is cjs +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) + +export {}; +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + var bar: number; +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node20).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node20).types new file mode 100644 index 0000000000000..a9b87eb30959c --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node20).types @@ -0,0 +1,23 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride1.ts] //// + +=== /index.ts === +/// +foo; +>foo : any +> : ^^^ + +bar; // bar should resolve while foo should not, since index.js is cjs +>bar : number +> : ^^^^^^ + +export {}; +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : typeof global +> : ^^^^^^^^^^^^^ + + var bar: number; +>bar : number +> : ^^^^^^ +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node20).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node20).errors.txt new file mode 100644 index 0000000000000..13991aa13538a --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node20).errors.txt @@ -0,0 +1,34 @@ +/index.ts(3,1): error TS2304: Cannot find name 'bar'. + + +==== /index.ts (1 errors) ==== + /// + foo; // foo should resolve while bar should not, since index.js is esm + bar; + ~~~ +!!! error TS2304: Cannot find name 'bar'. + export {}; +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export {}; + declare global { + var foo: number; + } +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export {}; + declare global { + var bar: number; + } +==== /package.json (0 errors) ==== + { + "private": true, + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node20).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node20).js new file mode 100644 index 0000000000000..aee176689b2d9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node20).js @@ -0,0 +1,37 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride2.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + var foo: number; +} +//// [require.d.ts] +export {}; +declare global { + var bar: number; +} +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [index.ts] +/// +foo; // foo should resolve while bar should not, since index.js is esm +bar; +export {}; + +//// [index.js] +/// +foo; // foo should resolve while bar should not, since index.js is esm +bar; +export {}; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node20).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node20).symbols new file mode 100644 index 0000000000000..0f65d258dc7cf --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node20).symbols @@ -0,0 +1,17 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride2.ts] //// + +=== /index.ts === +/// +foo; // foo should resolve while bar should not, since index.js is esm +>foo : Symbol(foo, Decl(import.d.ts, 2, 7)) + +bar; +export {}; +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(import.d.ts, 0, 10)) + + var foo: number; +>foo : Symbol(foo, Decl(import.d.ts, 2, 7)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node20).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node20).types new file mode 100644 index 0000000000000..438257a3bb9c3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node20).types @@ -0,0 +1,23 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride2.ts] //// + +=== /index.ts === +/// +foo; // foo should resolve while bar should not, since index.js is esm +>foo : number +> : ^^^^^^ + +bar; +>bar : any +> : ^^^ + +export {}; +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : typeof global +> : ^^^^^^^^^^^^^ + + var foo: number; +>foo : number +> : ^^^^^^ +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node20).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node20).errors.txt new file mode 100644 index 0000000000000..477d247984d39 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node20).errors.txt @@ -0,0 +1,34 @@ +/index.ts(2,1): error TS2304: Cannot find name 'foo'. + + +==== /index.ts (1 errors) ==== + /// + foo; + ~~~ +!!! error TS2304: Cannot find name 'foo'. + bar; // bar should resolve while foo should not, since even though index.js is esm, the reference is cjs + export {}; +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export {}; + declare global { + var foo: number; + } +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export {}; + declare global { + var bar: number; + } +==== /package.json (0 errors) ==== + { + "private": true, + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node20).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node20).js new file mode 100644 index 0000000000000..c6806f897de91 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node20).js @@ -0,0 +1,37 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + var foo: number; +} +//// [require.d.ts] +export {}; +declare global { + var bar: number; +} +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [index.ts] +/// +foo; +bar; // bar should resolve while foo should not, since even though index.js is esm, the reference is cjs +export {}; + +//// [index.js] +/// +foo; +bar; // bar should resolve while foo should not, since even though index.js is esm, the reference is cjs +export {}; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node20).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node20).symbols new file mode 100644 index 0000000000000..1c8df0a238567 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node20).symbols @@ -0,0 +1,17 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts] //// + +=== /index.ts === +/// +foo; +bar; // bar should resolve while foo should not, since even though index.js is esm, the reference is cjs +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) + +export {}; +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + var bar: number; +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node20).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node20).types new file mode 100644 index 0000000000000..a655521043fd9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node20).types @@ -0,0 +1,23 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts] //// + +=== /index.ts === +/// +foo; +>foo : any +> : ^^^ + +bar; // bar should resolve while foo should not, since even though index.js is esm, the reference is cjs +>bar : number +> : ^^^^^^ + +export {}; +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : typeof global +> : ^^^^^^^^^^^^^ + + var bar: number; +>bar : number +> : ^^^^^^ +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node20).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node20).errors.txt new file mode 100644 index 0000000000000..3d7f07f2775e1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node20).errors.txt @@ -0,0 +1,29 @@ +/index.ts(3,1): error TS2304: Cannot find name 'bar'. + + +==== /index.ts (1 errors) ==== + /// + foo; // foo should resolve while bar should not, since even though index.js is cjs, the refernce is esm + bar; + ~~~ +!!! error TS2304: Cannot find name 'bar'. + export {}; +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export {}; + declare global { + var foo: number; + } +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export {}; + declare global { + var bar: number; + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node20).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node20).js new file mode 100644 index 0000000000000..74346916b2641 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node20).js @@ -0,0 +1,33 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride4.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + var foo: number; +} +//// [require.d.ts] +export {}; +declare global { + var bar: number; +} +//// [index.ts] +/// +foo; // foo should resolve while bar should not, since even though index.js is cjs, the refernce is esm +bar; +export {}; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// +foo; // foo should resolve while bar should not, since even though index.js is cjs, the refernce is esm +bar; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node20).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node20).symbols new file mode 100644 index 0000000000000..9f7867c7dbd5a --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node20).symbols @@ -0,0 +1,17 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride4.ts] //// + +=== /index.ts === +/// +foo; // foo should resolve while bar should not, since even though index.js is cjs, the refernce is esm +>foo : Symbol(foo, Decl(import.d.ts, 2, 7)) + +bar; +export {}; +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(import.d.ts, 0, 10)) + + var foo: number; +>foo : Symbol(foo, Decl(import.d.ts, 2, 7)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node20).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node20).types new file mode 100644 index 0000000000000..45343b1ac3c7d --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node20).types @@ -0,0 +1,23 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride4.ts] //// + +=== /index.ts === +/// +foo; // foo should resolve while bar should not, since even though index.js is cjs, the refernce is esm +>foo : number +> : ^^^^^^ + +bar; +>bar : any +> : ^^^ + +export {}; +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : typeof global +> : ^^^^^^^^^^^^^ + + var foo: number; +>foo : number +> : ^^^^^^ +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node20).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node20).js new file mode 100644 index 0000000000000..0c37dc00e4deb --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node20).js @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride5.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + var foo: number; +} +//// [require.d.ts] +export {}; +declare global { + var bar: number; +} +//// [index.ts] +/// +/// +// Both `foo` and `bar` should resolve, as _both_ entrypoints are included by the two +// references above. +foo; +bar; +export {}; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// +/// +// Both `foo` and `bar` should resolve, as _both_ entrypoints are included by the two +// references above. +foo; +bar; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node20).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node20).symbols new file mode 100644 index 0000000000000..1e0a2417e63a0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node20).symbols @@ -0,0 +1,30 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride5.ts] //// + +=== /index.ts === +/// +/// +// Both `foo` and `bar` should resolve, as _both_ entrypoints are included by the two +// references above. +foo; +>foo : Symbol(foo, Decl(import.d.ts, 2, 7)) + +bar; +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) + +export {}; +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(import.d.ts, 0, 10)) + + var foo: number; +>foo : Symbol(foo, Decl(import.d.ts, 2, 7)) +} +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + var bar: number; +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node20).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node20).types new file mode 100644 index 0000000000000..bb5a09e68df2d --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node20).types @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride5.ts] //// + +=== /index.ts === +/// +/// +// Both `foo` and `bar` should resolve, as _both_ entrypoints are included by the two +// references above. +foo; +>foo : number +> : ^^^^^^ + +bar; +>bar : number +> : ^^^^^^ + +export {}; +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : typeof global +> : ^^^^^^^^^^^^^ + + var foo: number; +>foo : number +> : ^^^^^^ +} +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : typeof global +> : ^^^^^^^^^^^^^ + + var bar: number; +>bar : number +> : ^^^^^^ +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node20).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node20).errors.txt new file mode 100644 index 0000000000000..68be0baf51514 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node20).errors.txt @@ -0,0 +1,32 @@ +/index.ts(1,23): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(2,1): error TS2304: Cannot find name 'foo'. + + +==== /index.ts (2 errors) ==== + /// + ~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + foo; // bad resolution mode, which resolves is arbitrary + ~~~ +!!! error TS2304: Cannot find name 'foo'. + bar; + export {}; +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export {}; + declare global { + var foo: number; + } +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export {}; + declare global { + var bar: number; + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node20).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node20).js new file mode 100644 index 0000000000000..09540ae8aba4a --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node20).js @@ -0,0 +1,33 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverrideModeError.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + var foo: number; +} +//// [require.d.ts] +export {}; +declare global { + var bar: number; +} +//// [index.ts] +/// +foo; // bad resolution mode, which resolves is arbitrary +bar; +export {}; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// +foo; // bad resolution mode, which resolves is arbitrary +bar; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node20).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node20).symbols new file mode 100644 index 0000000000000..8a1dd89345abe --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node20).symbols @@ -0,0 +1,17 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverrideModeError.ts] //// + +=== /index.ts === +/// +foo; // bad resolution mode, which resolves is arbitrary +bar; +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) + +export {}; +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + var bar: number; +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node20).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node20).types new file mode 100644 index 0000000000000..fc34db9ecd52d --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node20).types @@ -0,0 +1,23 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverrideModeError.ts] //// + +=== /index.ts === +/// +foo; // bad resolution mode, which resolves is arbitrary +>foo : any +> : ^^^ + +bar; +>bar : number +> : ^^^^^^ + +export {}; +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : typeof global +> : ^^^^^^^^^^^^^ + + var bar: number; +>bar : number +> : ^^^^^^ +} diff --git a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node20).js b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node20).js new file mode 100644 index 0000000000000..fe34ab0566b01 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node20).js @@ -0,0 +1,108 @@ +//// [tests/cases/conformance/node/nodeModulesTypesVersionPackageExports.ts] //// + +//// [index.ts] +// esm format file +import * as mod from "inner"; +mod.correctVersionApplied; + +//// [index.mts] +// esm format file +import * as mod from "inner"; +mod.correctVersionApplied; + +//// [index.cts] +// cjs format file +import * as mod from "inner"; +mod.correctVersionApplied; + +//// [index.d.ts] +// cjs format file +export const noConditionsApplied = true; +//// [index.d.mts] +// esm format file +export const importConditionApplied = true; +//// [index.d.cts] +// cjs format file +export const wrongConditionApplied = true; +//// [old-types.d.ts] +export const noVersionApplied = true; +//// [new-types.d.ts] +export const correctVersionApplied = true; +//// [future-types.d.ts] +export const futureVersionApplied = true; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + ".": { + "types@>=10000": "./future-types.d.ts", + "types@>=1": "./new-types.d.ts", + "types": "./old-types.d.ts", + "import": "./index.mjs", + "node": "./index.js" + }, + } +} + +//// [index.js] +// esm format file +import * as mod from "inner"; +mod.correctVersionApplied; +//// [index.mjs] +// esm format file +import * as mod from "inner"; +mod.correctVersionApplied; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const mod = __importStar(require("inner")); +mod.correctVersionApplied; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node20).symbols b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node20).symbols new file mode 100644 index 0000000000000..8ec3cb25a7915 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node20).symbols @@ -0,0 +1,59 @@ +//// [tests/cases/conformance/node/nodeModulesTypesVersionPackageExports.ts] //// + +=== index.ts === +// esm format file +import * as mod from "inner"; +>mod : Symbol(mod, Decl(index.ts, 1, 6)) + +mod.correctVersionApplied; +>mod.correctVersionApplied : Symbol(correctVersionApplied, Decl(new-types.d.ts, 0, 12)) +>mod : Symbol(mod, Decl(index.ts, 1, 6)) +>correctVersionApplied : Symbol(correctVersionApplied, Decl(new-types.d.ts, 0, 12)) + +=== index.mts === +// esm format file +import * as mod from "inner"; +>mod : Symbol(mod, Decl(index.mts, 1, 6)) + +mod.correctVersionApplied; +>mod.correctVersionApplied : Symbol(correctVersionApplied, Decl(new-types.d.ts, 0, 12)) +>mod : Symbol(mod, Decl(index.mts, 1, 6)) +>correctVersionApplied : Symbol(correctVersionApplied, Decl(new-types.d.ts, 0, 12)) + +=== index.cts === +// cjs format file +import * as mod from "inner"; +>mod : Symbol(mod, Decl(index.cts, 1, 6)) + +mod.correctVersionApplied; +>mod.correctVersionApplied : Symbol(mod.correctVersionApplied, Decl(new-types.d.ts, 0, 12)) +>mod : Symbol(mod, Decl(index.cts, 1, 6)) +>correctVersionApplied : Symbol(mod.correctVersionApplied, Decl(new-types.d.ts, 0, 12)) + +=== node_modules/inner/index.d.ts === +// cjs format file +export const noConditionsApplied = true; +>noConditionsApplied : Symbol(noConditionsApplied, Decl(index.d.ts, 1, 12)) + +=== node_modules/inner/index.d.mts === +// esm format file +export const importConditionApplied = true; +>importConditionApplied : Symbol(importConditionApplied, Decl(index.d.mts, 1, 12)) + +=== node_modules/inner/index.d.cts === +// cjs format file +export const wrongConditionApplied = true; +>wrongConditionApplied : Symbol(wrongConditionApplied, Decl(index.d.cts, 1, 12)) + +=== node_modules/inner/old-types.d.ts === +export const noVersionApplied = true; +>noVersionApplied : Symbol(noVersionApplied, Decl(old-types.d.ts, 0, 12)) + +=== node_modules/inner/new-types.d.ts === +export const correctVersionApplied = true; +>correctVersionApplied : Symbol(correctVersionApplied, Decl(new-types.d.ts, 0, 12)) + +=== node_modules/inner/future-types.d.ts === +export const futureVersionApplied = true; +>futureVersionApplied : Symbol(futureVersionApplied, Decl(future-types.d.ts, 0, 12)) + diff --git a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node20).types b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node20).types new file mode 100644 index 0000000000000..c4e2d97b2afba --- /dev/null +++ b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node20).types @@ -0,0 +1,89 @@ +//// [tests/cases/conformance/node/nodeModulesTypesVersionPackageExports.ts] //// + +=== index.ts === +// esm format file +import * as mod from "inner"; +>mod : typeof mod +> : ^^^^^^^^^^ + +mod.correctVersionApplied; +>mod.correctVersionApplied : true +> : ^^^^ +>mod : typeof mod +> : ^^^^^^^^^^ +>correctVersionApplied : true +> : ^^^^ + +=== index.mts === +// esm format file +import * as mod from "inner"; +>mod : typeof mod +> : ^^^^^^^^^^ + +mod.correctVersionApplied; +>mod.correctVersionApplied : true +> : ^^^^ +>mod : typeof mod +> : ^^^^^^^^^^ +>correctVersionApplied : true +> : ^^^^ + +=== index.cts === +// cjs format file +import * as mod from "inner"; +>mod : typeof mod +> : ^^^^^^^^^^ + +mod.correctVersionApplied; +>mod.correctVersionApplied : true +> : ^^^^ +>mod : typeof mod +> : ^^^^^^^^^^ +>correctVersionApplied : true +> : ^^^^ + +=== node_modules/inner/index.d.ts === +// cjs format file +export const noConditionsApplied = true; +>noConditionsApplied : true +> : ^^^^ +>true : true +> : ^^^^ + +=== node_modules/inner/index.d.mts === +// esm format file +export const importConditionApplied = true; +>importConditionApplied : true +> : ^^^^ +>true : true +> : ^^^^ + +=== node_modules/inner/index.d.cts === +// cjs format file +export const wrongConditionApplied = true; +>wrongConditionApplied : true +> : ^^^^ +>true : true +> : ^^^^ + +=== node_modules/inner/old-types.d.ts === +export const noVersionApplied = true; +>noVersionApplied : true +> : ^^^^ +>true : true +> : ^^^^ + +=== node_modules/inner/new-types.d.ts === +export const correctVersionApplied = true; +>correctVersionApplied : true +> : ^^^^ +>true : true +> : ^^^^ + +=== node_modules/inner/future-types.d.ts === +export const futureVersionApplied = true; +>futureVersionApplied : true +> : ^^^^ +>true : true +> : ^^^^ + diff --git a/tests/baselines/reference/nodePackageSelfName(module=node20).js b/tests/baselines/reference/nodePackageSelfName(module=node20).js new file mode 100644 index 0000000000000..dc65d690cf617 --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfName(module=node20).js @@ -0,0 +1,77 @@ +//// [tests/cases/conformance/node/nodePackageSelfName.ts] //// + +//// [index.ts] +// esm format file +import * as self from "package"; +self; +//// [index.mts] +// esm format file +import * as self from "package"; +self; +//// [index.cts] +// esm format file +import * as self from "package"; +self; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" +} + +//// [index.js] +// esm format file +import * as self from "package"; +self; +//// [index.mjs] +// esm format file +import * as self from "package"; +self; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// esm format file +const self = __importStar(require("package")); +self; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodePackageSelfName(module=node20).symbols b/tests/baselines/reference/nodePackageSelfName(module=node20).symbols new file mode 100644 index 0000000000000..88b7e3612047e --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfName(module=node20).symbols @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/node/nodePackageSelfName.ts] //// + +=== index.ts === +// esm format file +import * as self from "package"; +>self : Symbol(self, Decl(index.ts, 1, 6)) + +self; +>self : Symbol(self, Decl(index.ts, 1, 6)) + +=== index.mts === +// esm format file +import * as self from "package"; +>self : Symbol(self, Decl(index.mts, 1, 6)) + +self; +>self : Symbol(self, Decl(index.mts, 1, 6)) + +=== index.cts === +// esm format file +import * as self from "package"; +>self : Symbol(self, Decl(index.cts, 1, 6)) + +self; +>self : Symbol(self, Decl(index.cts, 1, 6)) + diff --git a/tests/baselines/reference/nodePackageSelfName(module=node20).types b/tests/baselines/reference/nodePackageSelfName(module=node20).types new file mode 100644 index 0000000000000..058acb1f54fdf --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfName(module=node20).types @@ -0,0 +1,32 @@ +//// [tests/cases/conformance/node/nodePackageSelfName.ts] //// + +=== index.ts === +// esm format file +import * as self from "package"; +>self : typeof self +> : ^^^^^^^^^^^ + +self; +>self : typeof self +> : ^^^^^^^^^^^ + +=== index.mts === +// esm format file +import * as self from "package"; +>self : typeof self +> : ^^^^^^^^^^^ + +self; +>self : typeof self +> : ^^^^^^^^^^^ + +=== index.cts === +// esm format file +import * as self from "package"; +>self : typeof self +> : ^^^^^^^^^^^ + +self; +>self : typeof self +> : ^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=node20).js b/tests/baselines/reference/nodePackageSelfNameScoped(module=node20).js new file mode 100644 index 0000000000000..f9d633df6fc03 --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfNameScoped(module=node20).js @@ -0,0 +1,77 @@ +//// [tests/cases/conformance/node/nodePackageSelfNameScoped.ts] //// + +//// [index.ts] +// esm format file +import * as self from "@scope/package"; +self; +//// [index.mts] +// esm format file +import * as self from "@scope/package"; +self; +//// [index.cts] +// cjs format file +import * as self from "@scope/package"; +self; +//// [package.json] +{ + "name": "@scope/package", + "private": true, + "type": "module", + "exports": "./index.js" +} + +//// [index.js] +// esm format file +import * as self from "@scope/package"; +self; +//// [index.mjs] +// esm format file +import * as self from "@scope/package"; +self; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const self = __importStar(require("@scope/package")); +self; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=node20).symbols b/tests/baselines/reference/nodePackageSelfNameScoped(module=node20).symbols new file mode 100644 index 0000000000000..3b63ba35050a0 --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfNameScoped(module=node20).symbols @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/node/nodePackageSelfNameScoped.ts] //// + +=== index.ts === +// esm format file +import * as self from "@scope/package"; +>self : Symbol(self, Decl(index.ts, 1, 6)) + +self; +>self : Symbol(self, Decl(index.ts, 1, 6)) + +=== index.mts === +// esm format file +import * as self from "@scope/package"; +>self : Symbol(self, Decl(index.mts, 1, 6)) + +self; +>self : Symbol(self, Decl(index.mts, 1, 6)) + +=== index.cts === +// cjs format file +import * as self from "@scope/package"; +>self : Symbol(self, Decl(index.cts, 1, 6)) + +self; +>self : Symbol(self, Decl(index.cts, 1, 6)) + diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=node20).types b/tests/baselines/reference/nodePackageSelfNameScoped(module=node20).types new file mode 100644 index 0000000000000..e197ff58db4b0 --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfNameScoped(module=node20).types @@ -0,0 +1,32 @@ +//// [tests/cases/conformance/node/nodePackageSelfNameScoped.ts] //// + +=== index.ts === +// esm format file +import * as self from "@scope/package"; +>self : typeof self +> : ^^^^^^^^^^^ + +self; +>self : typeof self +> : ^^^^^^^^^^^ + +=== index.mts === +// esm format file +import * as self from "@scope/package"; +>self : typeof self +> : ^^^^^^^^^^^ + +self; +>self : typeof self +> : ^^^^^^^^^^^ + +=== index.cts === +// cjs format file +import * as self from "@scope/package"; +>self : typeof self +> : ^^^^^^^^^^^ + +self; +>self : typeof self +> : ^^^^^^^^^^^ + diff --git a/tests/baselines/reference/nonTSExtensions(module=node20).js b/tests/baselines/reference/nonTSExtensions(module=node20).js new file mode 100644 index 0000000000000..117d199aa7df9 --- /dev/null +++ b/tests/baselines/reference/nonTSExtensions(module=node20).js @@ -0,0 +1,14 @@ +//// [tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/nonTSExtensions.ts] //// + +//// [example.json] +{} + +//// [styles.d.css.ts] +export {}; + +//// [index.mts] +import {} from "./example.json" with { type: "json" }; // Ok +import {} from "./styles.css"; // Ok + +//// [index.mjs] +export {}; diff --git a/tests/baselines/reference/packageJsonImportsErrors(module=node20).errors.txt b/tests/baselines/reference/packageJsonImportsErrors(module=node20).errors.txt new file mode 100644 index 0000000000000..8167e0cafd0ff --- /dev/null +++ b/tests/baselines/reference/packageJsonImportsErrors(module=node20).errors.txt @@ -0,0 +1,31 @@ +/index.ts(2,16): error TS2877: This import uses a '.ts' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path. + + +==== /package.json (0 errors) ==== + { + "name": "pkg", + "type": "module", + "imports": { + "#foo.ts": "./foo.ts", + "#internal/*": "./internal/*" + }, + "exports": { + "./*.ts": { + "source": "./*.ts", + "default": "./*.js" + } + } + } + +==== /foo.ts (0 errors) ==== + export {}; + +==== /internal/foo.ts (0 errors) ==== + export {}; + +==== /index.ts (1 errors) ==== + import {} from "#foo.ts"; // Ok + import {} from "#internal/foo.ts"; // Error + ~~~~~~~~~~~~~~~~~~ +!!! error TS2877: This import uses a '.ts' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path. + import {} from "pkg/foo.ts"; // Ok \ No newline at end of file diff --git a/tests/baselines/reference/packageJsonImportsErrors(module=node20).js b/tests/baselines/reference/packageJsonImportsErrors(module=node20).js new file mode 100644 index 0000000000000..5a0805f046fa1 --- /dev/null +++ b/tests/baselines/reference/packageJsonImportsErrors(module=node20).js @@ -0,0 +1,37 @@ +//// [tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/packageJsonImportsErrors.ts] //// + +//// [package.json] +{ + "name": "pkg", + "type": "module", + "imports": { + "#foo.ts": "./foo.ts", + "#internal/*": "./internal/*" + }, + "exports": { + "./*.ts": { + "source": "./*.ts", + "default": "./*.js" + } + } +} + +//// [foo.ts] +export {}; + +//// [foo.ts] +export {}; + +//// [index.ts] +import {} from "#foo.ts"; // Ok +import {} from "#internal/foo.ts"; // Error +import {} from "pkg/foo.ts"; // Ok + +//// [foo.js] +export {}; +//// [foo.js] +export {}; +//// [index.js] +import {} from "#foo.ts"; // Ok +import {} from "#internal/foo.ts"; // Error +import {} from "pkg/foo.ts"; // Ok diff --git a/tests/baselines/reference/parser.forAwait.es2018.errors.txt b/tests/baselines/reference/parser.forAwait.es2018.errors.txt index 5ac9587cdb8c5..bfda085ea41a3 100644 --- a/tests/baselines/reference/parser.forAwait.es2018.errors.txt +++ b/tests/baselines/reference/parser.forAwait.es2018.errors.txt @@ -8,10 +8,10 @@ inFunctionDeclWithExprIsError.ts(3,9): error TS1103: 'for await' loops are only inGeneratorWithDeclIsError.ts(3,9): error TS1103: 'for await' loops are only allowed within async functions and at the top levels of modules. inGeneratorWithExprIsError.ts(3,9): error TS1103: 'for await' loops are only allowed within async functions and at the top levels of modules. topLevelWithDeclIsError.ts(1,5): error TS1431: 'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module. -topLevelWithDeclIsError.ts(1,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +topLevelWithDeclIsError.ts(1,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. topLevelWithDeclIsError.ts(1,23): error TS2304: Cannot find name 'y'. topLevelWithExprIsError.ts(1,5): error TS1431: 'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module. -topLevelWithExprIsError.ts(1,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +topLevelWithExprIsError.ts(1,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. topLevelWithExprIsError.ts(1,12): error TS2304: Cannot find name 'x'. topLevelWithExprIsError.ts(1,17): error TS2304: Cannot find name 'y'. @@ -21,7 +21,7 @@ topLevelWithExprIsError.ts(1,17): error TS2304: Cannot find name 'y'. ~~~~~ !!! error TS1431: 'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module. ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. ~ !!! error TS2304: Cannot find name 'y'. } @@ -30,7 +30,7 @@ topLevelWithExprIsError.ts(1,17): error TS2304: Cannot find name 'y'. ~~~~~ !!! error TS1431: 'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module. ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. ~ !!! error TS2304: Cannot find name 'x'. ~ diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json b/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json index c10b594349bf7..7d80ebfb92667 100644 --- a/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json @@ -6,7 +6,7 @@ "Resolving in CJS mode with conditions 'require', 'types', 'node'.", "File '/.src/package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'react/jsx-runtime' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'react/jsx-runtime' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "Found 'package.json' at '/.src/node_modules/@types/react/package.json'.", "'package.json' does not have a 'typesVersions' field.", @@ -18,7 +18,7 @@ "======== Resolving module './' from '/.src/node_modules/@types/react/jsx-runtime.d.ts'. ========", "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'require', 'types', 'node'.", - "Loading module as file / folder, candidate module location '/.src/node_modules/@types/react/', target file types: TypeScript, JavaScript, Declaration.", + "Loading module as file / folder, candidate module location '/.src/node_modules/@types/react/', target file types: TypeScript, JavaScript, Declaration, JSON.", "File '/.src/node_modules/@types/react/package.json' exists according to earlier cached lookups.", "'package.json' does not have a 'typings' field.", "'package.json' has 'types' field 'index.d.ts' that references '/.src/node_modules/@types/react/index.d.ts'.", diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json index ba487e514fba5..989b8de378cd4 100644 --- a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json @@ -4,7 +4,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'import', 'types', 'node'.", "File '/.src/package.json' exists according to earlier cached lookups.", - "Loading module 'react/jsx-runtime' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "Loading module 'react/jsx-runtime' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "Found 'package.json' at '/.src/node_modules/@types/react/package.json'.", "Using 'exports' subpath './*' with target './jsx-runtime.js'.", @@ -17,7 +17,7 @@ "======== Resolving module './' from '/.src/node_modules/@types/react/jsx-runtime.d.ts'. ========", "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'require', 'types', 'node'.", - "Loading module as file / folder, candidate module location '/.src/node_modules/@types/react/', target file types: TypeScript, JavaScript, Declaration.", + "Loading module as file / folder, candidate module location '/.src/node_modules/@types/react/', target file types: TypeScript, JavaScript, Declaration, JSON.", "File '/.src/node_modules/@types/react/package.json' exists according to earlier cached lookups.", "'package.json' does not have a 'typesVersions' field.", "'package.json' does not have a 'typings' field.", diff --git a/tests/baselines/reference/topLevelAwait.1(module=es2022,target=es2015).errors.txt b/tests/baselines/reference/topLevelAwait.1(module=es2022,target=es2015).errors.txt index deff8ae8b66fc..21c68b1837718 100644 --- a/tests/baselines/reference/topLevelAwait.1(module=es2022,target=es2015).errors.txt +++ b/tests/baselines/reference/topLevelAwait.1(module=es2022,target=es2015).errors.txt @@ -1,13 +1,13 @@ -index.ts(2,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -index.ts(46,3): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +index.ts(2,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +index.ts(46,3): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. ==== index.ts (2 errors) ==== export const x = 1; await x; ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. // reparse element access as await await [x]; @@ -53,7 +53,7 @@ other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when t declare const dec: any; @(await dec) ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. class C { } @@ -84,7 +84,7 @@ other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when t for await (const item of arr) { ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. item; } \ No newline at end of file diff --git a/tests/baselines/reference/topLevelAwait.1(module=esnext,target=es2015).errors.txt b/tests/baselines/reference/topLevelAwait.1(module=esnext,target=es2015).errors.txt index deff8ae8b66fc..21c68b1837718 100644 --- a/tests/baselines/reference/topLevelAwait.1(module=esnext,target=es2015).errors.txt +++ b/tests/baselines/reference/topLevelAwait.1(module=esnext,target=es2015).errors.txt @@ -1,13 +1,13 @@ -index.ts(2,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -index.ts(46,3): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +index.ts(2,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +index.ts(46,3): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. ==== index.ts (2 errors) ==== export const x = 1; await x; ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. // reparse element access as await await [x]; @@ -53,7 +53,7 @@ other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when t declare const dec: any; @(await dec) ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. class C { } @@ -84,7 +84,7 @@ other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when t for await (const item of arr) { ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. item; } \ No newline at end of file diff --git a/tests/baselines/reference/topLevelAwait.1(module=system,target=es2015).errors.txt b/tests/baselines/reference/topLevelAwait.1(module=system,target=es2015).errors.txt index deff8ae8b66fc..21c68b1837718 100644 --- a/tests/baselines/reference/topLevelAwait.1(module=system,target=es2015).errors.txt +++ b/tests/baselines/reference/topLevelAwait.1(module=system,target=es2015).errors.txt @@ -1,13 +1,13 @@ -index.ts(2,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -index.ts(46,3): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. -other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +index.ts(2,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +index.ts(46,3): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. ==== index.ts (2 errors) ==== export const x = 1; await x; ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. // reparse element access as await await [x]; @@ -53,7 +53,7 @@ other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when t declare const dec: any; @(await dec) ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. class C { } @@ -84,7 +84,7 @@ other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when t for await (const item of arr) { ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. +!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'node20', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher. item; } \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.errors.txt b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.errors.txt index db2b266576521..363afda18581b 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.errors.txt +++ b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.errors.txt @@ -1,6 +1,6 @@ -error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'nodenext', 'preserve'. +error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'node20', 'nodenext', 'preserve'. -!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'nodenext', 'preserve'. +!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'node20', 'nodenext', 'preserve'. ==== file.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.oldTranspile.errors.txt index db2b266576521..363afda18581b 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'nodenext', 'preserve'. +error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'node20', 'nodenext', 'preserve'. -!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'nodenext', 'preserve'. +!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'node20', 'nodenext', 'preserve'. ==== file.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.errors.txt b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.errors.txt index db2b266576521..363afda18581b 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.errors.txt +++ b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.errors.txt @@ -1,6 +1,6 @@ -error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'nodenext', 'preserve'. +error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'node20', 'nodenext', 'preserve'. -!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'nodenext', 'preserve'. +!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'node20', 'nodenext', 'preserve'. ==== file.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.oldTranspile.errors.txt index db2b266576521..363afda18581b 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'nodenext', 'preserve'. +error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'node20', 'nodenext', 'preserve'. -!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'nodenext', 'preserve'. +!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', 'node20', 'nodenext', 'preserve'. ==== file.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node20).errors.txt b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node20).errors.txt new file mode 100644 index 0000000000000..9062d29947423 --- /dev/null +++ b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node20).errors.txt @@ -0,0 +1,17 @@ +usage.ts(1,23): error TS2688: Cannot find type definition file for 'pkg'. + + +==== node_modules/pkg/index.d.ts (0 errors) ==== + interface GlobalThing { a: number } +==== node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "types": "index.d.ts", + "exports": "some-other-thing.js" + } +==== usage.ts (1 errors) ==== + /// + ~~~ +!!! error TS2688: Cannot find type definition file for 'pkg'. + + const a: GlobalThing = { a: 0 }; \ No newline at end of file diff --git a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node20).js b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node20).js new file mode 100644 index 0000000000000..7c518b3b9d9cc --- /dev/null +++ b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node20).js @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts] //// + +//// [index.d.ts] +interface GlobalThing { a: number } +//// [package.json] +{ + "name": "pkg", + "types": "index.d.ts", + "exports": "some-other-thing.js" +} +//// [usage.ts] +/// + +const a: GlobalThing = { a: 0 }; + +//// [usage.js] +"use strict"; +/// +Object.defineProperty(exports, "__esModule", { value: true }); +const a = { a: 0 }; diff --git a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node20).symbols b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node20).symbols new file mode 100644 index 0000000000000..a98af671f5982 --- /dev/null +++ b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node20).symbols @@ -0,0 +1,15 @@ +//// [tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts] //// + +=== node_modules/pkg/index.d.ts === +interface GlobalThing { a: number } +>GlobalThing : Symbol(GlobalThing, Decl(index.d.ts, 0, 0)) +>a : Symbol(GlobalThing.a, Decl(index.d.ts, 0, 23)) + +=== usage.ts === +/// + +const a: GlobalThing = { a: 0 }; +>a : Symbol(a, Decl(usage.ts, 2, 5)) +>GlobalThing : Symbol(GlobalThing, Decl(index.d.ts, 0, 0)) +>a : Symbol(a, Decl(usage.ts, 2, 24)) + diff --git a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node20).types b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node20).types new file mode 100644 index 0000000000000..fb8b260b07e8b --- /dev/null +++ b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node20).types @@ -0,0 +1,20 @@ +//// [tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts] //// + +=== node_modules/pkg/index.d.ts === +interface GlobalThing { a: number } +>a : number +> : ^^^^^^ + +=== usage.ts === +/// + +const a: GlobalThing = { a: 0 }; +>a : GlobalThing +> : ^^^^^^^^^^^ +>{ a: 0 } : { a: number; } +> : ^^^^^^^^^^^^^^ +>a : number +> : ^^^^^^ +>0 : 0 +> : ^ + diff --git a/tests/baselines/reference/tsbuild/moduleResolution/shared-resolution-should-not-report-error.js b/tests/baselines/reference/tsbuild/moduleResolution/shared-resolution-should-not-report-error.js index fa310f31caeb5..48255a8b2df0c 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/shared-resolution-should-not-report-error.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/shared-resolution-should-not-report-error.js @@ -128,7 +128,7 @@ Found 'package.json' at '/home/src/workspaces/project/packages/b/package.json'. Module resolution kind is not specified, using 'NodeNext'. Resolving in ESM mode with conditions 'import', 'types', 'node'. File '/home/src/workspaces/project/packages/b/package.json' exists according to earlier cached lookups. -Loading module 'a' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Loading module 'a' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. Directory '/home/src/workspaces/project/packages/b/node_modules' does not exist, skipping all lookups in it. Resolution for module 'a' was found in cache from location '/home/src/workspaces/project/packages'. diff --git a/tests/baselines/reference/tsbuild/moduleResolution/when-resolution-is-not-shared.js b/tests/baselines/reference/tsbuild/moduleResolution/when-resolution-is-not-shared.js index f101000471bf2..00c00702b7570 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/when-resolution-is-not-shared.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/when-resolution-is-not-shared.js @@ -230,7 +230,7 @@ Found 'package.json' at '/home/src/workspaces/project/packages/b/package.json'. Module resolution kind is not specified, using 'NodeNext'. Resolving in ESM mode with conditions 'import', 'types', 'node'. File '/home/src/workspaces/project/packages/b/package.json' exists according to earlier cached lookups. -Loading module 'a' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Loading module 'a' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. Directory '/home/src/workspaces/project/packages/b/node_modules' does not exist, skipping all lookups in it. Directory '/home/src/workspaces/project/packages/node_modules' does not exist, skipping all lookups in it. diff --git a/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js b/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js index e97e301b9a84e..4fd0fed8d7d03 100644 --- a/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js +++ b/tests/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js @@ -110,7 +110,7 @@ default: es5 --module, -m Specify what module code is generated. -one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, node18, nodenext, preserve +one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, node18, node20, nodenext, preserve default: undefined --lib diff --git a/tests/baselines/reference/tsc/commandLine/help-all.js b/tests/baselines/reference/tsc/commandLine/help-all.js index b5fada38c18e6..f8748d79684ec 100644 --- a/tests/baselines/reference/tsc/commandLine/help-all.js +++ b/tests/baselines/reference/tsc/commandLine/help-all.js @@ -82,7 +82,7 @@ Conditions to set in addition to the resolver-specific defaults when resolving i --module, -m Specify what module code is generated. -one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, node18, nodenext, preserve +one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, node18, node20, nodenext, preserve default: undefined --moduleResolution diff --git a/tests/baselines/reference/tsc/commandLine/help.js b/tests/baselines/reference/tsc/commandLine/help.js index a254cdc62d1d5..67e3304223a88 100644 --- a/tests/baselines/reference/tsc/commandLine/help.js +++ b/tests/baselines/reference/tsc/commandLine/help.js @@ -109,7 +109,7 @@ default: es5 --module, -m Specify what module code is generated. -one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, node18, nodenext, preserve +one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, node18, node20, nodenext, preserve default: undefined --lib diff --git a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js index 55da16f6b7921..829577fef216a 100644 --- a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js +++ b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js @@ -110,7 +110,7 @@ default: es5 --module, -m Specify what module code is generated. -one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, node18, nodenext, preserve +one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, node18, node20, nodenext, preserve default: undefined --lib diff --git a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index 55da16f6b7921..829577fef216a 100644 --- a/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -110,7 +110,7 @@ default: es5 --module, -m Specify what module code is generated. -one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, node18, nodenext, preserve +one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, node18, node20, nodenext, preserve default: undefined --lib diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project-with-nodenext.js b/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project-with-nodenext.js index 515748a97f6ad..eae8064d8d5e4 100644 --- a/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project-with-nodenext.js +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project-with-nodenext.js @@ -518,19 +518,19 @@ File '/package.json' does not exist. ======== Resolving module '../core/index' from '/user/username/projects/sample1/tests/index.ts'. ======== Module resolution kind is not specified, using 'NodeNext'. Resolving in CJS mode with conditions 'require', 'types', 'node'. -Loading module as file / folder, candidate module location '/user/username/projects/sample1/core/index', target file types: TypeScript, JavaScript, Declaration. +Loading module as file / folder, candidate module location '/user/username/projects/sample1/core/index', target file types: TypeScript, JavaScript, Declaration, JSON. File '/user/username/projects/sample1/core/index.ts' exists - use it as a name resolution result. ======== Module name '../core/index' was successfully resolved to '/user/username/projects/sample1/core/index.ts'. ======== ======== Resolving module '../logic/index' from '/user/username/projects/sample1/tests/index.ts'. ======== Module resolution kind is not specified, using 'NodeNext'. Resolving in CJS mode with conditions 'require', 'types', 'node'. -Loading module as file / folder, candidate module location '/user/username/projects/sample1/logic/index', target file types: TypeScript, JavaScript, Declaration. +Loading module as file / folder, candidate module location '/user/username/projects/sample1/logic/index', target file types: TypeScript, JavaScript, Declaration, JSON. File '/user/username/projects/sample1/logic/index.ts' exists - use it as a name resolution result. ======== Module name '../logic/index' was successfully resolved to '/user/username/projects/sample1/logic/index.ts'. ======== ======== Resolving module '../core/anotherModule' from '/user/username/projects/sample1/tests/index.ts'. ======== Module resolution kind is not specified, using 'NodeNext'. Resolving in CJS mode with conditions 'require', 'types', 'node'. -Loading module as file / folder, candidate module location '/user/username/projects/sample1/core/anotherModule', target file types: TypeScript, JavaScript, Declaration. +Loading module as file / folder, candidate module location '/user/username/projects/sample1/core/anotherModule', target file types: TypeScript, JavaScript, Declaration, JSON. File '/user/username/projects/sample1/core/anotherModule.ts' exists - use it as a name resolution result. ======== Module name '../core/anotherModule' was successfully resolved to '/user/username/projects/sample1/core/anotherModule.ts'. ======== File '/user/username/projects/sample1/core/package.json' does not exist. diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-with-nodenext.js b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-with-nodenext.js index 97426995537cc..ae426222d77b8 100644 --- a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-with-nodenext.js +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-with-nodenext.js @@ -274,7 +274,7 @@ File '/package.json' does not exist. ======== Resolving module './b' from '/user/username/projects/transitiveReferences/c.ts'. ======== Module resolution kind is not specified, using 'NodeNext'. Resolving in CJS mode with conditions 'require', 'types', 'node'. -Loading module as file / folder, candidate module location '/user/username/projects/transitiveReferences/b', target file types: TypeScript, JavaScript, Declaration. +Loading module as file / folder, candidate module location '/user/username/projects/transitiveReferences/b', target file types: TypeScript, JavaScript, Declaration, JSON. File '/user/username/projects/transitiveReferences/b.ts' exists - use it as a name resolution result. ======== Module name './b' was successfully resolved to '/user/username/projects/transitiveReferences/b.ts'. ======== ======== Resolving module '@ref/a' from '/user/username/projects/transitiveReferences/c.ts'. ======== @@ -284,7 +284,7 @@ Resolving in CJS mode with conditions 'require', 'types', 'node'. 'paths' option is specified, looking for a pattern to match module name '@ref/a'. Module name '@ref/a', matched pattern '@ref/*'. Trying substitution './refs/*', candidate module location: './refs/a'. -Loading module as file / folder, candidate module location '/user/username/projects/transitiveReferences/refs/a', target file types: TypeScript, JavaScript, Declaration. +Loading module as file / folder, candidate module location '/user/username/projects/transitiveReferences/refs/a', target file types: TypeScript, JavaScript, Declaration, JSON. File '/user/username/projects/transitiveReferences/refs/a.ts' does not exist. File '/user/username/projects/transitiveReferences/refs/a.tsx' does not exist. File '/user/username/projects/transitiveReferences/refs/a.d.ts' exists - use it as a name resolution result. @@ -703,7 +703,7 @@ File '/package.json' does not exist according to earlier cached lookups. ======== Resolving module './b' from '/user/username/projects/transitiveReferences/c.ts'. ======== Module resolution kind is not specified, using 'NodeNext'. Resolving in CJS mode with conditions 'require', 'types', 'node'. -Loading module as file / folder, candidate module location '/user/username/projects/transitiveReferences/b', target file types: TypeScript, JavaScript, Declaration. +Loading module as file / folder, candidate module location '/user/username/projects/transitiveReferences/b', target file types: TypeScript, JavaScript, Declaration, JSON. File '/user/username/projects/transitiveReferences/b.ts' exists - use it as a name resolution result. ======== Module name './b' was successfully resolved to '/user/username/projects/transitiveReferences/b.ts'. ======== ======== Resolving module '@ref/a' from '/user/username/projects/transitiveReferences/c.ts'. ======== @@ -713,7 +713,7 @@ Resolving in CJS mode with conditions 'require', 'types', 'node'. 'paths' option is specified, looking for a pattern to match module name '@ref/a'. Module name '@ref/a', matched pattern '@ref/*'. Trying substitution './nrefs/*', candidate module location: './nrefs/a'. -Loading module as file / folder, candidate module location '/user/username/projects/transitiveReferences/nrefs/a', target file types: TypeScript, JavaScript, Declaration. +Loading module as file / folder, candidate module location '/user/username/projects/transitiveReferences/nrefs/a', target file types: TypeScript, JavaScript, Declaration, JSON. File '/user/username/projects/transitiveReferences/nrefs/a.ts' does not exist. File '/user/username/projects/transitiveReferences/nrefs/a.tsx' does not exist. File '/user/username/projects/transitiveReferences/nrefs/a.d.ts' exists - use it as a name resolution result. @@ -922,7 +922,7 @@ File '/package.json' does not exist according to earlier cached lookups. ======== Resolving module './b' from '/user/username/projects/transitiveReferences/c.ts'. ======== Module resolution kind is not specified, using 'NodeNext'. Resolving in CJS mode with conditions 'require', 'types', 'node'. -Loading module as file / folder, candidate module location '/user/username/projects/transitiveReferences/b', target file types: TypeScript, JavaScript, Declaration. +Loading module as file / folder, candidate module location '/user/username/projects/transitiveReferences/b', target file types: TypeScript, JavaScript, Declaration, JSON. File '/user/username/projects/transitiveReferences/b.ts' exists - use it as a name resolution result. ======== Module name './b' was successfully resolved to '/user/username/projects/transitiveReferences/b.ts'. ======== ======== Resolving module '@ref/a' from '/user/username/projects/transitiveReferences/c.ts'. ======== @@ -932,7 +932,7 @@ Resolving in CJS mode with conditions 'require', 'types', 'node'. 'paths' option is specified, looking for a pattern to match module name '@ref/a'. Module name '@ref/a', matched pattern '@ref/*'. Trying substitution './refs/*', candidate module location: './refs/a'. -Loading module as file / folder, candidate module location '/user/username/projects/transitiveReferences/refs/a', target file types: TypeScript, JavaScript, Declaration. +Loading module as file / folder, candidate module location '/user/username/projects/transitiveReferences/refs/a', target file types: TypeScript, JavaScript, Declaration, JSON. File '/user/username/projects/transitiveReferences/refs/a.ts' does not exist. File '/user/username/projects/transitiveReferences/refs/a.tsx' does not exist. File '/user/username/projects/transitiveReferences/refs/a.d.ts' exists - use it as a name resolution result. @@ -1518,7 +1518,7 @@ Resolving in CJS mode with conditions 'require', 'types', 'node'. 'paths' option is specified, looking for a pattern to match module name '@ref/a'. Module name '@ref/a', matched pattern '@ref/*'. Trying substitution './refs/*', candidate module location: './refs/a'. -Loading module as file / folder, candidate module location '/user/username/projects/transitiveReferences/refs/a', target file types: TypeScript, JavaScript, Declaration. +Loading module as file / folder, candidate module location '/user/username/projects/transitiveReferences/refs/a', target file types: TypeScript, JavaScript, Declaration, JSON. File '/user/username/projects/transitiveReferences/refs/a.ts' does not exist. File '/user/username/projects/transitiveReferences/refs/a.tsx' does not exist. File '/user/username/projects/transitiveReferences/refs/a.d.ts' exists - use it as a name resolution result. diff --git a/tests/baselines/reference/tsserver/fourslashServer/rewriteRelativeImportExtensionsProjectReferences1.js b/tests/baselines/reference/tsserver/fourslashServer/rewriteRelativeImportExtensionsProjectReferences1.js index 98d4e3467c79d..8be3fd1423de1 100644 --- a/tests/baselines/reference/tsserver/fourslashServer/rewriteRelativeImportExtensionsProjectReferences1.js +++ b/tests/baselines/reference/tsserver/fourslashServer/rewriteRelativeImportExtensionsProjectReferences1.js @@ -34,6 +34,7 @@ export {}; "rootDir": "src", "outDir": "dist", "module": "nodenext", + "resolveJsonModule": false, } } @@ -50,6 +51,7 @@ import {} from "../../common/src/index.ts"; "rewriteRelativeImportExtensions": true, "rootDir": "src", "outDir": "dist", + "resolveJsonModule": false, }, "references": [ { "path": "../common" } @@ -78,6 +80,7 @@ Info seq [hh:mm:ss:mss] Config: /tests/cases/fourslash/server/packages/common/t "rootDir": "/tests/cases/fourslash/server/packages/common/src", "outDir": "/tests/cases/fourslash/server/packages/common/dist", "module": 199, + "resolveJsonModule": false, "configFilePath": "/tests/cases/fourslash/server/packages/common/tsconfig.json" } } @@ -216,7 +219,7 @@ Info seq [hh:mm:ss:mss] Files (4) /home/src/tslibs/TS/Lib/lib.d.ts Text-1 lib.d.ts-Text /home/src/tslibs/TS/Lib/lib.decorators.d.ts Text-1 lib.decorators.d.ts-Text /home/src/tslibs/TS/Lib/lib.decorators.legacy.d.ts Text-1 lib.decorators.legacy.d.ts-Text - /tests/cases/fourslash/server/packages/common/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"composite\": true,\n \"rootDir\": \"src\",\n \"outDir\": \"dist\",\n \"module\": \"nodenext\",\n }\n}" + /tests/cases/fourslash/server/packages/common/tsconfig.json SVC-1-0 "{\n \"compilerOptions\": {\n \"composite\": true,\n \"rootDir\": \"src\",\n \"outDir\": \"dist\",\n \"module\": \"nodenext\",\n \"resolveJsonModule\": false,\n }\n}" ../../../../../../home/src/tslibs/TS/Lib/lib.d.ts @@ -359,6 +362,7 @@ Info seq [hh:mm:ss:mss] Config: /tests/cases/fourslash/server/packages/main/tsc "rewriteRelativeImportExtensions": true, "rootDir": "/tests/cases/fourslash/server/packages/main/src", "outDir": "/tests/cases/fourslash/server/packages/main/dist", + "resolveJsonModule": false, "configFilePath": "/tests/cases/fourslash/server/packages/main/tsconfig.json" }, "projectReferences": [ diff --git a/tests/baselines/reference/typeOnlyESMImportFromCJS(module=node20).js b/tests/baselines/reference/typeOnlyESMImportFromCJS(module=node20).js new file mode 100644 index 0000000000000..01b406ded5d80 --- /dev/null +++ b/tests/baselines/reference/typeOnlyESMImportFromCJS(module=node20).js @@ -0,0 +1,19 @@ +//// [tests/cases/conformance/externalModules/typeOnly/typeOnlyESMImportFromCJS.ts] //// + +//// [module.mts] +export {}; + +//// [common.cts] +import type {} from "./module.mts"; +import type {} from "./module.mts" with { "resolution-mode": "import" }; +import type {} from "./module.mts" with { "resolution-mode": "require" }; +type _1 = typeof import("./module.mts"); +type _2 = typeof import("./module.mts", { with: { "resolution-mode": "import" } }); +type _3 = typeof import("./module.mts", { with: { "resolution-mode": "require" } }); + + +//// [module.mjs] +export {}; +//// [common.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/typeOnlyESMImportFromCJS(module=node20).symbols b/tests/baselines/reference/typeOnlyESMImportFromCJS(module=node20).symbols new file mode 100644 index 0000000000000..b47541e6f6105 --- /dev/null +++ b/tests/baselines/reference/typeOnlyESMImportFromCJS(module=node20).symbols @@ -0,0 +1,19 @@ +//// [tests/cases/conformance/externalModules/typeOnly/typeOnlyESMImportFromCJS.ts] //// + +=== module.mts === + +export {}; + +=== common.cts === +import type {} from "./module.mts"; +import type {} from "./module.mts" with { "resolution-mode": "import" }; +import type {} from "./module.mts" with { "resolution-mode": "require" }; +type _1 = typeof import("./module.mts"); +>_1 : Symbol(_1, Decl(common.cts, 2, 73)) + +type _2 = typeof import("./module.mts", { with: { "resolution-mode": "import" } }); +>_2 : Symbol(_2, Decl(common.cts, 3, 40)) + +type _3 = typeof import("./module.mts", { with: { "resolution-mode": "require" } }); +>_3 : Symbol(_3, Decl(common.cts, 4, 83)) + diff --git a/tests/baselines/reference/typeOnlyESMImportFromCJS(module=node20).types b/tests/baselines/reference/typeOnlyESMImportFromCJS(module=node20).types new file mode 100644 index 0000000000000..1b0e522401930 --- /dev/null +++ b/tests/baselines/reference/typeOnlyESMImportFromCJS(module=node20).types @@ -0,0 +1,22 @@ +//// [tests/cases/conformance/externalModules/typeOnly/typeOnlyESMImportFromCJS.ts] //// + +=== module.mts === + +export {}; + +=== common.cts === +import type {} from "./module.mts"; +import type {} from "./module.mts" with { "resolution-mode": "import" }; +import type {} from "./module.mts" with { "resolution-mode": "require" }; +type _1 = typeof import("./module.mts"); +>_1 : typeof import("module", { with: { "resolution-mode": "import" } }) +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +type _2 = typeof import("./module.mts", { with: { "resolution-mode": "import" } }); +>_2 : typeof import("module", { with: { "resolution-mode": "import" } }) +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +type _3 = typeof import("./module.mts", { with: { "resolution-mode": "require" } }); +>_3 : typeof import("module", { with: { "resolution-mode": "import" } }) +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/cases/compiler/moduleNodeDefaultImports.ts b/tests/cases/compiler/moduleNodeDefaultImports.ts index a784dcddb6824..d56d3f4b496a4 100644 --- a/tests/cases/compiler/moduleNodeDefaultImports.ts +++ b/tests/cases/compiler/moduleNodeDefaultImports.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @filename: mod.cts declare function fun(): void; export default fun; diff --git a/tests/cases/compiler/moduleResolutionWithModule.ts b/tests/cases/compiler/moduleResolutionWithModule.ts index df96cce680e38..d7034553c5abf 100644 --- a/tests/cases/compiler/moduleResolutionWithModule.ts +++ b/tests/cases/compiler/moduleResolutionWithModule.ts @@ -1,5 +1,5 @@ // @moduleResolution: node16,nodenext -// @module: commonjs,node16,node18,nodenext +// @module: commonjs,node16,node18,node20,nodenext // @filename: node_modules/pkg/package.json { "name": "pkg", diff --git a/tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts b/tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts index 70e1754726f8a..f53915fad3560 100644 --- a/tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts +++ b/tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts @@ -1,4 +1,4 @@ -// @module: commonjs,node16,node18,nodenext +// @module: commonjs,node16,node18,node20,nodenext // @filename: node_modules/pkg/index.d.ts interface GlobalThing { a: number } // @filename: node_modules/pkg/package.json diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts index e9e3b45633f5b..c5a3c7449348a 100644 --- a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts @@ -1,5 +1,5 @@ // @moduleResolution: nodenext -// @module: node18,nodenext +// @module: node18,node20,nodenext // @jsx: preserve // @filename: /src/foo.tsx diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts index 86534df323aa6..090fa1c8d086a 100644 --- a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts @@ -1,5 +1,5 @@ // @moduleResolution: nodenext -// @module: node18,nodenext +// @module: node18,node20,nodenext // @jsx: react // @filename: /src/foo.tsx diff --git a/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/cjsErrors.ts b/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/cjsErrors.ts index 74c057f7ef610..f08fe6cae62ba 100644 --- a/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/cjsErrors.ts +++ b/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/cjsErrors.ts @@ -1,4 +1,4 @@ -// @module: node18,nodenext +// @module: node18,node20,nodenext // @rewriteRelativeImportExtensions: true // @noTypesAndSymbols: true // @verbatimModuleSyntax: true diff --git a/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/nodeModulesTsFiles.ts b/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/nodeModulesTsFiles.ts index a2519eace725f..5eeae28ba59ee 100644 --- a/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/nodeModulesTsFiles.ts +++ b/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/nodeModulesTsFiles.ts @@ -1,4 +1,4 @@ -// @module: node18,nodenext +// @module: node18,node20,nodenext // @rewriteRelativeImportExtensions: true // @noTypesAndSymbols: true // @noEmit: true diff --git a/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/nonTSExtensions.ts b/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/nonTSExtensions.ts index f207666dfd16a..93cf82841b8d8 100644 --- a/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/nonTSExtensions.ts +++ b/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/nonTSExtensions.ts @@ -1,4 +1,4 @@ -// @module: node18,nodenext +// @module: node18,node20,nodenext // @rewriteRelativeImportExtensions: true // @allowArbitraryExtensions: true // @resolveJsonModule: true diff --git a/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/packageJsonImportsErrors.ts b/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/packageJsonImportsErrors.ts index b0677a69120fa..587b4875d34aa 100644 --- a/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/packageJsonImportsErrors.ts +++ b/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/packageJsonImportsErrors.ts @@ -1,4 +1,4 @@ -// @module: node18,nodenext +// @module: node18,node20,nodenext // @rewriteRelativeImportExtensions: true // @noTypesAndSymbols: true // @verbatimModuleSyntax: true diff --git a/tests/cases/conformance/externalModules/typeOnly/typeOnlyESMImportFromCJS.ts b/tests/cases/conformance/externalModules/typeOnly/typeOnlyESMImportFromCJS.ts index b08a88a44cc81..1415bfd3776a4 100644 --- a/tests/cases/conformance/externalModules/typeOnly/typeOnlyESMImportFromCJS.ts +++ b/tests/cases/conformance/externalModules/typeOnly/typeOnlyESMImportFromCJS.ts @@ -1,4 +1,4 @@ -// @module: node18,nodenext +// @module: node18,node20,nodenext // @Filename: module.mts export {}; diff --git a/tests/cases/conformance/importAttributes/importAttributes6.ts b/tests/cases/conformance/importAttributes/importAttributes6.ts index 668777621344c..c8f12ae2978c2 100644 --- a/tests/cases/conformance/importAttributes/importAttributes6.ts +++ b/tests/cases/conformance/importAttributes/importAttributes6.ts @@ -1,4 +1,4 @@ -// @module: node18,nodenext +// @module: node18,node20,nodenext // @filename: mod.mts import * as thing1 from "./mod.mjs" with { field: 0 }; import * as thing2 from "./mod.mjs" with { field: `a` }; diff --git a/tests/cases/conformance/moduleResolution/bundler/bundlerDirectoryModule.ts b/tests/cases/conformance/moduleResolution/bundler/bundlerDirectoryModule.ts index bf9dacf9e77c7..f6c500c9ce908 100644 --- a/tests/cases/conformance/moduleResolution/bundler/bundlerDirectoryModule.ts +++ b/tests/cases/conformance/moduleResolution/bundler/bundlerDirectoryModule.ts @@ -1,4 +1,4 @@ -// @module: node18,nodenext +// @module: node18,node20,nodenext // @moduleResolution: nodenext,bundler // @noImplicitAny: true // @noEmit: true diff --git a/tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts b/tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts index 4e3788f8338d9..f0fda5dea822f 100644 --- a/tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts +++ b/tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts index d5834ca8d7da6..06988a9102295 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts index 665c180e48b74..01e4612e33fbe 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @allowJs: true // @noEmit: true // @filename: foo.cjs diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsConditionalPackageExports.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsConditionalPackageExports.ts index 4624489191369..e77562b2c2e0e 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsConditionalPackageExports.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsConditionalPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts index a004f5d596027..bc3c18cf136c1 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportAssignment.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportAssignment.ts index 9d180b21ff55d..73d40a2847a10 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportAssignment.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportAssignment.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportlessJsModuleDetectionAuto.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportlessJsModuleDetectionAuto.ts index 825ec48c1fdc0..079034ff4f271 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportlessJsModuleDetectionAuto.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportlessJsModuleDetectionAuto.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @allowJs: true // @outDir: ./out // @moduleDetection: auto diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsGeneratedNameCollisions.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsGeneratedNameCollisions.ts index 7109501c97ad9..a8e4a8edd6b96 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsGeneratedNameCollisions.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsGeneratedNameCollisions.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportAssignment.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportAssignment.ts index bff55957be3bf..7e16936af2a1d 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportAssignment.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportAssignment.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions1.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions1.ts index ddc1c7aee61b1..8aade6f18e3ce 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions1.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions1.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @importHelpers: true // @allowJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions2.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions2.ts index 352dec8d0d056..54ac2973fb494 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions2.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions2.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @importHelpers: true // @allowJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions3.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions3.ts index c333e89ae2b69..3e802349bb1b8 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions3.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions3.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @target: es5 // @declaration: true // @importHelpers: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportMeta.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportMeta.ts index 6052da8ae6090..ca8f3b1504772 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportMeta.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportMeta.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageExports.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageExports.ts index b0cafc753aa38..e985dbcdacd6e 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageExports.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageImports.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageImports.ts index f7d1e1fbfeb36..50f14b3baf49f 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageImports.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageImports.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts index 8579530d1959d..dfc1251b821af 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsExclude.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsExclude.ts index c6906f952d101..5b43ade349f78 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsExclude.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsExclude.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts index 9fd48761935cb..732006a327f10 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts index 28880b0bb1513..be95fd720be7c 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsTopLevelAwait.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsTopLevelAwait.ts index 85e9dbd027549..4443169375e7e 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsTopLevelAwait.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsTopLevelAwait.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/esmModuleExports1.ts b/tests/cases/conformance/node/esmModuleExports1.ts new file mode 100644 index 0000000000000..e67da41069d0c --- /dev/null +++ b/tests/cases/conformance/node/esmModuleExports1.ts @@ -0,0 +1,23 @@ +// @module: node20 +// @checkJs: true +// @noEmit: true + +// @Filename: /importer-cjs.cjs +const Foo = require("./exporter.mjs"); +new Foo(); + +// @Filename: /importer-cts.cts +import Foo = require("./exporter.mjs"); +new Foo(); + +import Foo2 from "./exporter.mjs"; +new Foo2(); + +import * as Foo3 from "./exporter.mjs"; +new Foo3(); + +import { Oops } from "./exporter.mjs"; + +// @Filename: /exporter.mts +export default class Foo {} +export { Foo as "module.exports" }; \ No newline at end of file diff --git a/tests/cases/conformance/node/esmModuleExports2.ts b/tests/cases/conformance/node/esmModuleExports2.ts new file mode 100644 index 0000000000000..c565d4b6a3b61 --- /dev/null +++ b/tests/cases/conformance/node/esmModuleExports2.ts @@ -0,0 +1,25 @@ +// @module: node20 +// @checkJs: true +// @noEmit: true +// @esModuleInterop: true,false + +// @Filename: /importer-cjs.cjs +const Foo = require("./exporter.mjs"); +new Foo(); + +// @Filename: /importer-cts.cts +import Foo = require("./exporter.mjs"); +new Foo(); + +import Foo2 from "./exporter.mjs"; +new Foo2(); + +import * as Foo3 from "./exporter.mjs"; +new Foo3(); + +import { Oops } from "./exporter.mjs"; + +// @Filename: /exporter.mts +export default class Foo {} +const oops = "oops"; +export { oops as "module.exports" }; \ No newline at end of file diff --git a/tests/cases/conformance/node/esmModuleExports3.ts b/tests/cases/conformance/node/esmModuleExports3.ts new file mode 100644 index 0000000000000..97fdeb3edeeeb --- /dev/null +++ b/tests/cases/conformance/node/esmModuleExports3.ts @@ -0,0 +1,23 @@ +// @module: node20 +// @checkJs: true +// @noEmit: true + +// @Filename: /importer-cjs.cjs +const Foo = require("./exporter.mjs"); +new Foo(); + +// @Filename: /importer-cts.cts +import Foo = require("./exporter.mjs"); +new Foo(); + +import Foo2 from "./exporter.mjs"; +new Foo2(); + +import * as Foo3 from "./exporter.mjs"; +new Foo3(); + +import { Oops } from "./exporter.mjs"; + +// @Filename: /exporter.mts +export default class Foo {} +export type { Foo as "module.exports" } diff --git a/tests/cases/conformance/node/nodeModules1.ts b/tests/cases/conformance/node/nodeModules1.ts index 9f5c7c34cf347..9380c004d7757 100644 --- a/tests/cases/conformance/node/nodeModules1.ts +++ b/tests/cases/conformance/node/nodeModules1.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesCJSEmit1.ts b/tests/cases/conformance/node/nodeModulesCJSEmit1.ts index 0432ec5989454..27387acec29ac 100644 --- a/tests/cases/conformance/node/nodeModulesCJSEmit1.ts +++ b/tests/cases/conformance/node/nodeModulesCJSEmit1.ts @@ -1,4 +1,4 @@ -// @module: node18,nodenext +// @module: node18,node20,nodenext // @checkJs: true // @outDir: dist // @noTypesAndSymbols: true diff --git a/tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts b/tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts index a3383412a6325..03f651a1d8d6f 100644 --- a/tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts +++ b/tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesConditionalPackageExports.ts b/tests/cases/conformance/node/nodeModulesConditionalPackageExports.ts index 1ccd7940cd011..e32b79a286642 100644 --- a/tests/cases/conformance/node/nodeModulesConditionalPackageExports.ts +++ b/tests/cases/conformance/node/nodeModulesConditionalPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: index.ts diff --git a/tests/cases/conformance/node/nodeModulesDeclarationEmitDynamicImportWithPackageExports.ts b/tests/cases/conformance/node/nodeModulesDeclarationEmitDynamicImportWithPackageExports.ts index 7bedbd6b7b24f..3b2182f068b4a 100644 --- a/tests/cases/conformance/node/nodeModulesDeclarationEmitDynamicImportWithPackageExports.ts +++ b/tests/cases/conformance/node/nodeModulesDeclarationEmitDynamicImportWithPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node18,nodenext +// @module: node18,node20,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts b/tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts index b27afe6264f1b..99ab17d9fb0f8 100644 --- a/tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts +++ b/tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: index.ts diff --git a/tests/cases/conformance/node/nodeModulesDynamicImport.ts b/tests/cases/conformance/node/nodeModulesDynamicImport.ts index adb95b880d1d1..a412844562d5e 100644 --- a/tests/cases/conformance/node/nodeModulesDynamicImport.ts +++ b/tests/cases/conformance/node/nodeModulesDynamicImport.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesExportAssignments.ts b/tests/cases/conformance/node/nodeModulesExportAssignments.ts index 89edf8fd865de..7768291ebb2a1 100644 --- a/tests/cases/conformance/node/nodeModulesExportAssignments.ts +++ b/tests/cases/conformance/node/nodeModulesExportAssignments.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesExportsBlocksSpecifierResolution.ts b/tests/cases/conformance/node/nodeModulesExportsBlocksSpecifierResolution.ts index 0872690b12d92..174590e5c638c 100644 --- a/tests/cases/conformance/node/nodeModulesExportsBlocksSpecifierResolution.ts +++ b/tests/cases/conformance/node/nodeModulesExportsBlocksSpecifierResolution.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodeModulesExportsBlocksTypesVersions.ts b/tests/cases/conformance/node/nodeModulesExportsBlocksTypesVersions.ts index ffbf85544cb97..c55ebc4c8e416 100644 --- a/tests/cases/conformance/node/nodeModulesExportsBlocksTypesVersions.ts +++ b/tests/cases/conformance/node/nodeModulesExportsBlocksTypesVersions.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @traceResolution: true // @noImplicitAny: true diff --git a/tests/cases/conformance/node/nodeModulesExportsDoubleAsterisk.ts b/tests/cases/conformance/node/nodeModulesExportsDoubleAsterisk.ts index cd29cab2997cb..9048bc1af2b7d 100644 --- a/tests/cases/conformance/node/nodeModulesExportsDoubleAsterisk.ts +++ b/tests/cases/conformance/node/nodeModulesExportsDoubleAsterisk.ts @@ -1,4 +1,4 @@ -// @module: node18,nodenext +// @module: node18,node20,nodenext // @noTypesAndSymbols: true // @noEmit: true diff --git a/tests/cases/conformance/node/nodeModulesExportsSourceTs.ts b/tests/cases/conformance/node/nodeModulesExportsSourceTs.ts index 085f46664d32a..eb7cafd27ede1 100644 --- a/tests/cases/conformance/node/nodeModulesExportsSourceTs.ts +++ b/tests/cases/conformance/node/nodeModulesExportsSourceTs.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationConditions.ts b/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationConditions.ts index cbf71e6946549..fd8ab6f1eae68 100644 --- a/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationConditions.ts +++ b/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationConditions.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationDirectory.ts b/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationDirectory.ts index 48fde3a47d4a4..eda320d95016f 100644 --- a/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationDirectory.ts +++ b/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationDirectory.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationPattern.ts b/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationPattern.ts index 2c38bb643dcf6..42cec3956bb97 100644 --- a/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationPattern.ts +++ b/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationPattern.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodeModulesForbidenSyntax.ts b/tests/cases/conformance/node/nodeModulesForbidenSyntax.ts index 11c31e1911514..a4031f5c159a4 100644 --- a/tests/cases/conformance/node/nodeModulesForbidenSyntax.ts +++ b/tests/cases/conformance/node/nodeModulesForbidenSyntax.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesGeneratedNameCollisions.ts b/tests/cases/conformance/node/nodeModulesGeneratedNameCollisions.ts index 280cbf6a1034c..8b350f873baf7 100644 --- a/tests/cases/conformance/node/nodeModulesGeneratedNameCollisions.ts +++ b/tests/cases/conformance/node/nodeModulesGeneratedNameCollisions.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesImportAssertions.ts b/tests/cases/conformance/node/nodeModulesImportAssertions.ts index 6a07e4b6fa791..9aca139d1ee5b 100644 --- a/tests/cases/conformance/node/nodeModulesImportAssertions.ts +++ b/tests/cases/conformance/node/nodeModulesImportAssertions.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @resolveJsonModule: true // @filename: index.ts import json from "./package.json" assert { type: "json" }; diff --git a/tests/cases/conformance/node/nodeModulesImportAssignments.ts b/tests/cases/conformance/node/nodeModulesImportAssignments.ts index c1a7755672624..2e702fe5b2a23 100644 --- a/tests/cases/conformance/node/nodeModulesImportAssignments.ts +++ b/tests/cases/conformance/node/nodeModulesImportAssignments.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesImportAttributes.ts b/tests/cases/conformance/node/nodeModulesImportAttributes.ts index df1d41da30f6a..d20555809f3ac 100644 --- a/tests/cases/conformance/node/nodeModulesImportAttributes.ts +++ b/tests/cases/conformance/node/nodeModulesImportAttributes.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @resolveJsonModule: true // @filename: index.ts import json from "./package.json" with { type: "json" }; diff --git a/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts b/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts index c96ff4ec18e1f..dce0925f96492 100644 --- a/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts +++ b/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts b/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts index 2303ab5b990c2..079c0ab42ce20 100644 --- a/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts +++ b/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts b/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts index 7b0936775e3bd..af87fa86251e7 100644 --- a/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts +++ b/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts b/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts index ad94d514c6004..8450a5ddc7218 100644 --- a/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts +++ b/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts b/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts index 62d901221c95b..8829c0fcdfd70 100644 --- a/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts +++ b/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesImportHelpersCollisions.ts b/tests/cases/conformance/node/nodeModulesImportHelpersCollisions.ts index 4ddca84f106fc..101ebb726dea9 100644 --- a/tests/cases/conformance/node/nodeModulesImportHelpersCollisions.ts +++ b/tests/cases/conformance/node/nodeModulesImportHelpersCollisions.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @importHelpers: true // @filename: subfolder/index.ts diff --git a/tests/cases/conformance/node/nodeModulesImportHelpersCollisions2.ts b/tests/cases/conformance/node/nodeModulesImportHelpersCollisions2.ts index 6c962f5f17db8..6697558908257 100644 --- a/tests/cases/conformance/node/nodeModulesImportHelpersCollisions2.ts +++ b/tests/cases/conformance/node/nodeModulesImportHelpersCollisions2.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @importHelpers: true // @filename: subfolder/index.ts diff --git a/tests/cases/conformance/node/nodeModulesImportHelpersCollisions3.ts b/tests/cases/conformance/node/nodeModulesImportHelpersCollisions3.ts index 574a04790c4b6..0e132b8c920aa 100644 --- a/tests/cases/conformance/node/nodeModulesImportHelpersCollisions3.ts +++ b/tests/cases/conformance/node/nodeModulesImportHelpersCollisions3.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @target: es5 // @declaration: true // @importHelpers: true diff --git a/tests/cases/conformance/node/nodeModulesImportMeta.ts b/tests/cases/conformance/node/nodeModulesImportMeta.ts index e7f1e79c2f21d..52da74d0f6751 100644 --- a/tests/cases/conformance/node/nodeModulesImportMeta.ts +++ b/tests/cases/conformance/node/nodeModulesImportMeta.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit1.ts b/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit1.ts index 81a81cc0bcd4e..fde8a01a0569b 100644 --- a/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit1.ts +++ b/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit2.ts b/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit2.ts index 2fbee45ab1d7a..ee809511921c9 100644 --- a/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit2.ts +++ b/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit2.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmitErrors1.ts b/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmitErrors1.ts index 4d4331be3ddc3..399c72d203203 100644 --- a/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmitErrors1.ts +++ b/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmitErrors1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesImportResolutionIntoExport.ts b/tests/cases/conformance/node/nodeModulesImportResolutionIntoExport.ts index f55158f2f827c..674ffc79366e6 100644 --- a/tests/cases/conformance/node/nodeModulesImportResolutionIntoExport.ts +++ b/tests/cases/conformance/node/nodeModulesImportResolutionIntoExport.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodeModulesImportResolutionNoCycle.ts b/tests/cases/conformance/node/nodeModulesImportResolutionNoCycle.ts index 6381ae8ccdb42..f127d37349642 100644 --- a/tests/cases/conformance/node/nodeModulesImportResolutionNoCycle.ts +++ b/tests/cases/conformance/node/nodeModulesImportResolutionNoCycle.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmit1.ts b/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmit1.ts index b79826e7400ed..40e47a0f51bbd 100644 --- a/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmit1.ts +++ b/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmit1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmitErrors1.ts b/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmitErrors1.ts index e8266d8eb1e0b..455cc038bd691 100644 --- a/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmitErrors1.ts +++ b/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmitErrors1.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesJson.ts b/tests/cases/conformance/node/nodeModulesJson.ts index a3b8c44d38f09..2ed2469142268 100644 --- a/tests/cases/conformance/node/nodeModulesJson.ts +++ b/tests/cases/conformance/node/nodeModulesJson.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @resolveJsonModule: true // @noEmit: true diff --git a/tests/cases/conformance/node/nodeModulesPackageExports.ts b/tests/cases/conformance/node/nodeModulesPackageExports.ts index 32f28261195a5..ca0a23fc20d7c 100644 --- a/tests/cases/conformance/node/nodeModulesPackageExports.ts +++ b/tests/cases/conformance/node/nodeModulesPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: index.ts diff --git a/tests/cases/conformance/node/nodeModulesPackageImports.ts b/tests/cases/conformance/node/nodeModulesPackageImports.ts index 4e0e34587aa35..d307d23f096ad 100644 --- a/tests/cases/conformance/node/nodeModulesPackageImports.ts +++ b/tests/cases/conformance/node/nodeModulesPackageImports.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: index.ts // @traceResolution: true diff --git a/tests/cases/conformance/node/nodeModulesPackagePatternExports.ts b/tests/cases/conformance/node/nodeModulesPackagePatternExports.ts index 66cc8dcb5076a..2fcbdb11a07bc 100644 --- a/tests/cases/conformance/node/nodeModulesPackagePatternExports.ts +++ b/tests/cases/conformance/node/nodeModulesPackagePatternExports.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: index.ts diff --git a/tests/cases/conformance/node/nodeModulesPackagePatternExportsExclude.ts b/tests/cases/conformance/node/nodeModulesPackagePatternExportsExclude.ts index 0704894872974..871dd8ea07a5f 100644 --- a/tests/cases/conformance/node/nodeModulesPackagePatternExportsExclude.ts +++ b/tests/cases/conformance/node/nodeModulesPackagePatternExportsExclude.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: index.ts diff --git a/tests/cases/conformance/node/nodeModulesPackagePatternExportsTrailers.ts b/tests/cases/conformance/node/nodeModulesPackagePatternExportsTrailers.ts index e367cc8e25d96..8981b42881fbe 100644 --- a/tests/cases/conformance/node/nodeModulesPackagePatternExportsTrailers.ts +++ b/tests/cases/conformance/node/nodeModulesPackagePatternExportsTrailers.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: index.ts diff --git a/tests/cases/conformance/node/nodeModulesResolveJsonModule.ts b/tests/cases/conformance/node/nodeModulesResolveJsonModule.ts index 566b36a8be0a6..ebf4943bfd97a 100644 --- a/tests/cases/conformance/node/nodeModulesResolveJsonModule.ts +++ b/tests/cases/conformance/node/nodeModulesResolveJsonModule.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @resolveJsonModule: true // @outDir: ./out // @declaration: true diff --git a/tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts b/tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts index 5894ec9fa5993..a9a6366da2177 100644 --- a/tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts +++ b/tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesTopLevelAwait.ts b/tests/cases/conformance/node/nodeModulesTopLevelAwait.ts index 1e408948ca25d..fd796367e694a 100644 --- a/tests/cases/conformance/node/nodeModulesTopLevelAwait.ts +++ b/tests/cases/conformance/node/nodeModulesTopLevelAwait.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit1.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit1.ts index 720b542cdf57c..f2006002aa8a3 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit1.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit2.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit2.ts index 26fb155089585..4f121400e2d35 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit2.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit2.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit3.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit3.ts index e495af61693e2..24590a8e6f0c0 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit3.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit3.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit4.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit4.ts index 206b8ac8971b2..3edf6054900b7 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit4.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit4.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit5.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit5.ts index 146966b663e8f..717665bf51288 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit5.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit5.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit6.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit6.ts index a7bfaee6077cc..0db5f88943134 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit6.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit6.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit7.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit7.ts index 9021d10b2cf46..2db3fd9241a8e 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit7.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit7.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride1.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride1.ts index 06176bf7496e0..05f0b599c56e7 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride1.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @outDir: out // @filename: /node_modules/pkg/package.json { diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride2.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride2.ts index 638148fccaf2e..137b91399dedb 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride2.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride2.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @outDir: out // @filename: /node_modules/pkg/package.json { diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts index 07c712e255ada..0c05f1d7eae1f 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @outDir: out // @filename: /node_modules/pkg/package.json { diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride4.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride4.ts index d7b0d88c26dab..0df6662f84785 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride4.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride4.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @outDir: out // @filename: /node_modules/pkg/package.json { diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride5.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride5.ts index 993f10822bd21..d29de3ac413bd 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride5.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride5.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @outDir: out // @filename: /node_modules/pkg/package.json { diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverrideModeError.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverrideModeError.ts index 87a671e2e11ae..0a461a082ce6f 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverrideModeError.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverrideModeError.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @outDir: out // @filename: /node_modules/pkg/package.json { diff --git a/tests/cases/conformance/node/nodeModulesTypesVersionPackageExports.ts b/tests/cases/conformance/node/nodeModulesTypesVersionPackageExports.ts index f562c69ba0681..30d73f89d564e 100644 --- a/tests/cases/conformance/node/nodeModulesTypesVersionPackageExports.ts +++ b/tests/cases/conformance/node/nodeModulesTypesVersionPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @outDir: out // @filename: index.ts diff --git a/tests/cases/conformance/node/nodePackageSelfName.ts b/tests/cases/conformance/node/nodePackageSelfName.ts index 344f1eef2dc2f..2d70c85f393b2 100644 --- a/tests/cases/conformance/node/nodePackageSelfName.ts +++ b/tests/cases/conformance/node/nodePackageSelfName.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodePackageSelfNameScoped.ts b/tests/cases/conformance/node/nodePackageSelfNameScoped.ts index 4a9e534e2ef31..08e0cef7696b1 100644 --- a/tests/cases/conformance/node/nodePackageSelfNameScoped.ts +++ b/tests/cases/conformance/node/nodePackageSelfNameScoped.ts @@ -1,4 +1,4 @@ -// @module: node16,node18,nodenext +// @module: node16,node18,node20,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/nonjsExtensions/declarationFileForTsJsImport.ts b/tests/cases/conformance/nonjsExtensions/declarationFileForTsJsImport.ts index b0705952ca05d..44ef8a6746012 100644 --- a/tests/cases/conformance/nonjsExtensions/declarationFileForTsJsImport.ts +++ b/tests/cases/conformance/nonjsExtensions/declarationFileForTsJsImport.ts @@ -1,5 +1,5 @@ // @allowArbitraryExtensions: true -// @module: node18,nodenext +// @module: node18,node20,nodenext // @filename: package.json {"type": "module"} // @filename: main.ts diff --git a/tests/cases/conformance/nonjsExtensions/declarationFilesForNodeNativeModules.ts b/tests/cases/conformance/nonjsExtensions/declarationFilesForNodeNativeModules.ts index f9bc0e63aa89c..76094449a9cb1 100644 --- a/tests/cases/conformance/nonjsExtensions/declarationFilesForNodeNativeModules.ts +++ b/tests/cases/conformance/nonjsExtensions/declarationFilesForNodeNativeModules.ts @@ -1,7 +1,7 @@ // @lib: es2020,dom // @target: es2020 // @allowArbitraryExtensions: true,false -// @module: node18,nodenext +// @module: node18,node20,nodenext // @filename: package.json {"type": "module"} // @filename: dir/package.json diff --git a/tests/cases/fourslash/server/rewriteRelativeImportExtensionsProjectReferences1.ts b/tests/cases/fourslash/server/rewriteRelativeImportExtensionsProjectReferences1.ts index 78a1ca85cea9d..2b0190c97e9d8 100644 --- a/tests/cases/fourslash/server/rewriteRelativeImportExtensionsProjectReferences1.ts +++ b/tests/cases/fourslash/server/rewriteRelativeImportExtensionsProjectReferences1.ts @@ -7,6 +7,7 @@ //// "rootDir": "src", //// "outDir": "dist", //// "module": "nodenext", +//// "resolveJsonModule": false, //// } //// } @@ -33,6 +34,7 @@ //// "rewriteRelativeImportExtensions": true, //// "rootDir": "src", //// "outDir": "dist", +//// "resolveJsonModule": false, //// }, //// "references": [ //// { "path": "../common" }