From ee0e08bd96bdde7450337afe141e53018cfc89e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 11:40:24 -0800 Subject: [PATCH 01/46] Bump the github-actions group across 1 directory with 2 updates (#60581) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/codeql.yml | 6 +++--- .github/workflows/scorecard.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b30351dc24db6..ac26e687fd0ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,7 @@ jobs: name: coverage path: coverage - - uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 + - uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7 with: use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }} disable_search: true diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 249d7f87cbfbb..9725306635461 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -46,7 +46,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 + uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 with: config-file: ./.github/codeql/codeql-configuration.yml # Override language selection by uncommenting this and choosing your languages @@ -56,7 +56,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below). - name: Autobuild - uses: github/codeql-action/autobuild@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 + uses: github/codeql-action/autobuild@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -70,4 +70,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 + uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 942edbd7bbd4a..5e5ffeb2de92b 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -55,6 +55,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: 'Upload to code-scanning' - uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 + uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 with: sarif_file: results.sarif From 96410eb65516fd681f75ea595a68fe0ea908dfe2 Mon Sep 17 00:00:00 2001 From: Isabel Duan Date: Tue, 26 Nov 2024 13:24:44 -0800 Subject: [PATCH 02/46] fix missing react error with fragments in `react-native` (#60615) --- src/compiler/checker.ts | 24 ++++++++++++++++--- ...xFragReactReferenceErrors(jsx=preserve).js | 18 ++++++++++++++ ...ReactReferenceErrors(jsx=preserve).symbols | 11 +++++++++ ...agReactReferenceErrors(jsx=preserve).types | 15 ++++++++++++ ...gReactReferenceErrors(jsx=react-native).js | 18 ++++++++++++++ ...tReferenceErrors(jsx=react-native).symbols | 11 +++++++++ ...actReferenceErrors(jsx=react-native).types | 15 ++++++++++++ .../compiler/jsxFragReactReferenceErrors.tsx | 14 +++++++++++ 8 files changed, 123 insertions(+), 3 deletions(-) create mode 100644 tests/baselines/reference/jsxFragReactReferenceErrors(jsx=preserve).js create mode 100644 tests/baselines/reference/jsxFragReactReferenceErrors(jsx=preserve).symbols create mode 100644 tests/baselines/reference/jsxFragReactReferenceErrors(jsx=preserve).types create mode 100644 tests/baselines/reference/jsxFragReactReferenceErrors(jsx=react-native).js create mode 100644 tests/baselines/reference/jsxFragReactReferenceErrors(jsx=react-native).symbols create mode 100644 tests/baselines/reference/jsxFragReactReferenceErrors(jsx=react-native).types create mode 100644 tests/cases/compiler/jsxFragReactReferenceErrors.tsx diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3d044fa5bf0f4..902b64c847ace 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -30018,7 +30018,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // #38720/60122, allow null as jsxFragmentFactory let jsxFactorySym: Symbol | undefined; if (!(isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { - jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, compilerOptions.jsx === JsxEmit.Preserve ? SymbolFlags.Value & ~SymbolFlags.Enum : SymbolFlags.Value, jsxFactoryRefErr, /*isUse*/ true); + jsxFactorySym = resolveName( + jsxFactoryLocation, + jsxFactoryNamespace, + (compilerOptions.jsx === JsxEmit.Preserve || compilerOptions.jsx === JsxEmit.ReactNative) ? SymbolFlags.Value & ~SymbolFlags.Enum : SymbolFlags.Value, + jsxFactoryRefErr, + /*isUse*/ true, + ); } if (jsxFactorySym) { @@ -30037,7 +30043,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const file = getSourceFileOfNode(node); const localJsxNamespace = getLocalJsxNamespace(file); if (localJsxNamespace) { - resolveName(jsxFactoryLocation, localJsxNamespace, compilerOptions.jsx === JsxEmit.Preserve ? SymbolFlags.Value & ~SymbolFlags.Enum : SymbolFlags.Value, jsxFactoryRefErr, /*isUse*/ true); + resolveName( + jsxFactoryLocation, + localJsxNamespace, + (compilerOptions.jsx === JsxEmit.Preserve || compilerOptions.jsx === JsxEmit.ReactNative) ? SymbolFlags.Value & ~SymbolFlags.Enum : SymbolFlags.Value, + jsxFactoryRefErr, + /*isUse*/ true, + ); } } } @@ -36825,7 +36837,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const jsxFactoryRefErr = diagnostics ? Diagnostics.Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found : undefined; const jsxFactorySymbol = getJsxNamespaceContainerForImplicitImport(node) ?? - resolveName(node, jsxFragmentFactoryName, compilerOptions.jsx === JsxEmit.Preserve ? SymbolFlags.Value & ~SymbolFlags.Enum : SymbolFlags.Value, /*nameNotFoundMessage*/ jsxFactoryRefErr, /*isUse*/ true); + resolveName( + node, + jsxFragmentFactoryName, + (compilerOptions.jsx === JsxEmit.Preserve || compilerOptions.jsx === JsxEmit.ReactNative) ? SymbolFlags.Value & ~SymbolFlags.Enum : SymbolFlags.Value, + /*nameNotFoundMessage*/ jsxFactoryRefErr, + /*isUse*/ true, + ); if (jsxFactorySymbol === undefined) return sourceFileLinks.jsxFragmentType = errorType; if (jsxFactorySymbol.escapedName === ReactNames.Fragment) return sourceFileLinks.jsxFragmentType = getTypeOfSymbol(jsxFactorySymbol); diff --git a/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=preserve).js b/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=preserve).js new file mode 100644 index 0000000000000..29e499dbf98ea --- /dev/null +++ b/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=preserve).js @@ -0,0 +1,18 @@ +//// [tests/cases/compiler/jsxFragReactReferenceErrors.tsx] //// + +//// [jsxFragReactReferenceErrors.tsx] +/// +/// +export function Component(){ + +return <> + +} + +//// [jsxFragReactReferenceErrors.jsx] +/// +/// +export function Component() { + return <> + ; +} diff --git a/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=preserve).symbols b/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=preserve).symbols new file mode 100644 index 0000000000000..df63a975364b0 --- /dev/null +++ b/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=preserve).symbols @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/jsxFragReactReferenceErrors.tsx] //// + +=== jsxFragReactReferenceErrors.tsx === +/// +/// +export function Component(){ +>Component : Symbol(Component, Decl(jsxFragReactReferenceErrors.tsx, 0, 0)) + +return <> + +} diff --git a/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=preserve).types b/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=preserve).types new file mode 100644 index 0000000000000..64a3cab0824cf --- /dev/null +++ b/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=preserve).types @@ -0,0 +1,15 @@ +//// [tests/cases/compiler/jsxFragReactReferenceErrors.tsx] //// + +=== jsxFragReactReferenceErrors.tsx === +/// +/// +export function Component(){ +>Component : () => JSX.Element +> : ^^^^^^^^^^^^^^^^^ + +return <> +><> : JSX.Element +> : ^^^^^^^^^^^ + + +} diff --git a/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=react-native).js b/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=react-native).js new file mode 100644 index 0000000000000..9ccb21875c4e4 --- /dev/null +++ b/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=react-native).js @@ -0,0 +1,18 @@ +//// [tests/cases/compiler/jsxFragReactReferenceErrors.tsx] //// + +//// [jsxFragReactReferenceErrors.tsx] +/// +/// +export function Component(){ + +return <> + +} + +//// [jsxFragReactReferenceErrors.js] +/// +/// +export function Component() { + return <> + ; +} diff --git a/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=react-native).symbols b/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=react-native).symbols new file mode 100644 index 0000000000000..df63a975364b0 --- /dev/null +++ b/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=react-native).symbols @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/jsxFragReactReferenceErrors.tsx] //// + +=== jsxFragReactReferenceErrors.tsx === +/// +/// +export function Component(){ +>Component : Symbol(Component, Decl(jsxFragReactReferenceErrors.tsx, 0, 0)) + +return <> + +} diff --git a/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=react-native).types b/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=react-native).types new file mode 100644 index 0000000000000..64a3cab0824cf --- /dev/null +++ b/tests/baselines/reference/jsxFragReactReferenceErrors(jsx=react-native).types @@ -0,0 +1,15 @@ +//// [tests/cases/compiler/jsxFragReactReferenceErrors.tsx] //// + +=== jsxFragReactReferenceErrors.tsx === +/// +/// +export function Component(){ +>Component : () => JSX.Element +> : ^^^^^^^^^^^^^^^^^ + +return <> +><> : JSX.Element +> : ^^^^^^^^^^^ + + +} diff --git a/tests/cases/compiler/jsxFragReactReferenceErrors.tsx b/tests/cases/compiler/jsxFragReactReferenceErrors.tsx new file mode 100644 index 0000000000000..92f4725d51bc3 --- /dev/null +++ b/tests/cases/compiler/jsxFragReactReferenceErrors.tsx @@ -0,0 +1,14 @@ +// @jsx: react-native, preserve +// @strict: true +// @skipLibCheck: true +// @target: ES2017 +// @module: ESNext +// @esModuleInterop: true + +/// +/// +export function Component(){ + +return <> + +} \ No newline at end of file From 9fe6c3661cd89952d9556ecb14ef366b44076064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Wed, 27 Nov 2024 00:17:29 +0100 Subject: [PATCH 03/46] Fixed syntactic nullisness semantics for tagged template expressions (#60616) --- src/compiler/checker.ts | 1 + .../reference/predicateSemantics.errors.txt | 19 +++++++- .../baselines/reference/predicateSemantics.js | 20 +++++++- .../reference/predicateSemantics.symbols | 21 +++++++++ .../reference/predicateSemantics.types | 47 +++++++++++++++++++ tests/cases/compiler/predicateSemantics.ts | 11 +++++ 6 files changed, 117 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 902b64c847ace..ed4cd7b03f75a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -39927,6 +39927,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { switch (node.kind) { case SyntaxKind.AwaitExpression: case SyntaxKind.CallExpression: + case SyntaxKind.TaggedTemplateExpression: case SyntaxKind.ElementAccessExpression: case SyntaxKind.MetaProperty: case SyntaxKind.NewExpression: diff --git a/tests/baselines/reference/predicateSemantics.errors.txt b/tests/baselines/reference/predicateSemantics.errors.txt index 0dc25d43dbf2b..c80dd47d19357 100644 --- a/tests/baselines/reference/predicateSemantics.errors.txt +++ b/tests/baselines/reference/predicateSemantics.errors.txt @@ -12,9 +12,11 @@ predicateSemantics.ts(36,8): error TS2872: This kind of expression is always tru predicateSemantics.ts(51,14): error TS2869: Right operand of ?? is unreachable because the left operand is never nullish. predicateSemantics.ts(52,14): error TS2695: Left side of comma operator is unused and has no side effects. predicateSemantics.ts(52,14): error TS2869: Right operand of ?? is unreachable because the left operand is never nullish. +predicateSemantics.ts(70,1): error TS2869: Right operand of ?? is unreachable because the left operand is never nullish. +predicateSemantics.ts(71,1): error TS2869: Right operand of ?? is unreachable because the left operand is never nullish. -==== predicateSemantics.ts (14 errors) ==== +==== predicateSemantics.ts (16 errors) ==== declare let cond: any; // OK: One or other operand is possibly nullish @@ -103,4 +105,19 @@ predicateSemantics.ts(52,14): error TS2869: Right operand of ?? is unreachable b const p = new.target ?? 32; } } + + // https://github.com/microsoft/TypeScript/issues/60614 + declare function tag( + strings: TemplateStringsArray, + ...values: number[] + ): T | null; + + tag`foo${1}` ?? 32; // ok + + `foo${1}` ?? 32; // error + ~~~~~~~~~ +!!! error TS2869: Right operand of ?? is unreachable because the left operand is never nullish. + `foo` ?? 32; // error + ~~~~~ +!!! error TS2869: Right operand of ?? is unreachable because the left operand is never nullish. \ No newline at end of file diff --git a/tests/baselines/reference/predicateSemantics.js b/tests/baselines/reference/predicateSemantics.js index f4edc198ffecd..30ada0d514d02 100644 --- a/tests/baselines/reference/predicateSemantics.js +++ b/tests/baselines/reference/predicateSemantics.js @@ -61,10 +61,25 @@ class X { const p = new.target ?? 32; } } + +// https://github.com/microsoft/TypeScript/issues/60614 +declare function tag( + strings: TemplateStringsArray, + ...values: number[] +): T | null; + +tag`foo${1}` ?? 32; // ok + +`foo${1}` ?? 32; // error +`foo` ?? 32; // error //// [predicateSemantics.js] -var _a, _b, _c, _d, _e, _f, _g, _h, _j; +var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; // OK: One or other operand is possibly nullish var test1 = (_a = (cond ? undefined : 32)) !== null && _a !== void 0 ? _a : "possibly reached"; // Not OK: Both operands nullish @@ -122,3 +137,6 @@ var X = /** @class */ (function () { } return X; }()); +(_k = tag(__makeTemplateObject(["foo", ""], ["foo", ""]), 1)) !== null && _k !== void 0 ? _k : 32; // ok +(_l = "foo".concat(1)) !== null && _l !== void 0 ? _l : 32; // error +"foo" !== null && "foo" !== void 0 ? "foo" : 32; // error diff --git a/tests/baselines/reference/predicateSemantics.symbols b/tests/baselines/reference/predicateSemantics.symbols index e5c831515a0bc..f8ddf0fe5db87 100644 --- a/tests/baselines/reference/predicateSemantics.symbols +++ b/tests/baselines/reference/predicateSemantics.symbols @@ -116,3 +116,24 @@ class X { } } +// https://github.com/microsoft/TypeScript/issues/60614 +declare function tag( +>tag : Symbol(tag, Decl(predicateSemantics.ts, 59, 1)) +>T : Symbol(T, Decl(predicateSemantics.ts, 62, 21)) + + strings: TemplateStringsArray, +>strings : Symbol(strings, Decl(predicateSemantics.ts, 62, 24)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) + + ...values: number[] +>values : Symbol(values, Decl(predicateSemantics.ts, 63, 32)) + +): T | null; +>T : Symbol(T, Decl(predicateSemantics.ts, 62, 21)) + +tag`foo${1}` ?? 32; // ok +>tag : Symbol(tag, Decl(predicateSemantics.ts, 59, 1)) + +`foo${1}` ?? 32; // error +`foo` ?? 32; // error + diff --git a/tests/baselines/reference/predicateSemantics.types b/tests/baselines/reference/predicateSemantics.types index de0c9daf76eb0..b054c66ad43e7 100644 --- a/tests/baselines/reference/predicateSemantics.types +++ b/tests/baselines/reference/predicateSemantics.types @@ -328,3 +328,50 @@ class X { } } +// https://github.com/microsoft/TypeScript/issues/60614 +declare function tag( +>tag : (strings: TemplateStringsArray, ...values: number[]) => T | null +> : ^ ^^ ^^ ^^^^^ ^^ ^^^^^ + + strings: TemplateStringsArray, +>strings : TemplateStringsArray +> : ^^^^^^^^^^^^^^^^^^^^ + + ...values: number[] +>values : number[] +> : ^^^^^^^^ + +): T | null; + +tag`foo${1}` ?? 32; // ok +>tag`foo${1}` ?? 32 : unknown +> : ^^^^^^^ +>tag`foo${1}` : unknown +> : ^^^^^^^ +>tag : (strings: TemplateStringsArray, ...values: number[]) => T | null +> : ^ ^^ ^^ ^^^^^ ^^ ^^^^^ +>`foo${1}` : string +> : ^^^^^^ +>1 : 1 +> : ^ +>32 : 32 +> : ^^ + +`foo${1}` ?? 32; // error +>`foo${1}` ?? 32 : 32 | "foo1" +> : ^^^^^^^^^^^ +>`foo${1}` : "foo1" +> : ^^^^^^ +>1 : 1 +> : ^ +>32 : 32 +> : ^^ + +`foo` ?? 32; // error +>`foo` ?? 32 : 32 | "foo" +> : ^^^^^^^^^^ +>`foo` : "foo" +> : ^^^^^ +>32 : 32 +> : ^^ + diff --git a/tests/cases/compiler/predicateSemantics.ts b/tests/cases/compiler/predicateSemantics.ts index e937b1d6182a8..a22b34341e7d5 100644 --- a/tests/cases/compiler/predicateSemantics.ts +++ b/tests/cases/compiler/predicateSemantics.ts @@ -58,3 +58,14 @@ class X { const p = new.target ?? 32; } } + +// https://github.com/microsoft/TypeScript/issues/60614 +declare function tag( + strings: TemplateStringsArray, + ...values: number[] +): T | null; + +tag`foo${1}` ?? 32; // ok + +`foo${1}` ?? 32; // error +`foo` ?? 32; // error From b263cc4b2ef12ae013526a3d8808b6716146586a Mon Sep 17 00:00:00 2001 From: Psychpsyo <60073468+Psychpsyo@users.noreply.github.com> Date: Thu, 28 Nov 2024 00:12:20 +0100 Subject: [PATCH 04/46] Improve the definition of atan2() (#60493) --- src/lib/es5.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index ab484e1812e7b..963f6ad24f1a7 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -678,7 +678,7 @@ interface Math { */ atan(x: number): number; /** - * Returns the angle (in radians) from the X axis to a point. + * Returns the angle (in radians) between the X axis and the line going through both the origin and the given point. * @param y A numeric expression representing the cartesian y-coordinate. * @param x A numeric expression representing the cartesian x-coordinate. */ From 97177722b8facb30c3f27e124931257ae80b863d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Mon, 2 Dec 2024 20:15:47 +0100 Subject: [PATCH 05/46] Allow assignments to readonly class properties within IIFEs contained in constructors (#60416) --- src/compiler/checker.ts | 2 +- .../reference/readonlyMembers.errors.txt | 30 ++-- tests/baselines/reference/readonlyMembers.js | 12 +- .../reference/readonlyMembers.symbols | 146 ++++++++++-------- .../baselines/reference/readonlyMembers.types | 48 +++++- tests/cases/compiler/readonlyMembers.ts | 7 +- 6 files changed, 166 insertions(+), 79 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ed4cd7b03f75a..3d3f908d82c79 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -39082,7 +39082,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { expr.expression.kind === SyntaxKind.ThisKeyword ) { // Look for if this is the constructor for the class that `symbol` is a property of. - const ctor = getContainingFunction(expr); + const ctor = getControlFlowContainer(expr); if (!(ctor && (ctor.kind === SyntaxKind.Constructor || isJSConstructor(ctor)))) { return true; } diff --git a/tests/baselines/reference/readonlyMembers.errors.txt b/tests/baselines/reference/readonlyMembers.errors.txt index 565b38257733d..c3ac0ac353e01 100644 --- a/tests/baselines/reference/readonlyMembers.errors.txt +++ b/tests/baselines/reference/readonlyMembers.errors.txt @@ -4,18 +4,19 @@ readonlyMembers.ts(16,14): error TS2540: Cannot assign to 'c' because it is a re readonlyMembers.ts(18,18): error TS2540: Cannot assign to 'a' because it is a read-only property. readonlyMembers.ts(19,18): error TS2540: Cannot assign to 'b' because it is a read-only property. readonlyMembers.ts(20,18): error TS2540: Cannot assign to 'c' because it is a read-only property. -readonlyMembers.ts(24,14): error TS2540: Cannot assign to 'a' because it is a read-only property. -readonlyMembers.ts(25,14): error TS2540: Cannot assign to 'b' because it is a read-only property. -readonlyMembers.ts(26,14): error TS2540: Cannot assign to 'c' because it is a read-only property. -readonlyMembers.ts(35,3): error TS2540: Cannot assign to 'a' because it is a read-only property. -readonlyMembers.ts(39,3): error TS2540: Cannot assign to 'a' because it is a read-only property. -readonlyMembers.ts(48,3): error TS2540: Cannot assign to 'A' because it is a read-only property. -readonlyMembers.ts(55,3): error TS2540: Cannot assign to 'a' because it is a read-only property. -readonlyMembers.ts(61,1): error TS2542: Index signature in type '{ readonly [x: string]: string; }' only permits reading. -readonlyMembers.ts(64,1): error TS2542: Index signature in type '{ readonly [x: number]: string; [x: string]: string; }' only permits reading. +readonlyMembers.ts(25,18): error TS2540: Cannot assign to 'c' because it is a read-only property. +readonlyMembers.ts(29,14): error TS2540: Cannot assign to 'a' because it is a read-only property. +readonlyMembers.ts(30,14): error TS2540: Cannot assign to 'b' because it is a read-only property. +readonlyMembers.ts(31,14): error TS2540: Cannot assign to 'c' because it is a read-only property. +readonlyMembers.ts(40,3): error TS2540: Cannot assign to 'a' because it is a read-only property. +readonlyMembers.ts(44,3): error TS2540: Cannot assign to 'a' because it is a read-only property. +readonlyMembers.ts(53,3): error TS2540: Cannot assign to 'A' because it is a read-only property. +readonlyMembers.ts(60,3): error TS2540: Cannot assign to 'a' because it is a read-only property. +readonlyMembers.ts(66,1): error TS2542: Index signature in type '{ readonly [x: string]: string; }' only permits reading. +readonlyMembers.ts(69,1): error TS2542: Index signature in type '{ readonly [x: number]: string; [x: string]: string; }' only permits reading. -==== readonlyMembers.ts (15 errors) ==== +==== readonlyMembers.ts (16 errors) ==== interface X { readonly a: number; readonly b?: number; @@ -48,7 +49,14 @@ readonlyMembers.ts(64,1): error TS2542: Index signature in type '{ readonly [x: this.c = 1; // Error ~ !!! error TS2540: Cannot assign to 'c' because it is a read-only property. - } + }; + (() => { + this.a = 1; // Ok + this.b = 1; // Ok + this.c = 1; // Error + ~ +!!! error TS2540: Cannot assign to 'c' because it is a read-only property. + })(); } foo() { this.a = 1; // Error diff --git a/tests/baselines/reference/readonlyMembers.js b/tests/baselines/reference/readonlyMembers.js index 7a3cb40d69a57..d17cc430b7e35 100644 --- a/tests/baselines/reference/readonlyMembers.js +++ b/tests/baselines/reference/readonlyMembers.js @@ -21,7 +21,12 @@ class C { this.a = 1; // Error this.b = 1; // Error this.c = 1; // Error - } + }; + (() => { + this.a = 1; // Ok + this.b = 1; // Ok + this.c = 1; // Error + })(); } foo() { this.a = 1; // Error @@ -83,6 +88,11 @@ var C = /** @class */ (function () { _this.b = 1; // Error _this.c = 1; // Error }; + (function () { + _this.a = 1; // Ok + _this.b = 1; // Ok + _this.c = 1; // Error + })(); } Object.defineProperty(C.prototype, "c", { get: function () { return 1; }, diff --git a/tests/baselines/reference/readonlyMembers.symbols b/tests/baselines/reference/readonlyMembers.symbols index a62200bc2928e..a7e051096527e 100644 --- a/tests/baselines/reference/readonlyMembers.symbols +++ b/tests/baselines/reference/readonlyMembers.symbols @@ -70,10 +70,28 @@ class C { >this.c : Symbol(C.c, Decl(readonlyMembers.ts, 10, 19)) >this : Symbol(C, Decl(readonlyMembers.ts, 6, 8)) >c : Symbol(C.c, Decl(readonlyMembers.ts, 10, 19)) - } + + }; + (() => { + this.a = 1; // Ok +>this.a : Symbol(C.a, Decl(readonlyMembers.ts, 8, 9)) +>this : Symbol(C, Decl(readonlyMembers.ts, 6, 8)) +>a : Symbol(C.a, Decl(readonlyMembers.ts, 8, 9)) + + this.b = 1; // Ok +>this.b : Symbol(C.b, Decl(readonlyMembers.ts, 9, 23)) +>this : Symbol(C, Decl(readonlyMembers.ts, 6, 8)) +>b : Symbol(C.b, Decl(readonlyMembers.ts, 9, 23)) + + this.c = 1; // Error +>this.c : Symbol(C.c, Decl(readonlyMembers.ts, 10, 19)) +>this : Symbol(C, Decl(readonlyMembers.ts, 6, 8)) +>c : Symbol(C.c, Decl(readonlyMembers.ts, 10, 19)) + + })(); } foo() { ->foo : Symbol(C.foo, Decl(readonlyMembers.ts, 21, 5)) +>foo : Symbol(C.foo, Decl(readonlyMembers.ts, 26, 5)) this.a = 1; // Error >this.a : Symbol(C.a, Decl(readonlyMembers.ts, 8, 9)) @@ -93,121 +111,121 @@ class C { } var o = { ->o : Symbol(o, Decl(readonlyMembers.ts, 29, 3)) +>o : Symbol(o, Decl(readonlyMembers.ts, 34, 3)) get a() { return 1 }, ->a : Symbol(a, Decl(readonlyMembers.ts, 29, 9)) +>a : Symbol(a, Decl(readonlyMembers.ts, 34, 9)) get b() { return 1 }, ->b : Symbol(b, Decl(readonlyMembers.ts, 30, 25), Decl(readonlyMembers.ts, 31, 25)) +>b : Symbol(b, Decl(readonlyMembers.ts, 35, 25), Decl(readonlyMembers.ts, 36, 25)) set b(value) { } ->b : Symbol(b, Decl(readonlyMembers.ts, 30, 25), Decl(readonlyMembers.ts, 31, 25)) ->value : Symbol(value, Decl(readonlyMembers.ts, 32, 10)) +>b : Symbol(b, Decl(readonlyMembers.ts, 35, 25), Decl(readonlyMembers.ts, 36, 25)) +>value : Symbol(value, Decl(readonlyMembers.ts, 37, 10)) }; o.a = 1; // Error ->o.a : Symbol(a, Decl(readonlyMembers.ts, 29, 9)) ->o : Symbol(o, Decl(readonlyMembers.ts, 29, 3)) ->a : Symbol(a, Decl(readonlyMembers.ts, 29, 9)) +>o.a : Symbol(a, Decl(readonlyMembers.ts, 34, 9)) +>o : Symbol(o, Decl(readonlyMembers.ts, 34, 3)) +>a : Symbol(a, Decl(readonlyMembers.ts, 34, 9)) o.b = 1; ->o.b : Symbol(b, Decl(readonlyMembers.ts, 30, 25), Decl(readonlyMembers.ts, 31, 25)) ->o : Symbol(o, Decl(readonlyMembers.ts, 29, 3)) ->b : Symbol(b, Decl(readonlyMembers.ts, 30, 25), Decl(readonlyMembers.ts, 31, 25)) +>o.b : Symbol(b, Decl(readonlyMembers.ts, 35, 25), Decl(readonlyMembers.ts, 36, 25)) +>o : Symbol(o, Decl(readonlyMembers.ts, 34, 3)) +>b : Symbol(b, Decl(readonlyMembers.ts, 35, 25), Decl(readonlyMembers.ts, 36, 25)) var p: { readonly a: number, b: number } = { a: 1, b: 1 }; ->p : Symbol(p, Decl(readonlyMembers.ts, 37, 3)) ->a : Symbol(a, Decl(readonlyMembers.ts, 37, 8)) ->b : Symbol(b, Decl(readonlyMembers.ts, 37, 28)) ->a : Symbol(a, Decl(readonlyMembers.ts, 37, 44)) ->b : Symbol(b, Decl(readonlyMembers.ts, 37, 50)) +>p : Symbol(p, Decl(readonlyMembers.ts, 42, 3)) +>a : Symbol(a, Decl(readonlyMembers.ts, 42, 8)) +>b : Symbol(b, Decl(readonlyMembers.ts, 42, 28)) +>a : Symbol(a, Decl(readonlyMembers.ts, 42, 44)) +>b : Symbol(b, Decl(readonlyMembers.ts, 42, 50)) p.a = 1; // Error ->p.a : Symbol(a, Decl(readonlyMembers.ts, 37, 8)) ->p : Symbol(p, Decl(readonlyMembers.ts, 37, 3)) ->a : Symbol(a, Decl(readonlyMembers.ts, 37, 8)) +>p.a : Symbol(a, Decl(readonlyMembers.ts, 42, 8)) +>p : Symbol(p, Decl(readonlyMembers.ts, 42, 3)) +>a : Symbol(a, Decl(readonlyMembers.ts, 42, 8)) p.b = 1; ->p.b : Symbol(b, Decl(readonlyMembers.ts, 37, 28)) ->p : Symbol(p, Decl(readonlyMembers.ts, 37, 3)) ->b : Symbol(b, Decl(readonlyMembers.ts, 37, 28)) +>p.b : Symbol(b, Decl(readonlyMembers.ts, 42, 28)) +>p : Symbol(p, Decl(readonlyMembers.ts, 42, 3)) +>b : Symbol(b, Decl(readonlyMembers.ts, 42, 28)) var q: { a: number, b: number } = p; ->q : Symbol(q, Decl(readonlyMembers.ts, 40, 3)) ->a : Symbol(a, Decl(readonlyMembers.ts, 40, 8)) ->b : Symbol(b, Decl(readonlyMembers.ts, 40, 19)) ->p : Symbol(p, Decl(readonlyMembers.ts, 37, 3)) +>q : Symbol(q, Decl(readonlyMembers.ts, 45, 3)) +>a : Symbol(a, Decl(readonlyMembers.ts, 45, 8)) +>b : Symbol(b, Decl(readonlyMembers.ts, 45, 19)) +>p : Symbol(p, Decl(readonlyMembers.ts, 42, 3)) q.a = 1; ->q.a : Symbol(a, Decl(readonlyMembers.ts, 40, 8)) ->q : Symbol(q, Decl(readonlyMembers.ts, 40, 3)) ->a : Symbol(a, Decl(readonlyMembers.ts, 40, 8)) +>q.a : Symbol(a, Decl(readonlyMembers.ts, 45, 8)) +>q : Symbol(q, Decl(readonlyMembers.ts, 45, 3)) +>a : Symbol(a, Decl(readonlyMembers.ts, 45, 8)) q.b = 1; ->q.b : Symbol(b, Decl(readonlyMembers.ts, 40, 19)) ->q : Symbol(q, Decl(readonlyMembers.ts, 40, 3)) ->b : Symbol(b, Decl(readonlyMembers.ts, 40, 19)) +>q.b : Symbol(b, Decl(readonlyMembers.ts, 45, 19)) +>q : Symbol(q, Decl(readonlyMembers.ts, 45, 3)) +>b : Symbol(b, Decl(readonlyMembers.ts, 45, 19)) enum E { ->E : Symbol(E, Decl(readonlyMembers.ts, 42, 8)) +>E : Symbol(E, Decl(readonlyMembers.ts, 47, 8)) A, B, C ->A : Symbol(E.A, Decl(readonlyMembers.ts, 44, 8)) ->B : Symbol(E.B, Decl(readonlyMembers.ts, 45, 6)) ->C : Symbol(E.C, Decl(readonlyMembers.ts, 45, 9)) +>A : Symbol(E.A, Decl(readonlyMembers.ts, 49, 8)) +>B : Symbol(E.B, Decl(readonlyMembers.ts, 50, 6)) +>C : Symbol(E.C, Decl(readonlyMembers.ts, 50, 9)) } E.A = 1; // Error ->E.A : Symbol(E.A, Decl(readonlyMembers.ts, 44, 8)) ->E : Symbol(E, Decl(readonlyMembers.ts, 42, 8)) ->A : Symbol(E.A, Decl(readonlyMembers.ts, 44, 8)) +>E.A : Symbol(E.A, Decl(readonlyMembers.ts, 49, 8)) +>E : Symbol(E, Decl(readonlyMembers.ts, 47, 8)) +>A : Symbol(E.A, Decl(readonlyMembers.ts, 49, 8)) namespace N { ->N : Symbol(N, Decl(readonlyMembers.ts, 47, 8)) +>N : Symbol(N, Decl(readonlyMembers.ts, 52, 8)) export const a = 1; ->a : Symbol(a, Decl(readonlyMembers.ts, 50, 16)) +>a : Symbol(a, Decl(readonlyMembers.ts, 55, 16)) export let b = 1; ->b : Symbol(b, Decl(readonlyMembers.ts, 51, 14)) +>b : Symbol(b, Decl(readonlyMembers.ts, 56, 14)) export var c = 1; ->c : Symbol(c, Decl(readonlyMembers.ts, 52, 14)) +>c : Symbol(c, Decl(readonlyMembers.ts, 57, 14)) } N.a = 1; // Error ->N.a : Symbol(N.a, Decl(readonlyMembers.ts, 50, 16)) ->N : Symbol(N, Decl(readonlyMembers.ts, 47, 8)) ->a : Symbol(N.a, Decl(readonlyMembers.ts, 50, 16)) +>N.a : Symbol(N.a, Decl(readonlyMembers.ts, 55, 16)) +>N : Symbol(N, Decl(readonlyMembers.ts, 52, 8)) +>a : Symbol(N.a, Decl(readonlyMembers.ts, 55, 16)) N.b = 1; ->N.b : Symbol(N.b, Decl(readonlyMembers.ts, 51, 14)) ->N : Symbol(N, Decl(readonlyMembers.ts, 47, 8)) ->b : Symbol(N.b, Decl(readonlyMembers.ts, 51, 14)) +>N.b : Symbol(N.b, Decl(readonlyMembers.ts, 56, 14)) +>N : Symbol(N, Decl(readonlyMembers.ts, 52, 8)) +>b : Symbol(N.b, Decl(readonlyMembers.ts, 56, 14)) N.c = 1; ->N.c : Symbol(N.c, Decl(readonlyMembers.ts, 52, 14)) ->N : Symbol(N, Decl(readonlyMembers.ts, 47, 8)) ->c : Symbol(N.c, Decl(readonlyMembers.ts, 52, 14)) +>N.c : Symbol(N.c, Decl(readonlyMembers.ts, 57, 14)) +>N : Symbol(N, Decl(readonlyMembers.ts, 52, 8)) +>c : Symbol(N.c, Decl(readonlyMembers.ts, 57, 14)) let xx: { readonly [x: string]: string }; ->xx : Symbol(xx, Decl(readonlyMembers.ts, 58, 3)) ->x : Symbol(x, Decl(readonlyMembers.ts, 58, 20)) +>xx : Symbol(xx, Decl(readonlyMembers.ts, 63, 3)) +>x : Symbol(x, Decl(readonlyMembers.ts, 63, 20)) let s = xx["foo"]; ->s : Symbol(s, Decl(readonlyMembers.ts, 59, 3)) ->xx : Symbol(xx, Decl(readonlyMembers.ts, 58, 3)) +>s : Symbol(s, Decl(readonlyMembers.ts, 64, 3)) +>xx : Symbol(xx, Decl(readonlyMembers.ts, 63, 3)) xx["foo"] = "abc"; // Error ->xx : Symbol(xx, Decl(readonlyMembers.ts, 58, 3)) +>xx : Symbol(xx, Decl(readonlyMembers.ts, 63, 3)) let yy: { readonly [x: number]: string, [x: string]: string }; ->yy : Symbol(yy, Decl(readonlyMembers.ts, 62, 3)) ->x : Symbol(x, Decl(readonlyMembers.ts, 62, 20)) ->x : Symbol(x, Decl(readonlyMembers.ts, 62, 41)) +>yy : Symbol(yy, Decl(readonlyMembers.ts, 67, 3)) +>x : Symbol(x, Decl(readonlyMembers.ts, 67, 20)) +>x : Symbol(x, Decl(readonlyMembers.ts, 67, 41)) yy[1] = "abc"; // Error ->yy : Symbol(yy, Decl(readonlyMembers.ts, 62, 3)) +>yy : Symbol(yy, Decl(readonlyMembers.ts, 67, 3)) yy["foo"] = "abc"; ->yy : Symbol(yy, Decl(readonlyMembers.ts, 62, 3)) +>yy : Symbol(yy, Decl(readonlyMembers.ts, 67, 3)) diff --git a/tests/baselines/reference/readonlyMembers.types b/tests/baselines/reference/readonlyMembers.types index 0566106bdf4a9..852ed3e69251c 100644 --- a/tests/baselines/reference/readonlyMembers.types +++ b/tests/baselines/reference/readonlyMembers.types @@ -142,7 +142,53 @@ class C { > : ^^^ >1 : 1 > : ^ - } + + }; + (() => { +>(() => { this.a = 1; // Ok this.b = 1; // Ok this.c = 1; // Error })() : void +> : ^^^^ +>(() => { this.a = 1; // Ok this.b = 1; // Ok this.c = 1; // Error }) : () => void +> : ^^^^^^^^^^ +>() => { this.a = 1; // Ok this.b = 1; // Ok this.c = 1; // Error } : () => void +> : ^^^^^^^^^^ + + this.a = 1; // Ok +>this.a = 1 : 1 +> : ^ +>this.a : number +> : ^^^^^^ +>this : this +> : ^^^^ +>a : number +> : ^^^^^^ +>1 : 1 +> : ^ + + this.b = 1; // Ok +>this.b = 1 : 1 +> : ^ +>this.b : 1 +> : ^ +>this : this +> : ^^^^ +>b : 1 +> : ^ +>1 : 1 +> : ^ + + this.c = 1; // Error +>this.c = 1 : 1 +> : ^ +>this.c : any +> : ^^^ +>this : this +> : ^^^^ +>c : any +> : ^^^ +>1 : 1 +> : ^ + + })(); } foo() { >foo : () => void diff --git a/tests/cases/compiler/readonlyMembers.ts b/tests/cases/compiler/readonlyMembers.ts index f24b365772755..b625da3b12d09 100644 --- a/tests/cases/compiler/readonlyMembers.ts +++ b/tests/cases/compiler/readonlyMembers.ts @@ -20,7 +20,12 @@ class C { this.a = 1; // Error this.b = 1; // Error this.c = 1; // Error - } + }; + (() => { + this.a = 1; // Ok + this.b = 1; // Ok + this.c = 1; // Error + })(); } foo() { this.a = 1; // Error From 14c65b311959501b6720ff48b9cb02eecbcee4a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Mon, 2 Dec 2024 21:12:58 +0100 Subject: [PATCH 06/46] Check if switch statements are exhaustive when their expressions is generic with a literal type constraint (#60644) --- src/compiler/checker.ts | 2 +- .../reference/dependentReturnType9.errors.txt | 71 ++++ .../reference/dependentReturnType9.symbols | 173 ++++++++++ .../reference/dependentReturnType9.types | 306 ++++++++++++++++++ tests/cases/compiler/dependentReturnType9.ts | 67 ++++ 5 files changed, 618 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/dependentReturnType9.errors.txt create mode 100644 tests/baselines/reference/dependentReturnType9.symbols create mode 100644 tests/baselines/reference/dependentReturnType9.types create mode 100644 tests/cases/compiler/dependentReturnType9.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3d3f908d82c79..397a424ee7b27 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -38682,7 +38682,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // A missing not-equal flag indicates that the type wasn't handled by some case. return !someType(operandConstraint, t => getTypeFacts(t, notEqualFacts) === notEqualFacts); } - const type = checkExpressionCached(node.expression); + const type = getBaseConstraintOrType(checkExpressionCached(node.expression)); if (!isLiteralType(type)) { return false; } diff --git a/tests/baselines/reference/dependentReturnType9.errors.txt b/tests/baselines/reference/dependentReturnType9.errors.txt new file mode 100644 index 0000000000000..da12eeaab2eb4 --- /dev/null +++ b/tests/baselines/reference/dependentReturnType9.errors.txt @@ -0,0 +1,71 @@ +dependentReturnType9.ts(57,4): error TS2366: Function lacks ending return statement and return type does not include 'undefined'. + + +==== dependentReturnType9.ts (1 errors) ==== + type Payload = + | { _tag: "auth"; username: string; password: string } + | { _tag: "cart"; items: Array<{ id: string; quantity: number }> } + | { _tag: "person"; name: string; age: number }; + + type PayloadContent = { + [P in Payload as P["_tag"]]: Omit; + }; + + // ok, exhaustive cases and default case with throw + function mockPayload( + str: P_TAG, + ): PayloadContent[P_TAG] { + switch (str) { + case "auth": + return { username: "test", password: "admin" }; + case "cart": + return { items: [{ id: "123", quantity: 123 }] }; + case "person": + return { name: "andrea", age: 27 }; + default: + throw new Error("unknown tag"); + } + } + + // ok, non-exhaustive cases but default case with throw + function mockPayload2( + str: P_TAG, + ): PayloadContent[P_TAG] { + switch (str) { + case "auth": + return { username: "test", password: "admin" }; + case "cart": + return { items: [{ id: "123", quantity: 123 }] }; + default: + throw new Error("unhandled tag"); + } + } + + // ok, exhaustive cases + function mockPayload3( + str: P_TAG, + ): PayloadContent[P_TAG] { + switch (str) { + case "auth": + return { username: "test", password: "admin" }; + case "cart": + return { items: [{ id: "123", quantity: 123 }] }; + case "person": + return { name: "andrea", age: 27 }; + } + } + + // error, non-exhaustive cases + function mockPayload4( + str: P_TAG, + ): PayloadContent[P_TAG] { + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2366: Function lacks ending return statement and return type does not include 'undefined'. + switch (str) { + case "auth": + return { username: "test", password: "admin" }; + case "cart": + return { items: [{ id: "123", quantity: 123 }] }; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/dependentReturnType9.symbols b/tests/baselines/reference/dependentReturnType9.symbols new file mode 100644 index 0000000000000..d66bb2d76f040 --- /dev/null +++ b/tests/baselines/reference/dependentReturnType9.symbols @@ -0,0 +1,173 @@ +//// [tests/cases/compiler/dependentReturnType9.ts] //// + +=== dependentReturnType9.ts === +type Payload = +>Payload : Symbol(Payload, Decl(dependentReturnType9.ts, 0, 0)) + + | { _tag: "auth"; username: string; password: string } +>_tag : Symbol(_tag, Decl(dependentReturnType9.ts, 1, 5)) +>username : Symbol(username, Decl(dependentReturnType9.ts, 1, 19)) +>password : Symbol(password, Decl(dependentReturnType9.ts, 1, 37)) + + | { _tag: "cart"; items: Array<{ id: string; quantity: number }> } +>_tag : Symbol(_tag, Decl(dependentReturnType9.ts, 2, 5)) +>items : Symbol(items, Decl(dependentReturnType9.ts, 2, 19)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>id : Symbol(id, Decl(dependentReturnType9.ts, 2, 34)) +>quantity : Symbol(quantity, Decl(dependentReturnType9.ts, 2, 46)) + + | { _tag: "person"; name: string; age: number }; +>_tag : Symbol(_tag, Decl(dependentReturnType9.ts, 3, 5)) +>name : Symbol(name, Decl(dependentReturnType9.ts, 3, 21)) +>age : Symbol(age, Decl(dependentReturnType9.ts, 3, 35)) + +type PayloadContent = { +>PayloadContent : Symbol(PayloadContent, Decl(dependentReturnType9.ts, 3, 50)) + + [P in Payload as P["_tag"]]: Omit; +>P : Symbol(P, Decl(dependentReturnType9.ts, 6, 3)) +>Payload : Symbol(Payload, Decl(dependentReturnType9.ts, 0, 0)) +>P : Symbol(P, Decl(dependentReturnType9.ts, 6, 3)) +>Omit : Symbol(Omit, Decl(lib.es5.d.ts, --, --)) +>P : Symbol(P, Decl(dependentReturnType9.ts, 6, 3)) + +}; + +// ok, exhaustive cases and default case with throw +function mockPayload( +>mockPayload : Symbol(mockPayload, Decl(dependentReturnType9.ts, 7, 2)) +>P_TAG : Symbol(P_TAG, Decl(dependentReturnType9.ts, 10, 21)) +>Payload : Symbol(Payload, Decl(dependentReturnType9.ts, 0, 0)) + + str: P_TAG, +>str : Symbol(str, Decl(dependentReturnType9.ts, 10, 52)) +>P_TAG : Symbol(P_TAG, Decl(dependentReturnType9.ts, 10, 21)) + +): PayloadContent[P_TAG] { +>PayloadContent : Symbol(PayloadContent, Decl(dependentReturnType9.ts, 3, 50)) +>P_TAG : Symbol(P_TAG, Decl(dependentReturnType9.ts, 10, 21)) + + switch (str) { +>str : Symbol(str, Decl(dependentReturnType9.ts, 10, 52)) + + case "auth": + return { username: "test", password: "admin" }; +>username : Symbol(username, Decl(dependentReturnType9.ts, 15, 14)) +>password : Symbol(password, Decl(dependentReturnType9.ts, 15, 32)) + + case "cart": + return { items: [{ id: "123", quantity: 123 }] }; +>items : Symbol(items, Decl(dependentReturnType9.ts, 17, 14)) +>id : Symbol(id, Decl(dependentReturnType9.ts, 17, 24)) +>quantity : Symbol(quantity, Decl(dependentReturnType9.ts, 17, 35)) + + case "person": + return { name: "andrea", age: 27 }; +>name : Symbol(name, Decl(dependentReturnType9.ts, 19, 14)) +>age : Symbol(age, Decl(dependentReturnType9.ts, 19, 30)) + + default: + throw new Error("unknown tag"); +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + } +} + +// ok, non-exhaustive cases but default case with throw +function mockPayload2( +>mockPayload2 : Symbol(mockPayload2, Decl(dependentReturnType9.ts, 23, 1)) +>P_TAG : Symbol(P_TAG, Decl(dependentReturnType9.ts, 26, 22)) +>Payload : Symbol(Payload, Decl(dependentReturnType9.ts, 0, 0)) + + str: P_TAG, +>str : Symbol(str, Decl(dependentReturnType9.ts, 26, 53)) +>P_TAG : Symbol(P_TAG, Decl(dependentReturnType9.ts, 26, 22)) + +): PayloadContent[P_TAG] { +>PayloadContent : Symbol(PayloadContent, Decl(dependentReturnType9.ts, 3, 50)) +>P_TAG : Symbol(P_TAG, Decl(dependentReturnType9.ts, 26, 22)) + + switch (str) { +>str : Symbol(str, Decl(dependentReturnType9.ts, 26, 53)) + + case "auth": + return { username: "test", password: "admin" }; +>username : Symbol(username, Decl(dependentReturnType9.ts, 31, 14)) +>password : Symbol(password, Decl(dependentReturnType9.ts, 31, 32)) + + case "cart": + return { items: [{ id: "123", quantity: 123 }] }; +>items : Symbol(items, Decl(dependentReturnType9.ts, 33, 14)) +>id : Symbol(id, Decl(dependentReturnType9.ts, 33, 24)) +>quantity : Symbol(quantity, Decl(dependentReturnType9.ts, 33, 35)) + + default: + throw new Error("unhandled tag"); +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + } +} + +// ok, exhaustive cases +function mockPayload3( +>mockPayload3 : Symbol(mockPayload3, Decl(dependentReturnType9.ts, 37, 1)) +>P_TAG : Symbol(P_TAG, Decl(dependentReturnType9.ts, 40, 22)) +>Payload : Symbol(Payload, Decl(dependentReturnType9.ts, 0, 0)) + + str: P_TAG, +>str : Symbol(str, Decl(dependentReturnType9.ts, 40, 53)) +>P_TAG : Symbol(P_TAG, Decl(dependentReturnType9.ts, 40, 22)) + +): PayloadContent[P_TAG] { +>PayloadContent : Symbol(PayloadContent, Decl(dependentReturnType9.ts, 3, 50)) +>P_TAG : Symbol(P_TAG, Decl(dependentReturnType9.ts, 40, 22)) + + switch (str) { +>str : Symbol(str, Decl(dependentReturnType9.ts, 40, 53)) + + case "auth": + return { username: "test", password: "admin" }; +>username : Symbol(username, Decl(dependentReturnType9.ts, 45, 14)) +>password : Symbol(password, Decl(dependentReturnType9.ts, 45, 32)) + + case "cart": + return { items: [{ id: "123", quantity: 123 }] }; +>items : Symbol(items, Decl(dependentReturnType9.ts, 47, 14)) +>id : Symbol(id, Decl(dependentReturnType9.ts, 47, 24)) +>quantity : Symbol(quantity, Decl(dependentReturnType9.ts, 47, 35)) + + case "person": + return { name: "andrea", age: 27 }; +>name : Symbol(name, Decl(dependentReturnType9.ts, 49, 14)) +>age : Symbol(age, Decl(dependentReturnType9.ts, 49, 30)) + } +} + +// error, non-exhaustive cases +function mockPayload4( +>mockPayload4 : Symbol(mockPayload4, Decl(dependentReturnType9.ts, 51, 1)) +>P_TAG : Symbol(P_TAG, Decl(dependentReturnType9.ts, 54, 22)) +>Payload : Symbol(Payload, Decl(dependentReturnType9.ts, 0, 0)) + + str: P_TAG, +>str : Symbol(str, Decl(dependentReturnType9.ts, 54, 53)) +>P_TAG : Symbol(P_TAG, Decl(dependentReturnType9.ts, 54, 22)) + +): PayloadContent[P_TAG] { +>PayloadContent : Symbol(PayloadContent, Decl(dependentReturnType9.ts, 3, 50)) +>P_TAG : Symbol(P_TAG, Decl(dependentReturnType9.ts, 54, 22)) + + switch (str) { +>str : Symbol(str, Decl(dependentReturnType9.ts, 54, 53)) + + case "auth": + return { username: "test", password: "admin" }; +>username : Symbol(username, Decl(dependentReturnType9.ts, 59, 14)) +>password : Symbol(password, Decl(dependentReturnType9.ts, 59, 32)) + + case "cart": + return { items: [{ id: "123", quantity: 123 }] }; +>items : Symbol(items, Decl(dependentReturnType9.ts, 61, 14)) +>id : Symbol(id, Decl(dependentReturnType9.ts, 61, 24)) +>quantity : Symbol(quantity, Decl(dependentReturnType9.ts, 61, 35)) + } +} + diff --git a/tests/baselines/reference/dependentReturnType9.types b/tests/baselines/reference/dependentReturnType9.types new file mode 100644 index 0000000000000..834e5f578388b --- /dev/null +++ b/tests/baselines/reference/dependentReturnType9.types @@ -0,0 +1,306 @@ +//// [tests/cases/compiler/dependentReturnType9.ts] //// + +=== dependentReturnType9.ts === +type Payload = +>Payload : Payload +> : ^^^^^^^ + + | { _tag: "auth"; username: string; password: string } +>_tag : "auth" +> : ^^^^^^ +>username : string +> : ^^^^^^ +>password : string +> : ^^^^^^ + + | { _tag: "cart"; items: Array<{ id: string; quantity: number }> } +>_tag : "cart" +> : ^^^^^^ +>items : { id: string; quantity: number; }[] +> : ^^^^^^ ^^^^^^^^^^^^ ^^^^^ +>id : string +> : ^^^^^^ +>quantity : number +> : ^^^^^^ + + | { _tag: "person"; name: string; age: number }; +>_tag : "person" +> : ^^^^^^^^ +>name : string +> : ^^^^^^ +>age : number +> : ^^^^^^ + +type PayloadContent = { +>PayloadContent : PayloadContent +> : ^^^^^^^^^^^^^^ + + [P in Payload as P["_tag"]]: Omit; +}; + +// ok, exhaustive cases and default case with throw +function mockPayload( +>mockPayload : (str: P_TAG) => PayloadContent[P_TAG] +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + str: P_TAG, +>str : P_TAG +> : ^^^^^ + +): PayloadContent[P_TAG] { + switch (str) { +>str : P_TAG +> : ^^^^^ + + case "auth": +>"auth" : "auth" +> : ^^^^^^ + + return { username: "test", password: "admin" }; +>{ username: "test", password: "admin" } : { username: string; password: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>username : string +> : ^^^^^^ +>"test" : "test" +> : ^^^^^^ +>password : string +> : ^^^^^^ +>"admin" : "admin" +> : ^^^^^^^ + + case "cart": +>"cart" : "cart" +> : ^^^^^^ + + return { items: [{ id: "123", quantity: 123 }] }; +>{ items: [{ id: "123", quantity: 123 }] } : { items: { id: string; quantity: number; }[]; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>items : { id: string; quantity: number; }[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[{ id: "123", quantity: 123 }] : { id: string; quantity: number; }[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ id: "123", quantity: 123 } : { id: string; quantity: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>id : string +> : ^^^^^^ +>"123" : "123" +> : ^^^^^ +>quantity : number +> : ^^^^^^ +>123 : 123 +> : ^^^ + + case "person": +>"person" : "person" +> : ^^^^^^^^ + + return { name: "andrea", age: 27 }; +>{ name: "andrea", age: 27 } : { name: string; age: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>name : string +> : ^^^^^^ +>"andrea" : "andrea" +> : ^^^^^^^^ +>age : number +> : ^^^^^^ +>27 : 27 +> : ^^ + + default: + throw new Error("unknown tag"); +>new Error("unknown tag") : Error +> : ^^^^^ +>Error : ErrorConstructor +> : ^^^^^^^^^^^^^^^^ +>"unknown tag" : "unknown tag" +> : ^^^^^^^^^^^^^ + } +} + +// ok, non-exhaustive cases but default case with throw +function mockPayload2( +>mockPayload2 : (str: P_TAG) => PayloadContent[P_TAG] +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + str: P_TAG, +>str : P_TAG +> : ^^^^^ + +): PayloadContent[P_TAG] { + switch (str) { +>str : P_TAG +> : ^^^^^ + + case "auth": +>"auth" : "auth" +> : ^^^^^^ + + return { username: "test", password: "admin" }; +>{ username: "test", password: "admin" } : { username: string; password: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>username : string +> : ^^^^^^ +>"test" : "test" +> : ^^^^^^ +>password : string +> : ^^^^^^ +>"admin" : "admin" +> : ^^^^^^^ + + case "cart": +>"cart" : "cart" +> : ^^^^^^ + + return { items: [{ id: "123", quantity: 123 }] }; +>{ items: [{ id: "123", quantity: 123 }] } : { items: { id: string; quantity: number; }[]; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>items : { id: string; quantity: number; }[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[{ id: "123", quantity: 123 }] : { id: string; quantity: number; }[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ id: "123", quantity: 123 } : { id: string; quantity: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>id : string +> : ^^^^^^ +>"123" : "123" +> : ^^^^^ +>quantity : number +> : ^^^^^^ +>123 : 123 +> : ^^^ + + default: + throw new Error("unhandled tag"); +>new Error("unhandled tag") : Error +> : ^^^^^ +>Error : ErrorConstructor +> : ^^^^^^^^^^^^^^^^ +>"unhandled tag" : "unhandled tag" +> : ^^^^^^^^^^^^^^^ + } +} + +// ok, exhaustive cases +function mockPayload3( +>mockPayload3 : (str: P_TAG) => PayloadContent[P_TAG] +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + str: P_TAG, +>str : P_TAG +> : ^^^^^ + +): PayloadContent[P_TAG] { + switch (str) { +>str : P_TAG +> : ^^^^^ + + case "auth": +>"auth" : "auth" +> : ^^^^^^ + + return { username: "test", password: "admin" }; +>{ username: "test", password: "admin" } : { username: string; password: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>username : string +> : ^^^^^^ +>"test" : "test" +> : ^^^^^^ +>password : string +> : ^^^^^^ +>"admin" : "admin" +> : ^^^^^^^ + + case "cart": +>"cart" : "cart" +> : ^^^^^^ + + return { items: [{ id: "123", quantity: 123 }] }; +>{ items: [{ id: "123", quantity: 123 }] } : { items: { id: string; quantity: number; }[]; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>items : { id: string; quantity: number; }[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[{ id: "123", quantity: 123 }] : { id: string; quantity: number; }[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ id: "123", quantity: 123 } : { id: string; quantity: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>id : string +> : ^^^^^^ +>"123" : "123" +> : ^^^^^ +>quantity : number +> : ^^^^^^ +>123 : 123 +> : ^^^ + + case "person": +>"person" : "person" +> : ^^^^^^^^ + + return { name: "andrea", age: 27 }; +>{ name: "andrea", age: 27 } : { name: string; age: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>name : string +> : ^^^^^^ +>"andrea" : "andrea" +> : ^^^^^^^^ +>age : number +> : ^^^^^^ +>27 : 27 +> : ^^ + } +} + +// error, non-exhaustive cases +function mockPayload4( +>mockPayload4 : (str: P_TAG) => PayloadContent[P_TAG] +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + str: P_TAG, +>str : P_TAG +> : ^^^^^ + +): PayloadContent[P_TAG] { + switch (str) { +>str : P_TAG +> : ^^^^^ + + case "auth": +>"auth" : "auth" +> : ^^^^^^ + + return { username: "test", password: "admin" }; +>{ username: "test", password: "admin" } : { username: string; password: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>username : string +> : ^^^^^^ +>"test" : "test" +> : ^^^^^^ +>password : string +> : ^^^^^^ +>"admin" : "admin" +> : ^^^^^^^ + + case "cart": +>"cart" : "cart" +> : ^^^^^^ + + return { items: [{ id: "123", quantity: 123 }] }; +>{ items: [{ id: "123", quantity: 123 }] } : { items: { id: string; quantity: number; }[]; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>items : { id: string; quantity: number; }[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[{ id: "123", quantity: 123 }] : { id: string; quantity: number; }[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ id: "123", quantity: 123 } : { id: string; quantity: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>id : string +> : ^^^^^^ +>"123" : "123" +> : ^^^^^ +>quantity : number +> : ^^^^^^ +>123 : 123 +> : ^^^ + } +} + diff --git a/tests/cases/compiler/dependentReturnType9.ts b/tests/cases/compiler/dependentReturnType9.ts new file mode 100644 index 0000000000000..65437a8aea1c8 --- /dev/null +++ b/tests/cases/compiler/dependentReturnType9.ts @@ -0,0 +1,67 @@ +// @strict: true +// @noEmit: true + +type Payload = + | { _tag: "auth"; username: string; password: string } + | { _tag: "cart"; items: Array<{ id: string; quantity: number }> } + | { _tag: "person"; name: string; age: number }; + +type PayloadContent = { + [P in Payload as P["_tag"]]: Omit; +}; + +// ok, exhaustive cases and default case with throw +function mockPayload( + str: P_TAG, +): PayloadContent[P_TAG] { + switch (str) { + case "auth": + return { username: "test", password: "admin" }; + case "cart": + return { items: [{ id: "123", quantity: 123 }] }; + case "person": + return { name: "andrea", age: 27 }; + default: + throw new Error("unknown tag"); + } +} + +// ok, non-exhaustive cases but default case with throw +function mockPayload2( + str: P_TAG, +): PayloadContent[P_TAG] { + switch (str) { + case "auth": + return { username: "test", password: "admin" }; + case "cart": + return { items: [{ id: "123", quantity: 123 }] }; + default: + throw new Error("unhandled tag"); + } +} + +// ok, exhaustive cases +function mockPayload3( + str: P_TAG, +): PayloadContent[P_TAG] { + switch (str) { + case "auth": + return { username: "test", password: "admin" }; + case "cart": + return { items: [{ id: "123", quantity: 123 }] }; + case "person": + return { name: "andrea", age: 27 }; + } +} + +// error, non-exhaustive cases +function mockPayload4( + str: P_TAG, +): PayloadContent[P_TAG] { + switch (str) { + case "auth": + return { username: "test", password: "admin" }; + case "cart": + return { items: [{ id: "123", quantity: 123 }] }; + } +} From 6f75783184328087627da983fe30a05fca4f6314 Mon Sep 17 00:00:00 2001 From: Billy Janitsch Date: Tue, 3 Dec 2024 17:19:58 -0500 Subject: [PATCH 07/46] Fix library inclusions for ES2024 target (#60622) --- src/compiler/commandLineParser.ts | 4 +- src/compiler/transformers/esnext.ts | 4 +- src/compiler/types.ts | 8 +- src/compiler/utilities.ts | 4 +- src/compiler/utilitiesPublic.ts | 6 + ...-style-sibling-packages-symlinked-Linux.js | 78 ++++++------ ...packages-symlinked-package1-built-Linux.js | 64 +++++----- .../packages-outside-project-folder-Linux.js | 104 ++++++++-------- .../packages-outside-project-folder-MacOs.js | 88 +++++++------- ...ages-outside-project-folder-built-Linux.js | 100 ++++++++-------- ...ages-outside-project-folder-built-MacOs.js | 86 +++++++------- ...stamp-true-useFsEventsOnParentDirectory.js | 4 +- .../fsWatch/fsWatchWithTimestamp-true.js | 4 +- ...inode-when-rename-event-ends-with-tilde.js | 16 +-- ...e-occurs-when-file-is-still-on-the-disk.js | 18 +-- ...when-using-file-watching-thats-on-inode.js | 16 +-- ...polling-when-renaming-file-in-subfolder.js | 8 +- ...rectory-when-renaming-file-in-subfolder.js | 8 +- ...tchFile-when-renaming-file-in-subfolder.js | 8 +- ...-folders-with-synchronousWatchDirectory.js | 4 +- ...ymlinks-to-folders-in-recursive-folders.js | 4 +- ...hronous-watch-directory-renaming-a-file.js | 20 ++-- ...ory-with-outDir-and-declaration-enabled.js | 16 +-- .../with-non-synchronous-watch-directory.js | 20 ++-- ...-directory-watching-extendedDiagnostics.js | 4 +- ...ption-with-recursive-directory-watching.js | 4 +- .../with-fallbackPolling-option.js | 4 +- .../with-watchDirectory-option.js | 4 +- .../projectErrors/file-rename-on-wsl2.js | 4 +- ...-location-with-currentDirectory-at-root.js | 8 +- ...lution-fails-in-global-typings-location.js | 10 +- ...e-failing-with-currentDirectory-at-root.js | 10 +- ...with-import-from-the-cache-file-failing.js | 14 +-- ...ache-file-with-currentDirectory-at-root.js | 10 +- ...ocation-with-import-from-the-cache-file.js | 14 +-- ...ache-file-with-currentDirectory-at-root.js | 10 +- ...ith-relative-import-from-the-cache-file.js | 14 +-- ...kages-symlinked-Linux-canUseWatchEvents.js | 18 +-- ...-style-sibling-packages-symlinked-Linux.js | 54 ++++----- ...-package1-built-Linux-canUseWatchEvents.js | 18 +-- ...packages-symlinked-package1-built-Linux.js | 48 ++++---- ...-project-folder-Linux-canUseWatchEvents.js | 56 ++++----- .../packages-outside-project-folder-Linux.js | 112 +++++++++--------- ...-project-folder-MacOs-canUseWatchEvents.js | 56 ++++----- .../packages-outside-project-folder-MacOs.js | 88 +++++++------- ...ct-folder-built-Linux-canUseWatchEvents.js | 56 ++++----- ...ages-outside-project-folder-built-Linux.js | 110 ++++++++--------- ...ct-folder-built-MacOs-canUseWatchEvents.js | 56 ++++----- ...ages-outside-project-folder-built-MacOs.js | 88 +++++++------- ...files-starting-with-dot-in-node_modules.js | 10 +- ...polling-when-file-is-added-to-subfolder.js | 4 +- ...rectory-when-file-is-added-to-subfolder.js | 4 +- ...tchFile-when-file-is-added-to-subfolder.js | 4 +- ...ere-workspaces-folder-is-hosted-at-root.js | 16 +-- 54 files changed, 803 insertions(+), 797 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 113d2107f247d..cbd8bfcbcebe6 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -147,8 +147,8 @@ export const inverseJsxOptionMap: Map = new Map(mapIterator(jsxO // augmented in another lib. // NOTE: We must reevaluate the target for upcoming features when each successive TC39 edition is ratified in // June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`, -// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts and the contents of each -// lib/esnext.*.d.ts file. +// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts, +// compiler/utilitiesPublic.ts, and the contents of each lib/esnext.*.d.ts file. const libEntries: [string, string][] = [ // JavaScript only ["es5", "lib.es5.d.ts"], diff --git a/src/compiler/transformers/esnext.ts b/src/compiler/transformers/esnext.ts index 1871e67c6f788..eace2e2c28057 100644 --- a/src/compiler/transformers/esnext.ts +++ b/src/compiler/transformers/esnext.ts @@ -74,8 +74,8 @@ const enum UsingKind { export function transformESNext(context: TransformationContext): (x: SourceFile | Bundle) => SourceFile | Bundle { // NOTE: We must reevaluate the target for upcoming features when each successive TC39 edition is ratified in // June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`, - // `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts and the contents of each - // lib/esnext.*.d.ts file. + // `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts, + // compiler/utilitiesPublic.ts, and the contents of each lib/esnext.*.d.ts file. const { factory, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 9b4915f1cc293..6516c0b233a2e 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -7597,8 +7597,8 @@ export const enum ScriptKind { // NOTE: We must reevaluate the target for upcoming features when each successive TC39 edition is ratified in // June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`, -// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts and the contents of each -// lib/esnext.*.d.ts file. +// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts, +// compiler/utilitiesPublic.ts, and the contents of each lib/esnext.*.d.ts file. export const enum ScriptTarget { /** @deprecated */ ES3 = 0, @@ -8406,8 +8406,8 @@ export type LanugageFeatures = // Upcoming Features // NOTE: We must reevaluate the target for upcoming features when each successive TC39 edition is ratified in // June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`, - // `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts and the contents of each - // lib/esnext.*.d.ts file. + // `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts, + // compiler/utilitiesPublic.ts, and the contents of each lib/esnext.*.d.ts file. | "UsingAndAwaitUsing" // `using x = y`, `await using x = y` | "ClassAndClassElementDecorators" // `@dec class C {}`, `class C { @dec m() {} }` ; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index d12ae297b81ad..debbf655c9947 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1374,8 +1374,8 @@ export type ScriptTargetFeatures = ReadonlyMap ScriptTargetFeatures = /* @__PURE__ */ memoize((): ScriptTargetFeatures => new Map(Object.entries({ diff --git a/src/compiler/utilitiesPublic.ts b/src/compiler/utilitiesPublic.ts index 02e22b94c895e..02623678a0cf0 100644 --- a/src/compiler/utilitiesPublic.ts +++ b/src/compiler/utilitiesPublic.ts @@ -305,8 +305,13 @@ export function sortAndDeduplicateDiagnostics(diagnostics: } /** @internal */ +// NOTE: We must reevaluate the target for upcoming features when each successive TC39 edition is ratified in +// June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`, +// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts, +// compiler/utilitiesPublic.ts, and the contents of each lib/esnext.*.d.ts file. export const targetToLibMap: Map = new Map([ [ScriptTarget.ESNext, "lib.esnext.full.d.ts"], + [ScriptTarget.ES2024, "lib.es2024.full.d.ts"], [ScriptTarget.ES2023, "lib.es2023.full.d.ts"], [ScriptTarget.ES2022, "lib.es2022.full.d.ts"], [ScriptTarget.ES2021, "lib.es2021.full.d.ts"], @@ -322,6 +327,7 @@ export function getDefaultLibFileName(options: CompilerOptions): string { const target = getEmitScriptTarget(options); switch (target) { case ScriptTarget.ESNext: + case ScriptTarget.ES2024: case ScriptTarget.ES2023: case ScriptTarget.ES2022: case ScriptTarget.ES2021: diff --git a/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-Linux.js b/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-Linux.js index 08910b94b117c..460427a25587e 100644 --- a/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-Linux.js +++ b/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-Linux.js @@ -200,14 +200,14 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/packages/packag Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/packages/package2 1 undefined Wild card directory -//// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 30 +//// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 31 -//// [/home/src/projects/project/packages/package2/dist/index.js] Inode:: 118 +//// [/home/src/projects/project/packages/package2/dist/index.js] Inode:: 119 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] Inode:: 119 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] Inode:: 120 export {}; @@ -242,7 +242,7 @@ FsWatches:: /home/src/projects/project/packages/package2: *new* {"inode":11} /home/src/projects/project/packages/package2/dist: *new* - {"inode":117} + {"inode":118} /home/src/projects/project/packages/package2/src: *new* {"inode":14} /home/src/projects/project/packages/package2/src/index.ts: *new* @@ -250,7 +250,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: *new* {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: *new* - {"inode":30} + {"inode":31} Program root files: [ "/home/src/projects/project/packages/package2/src/index.ts" @@ -290,20 +290,20 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 121 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 122 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 122 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 123 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 123 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 124 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 124 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 125 { "root": [ "./src/index.ts" @@ -355,7 +355,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":120} + {"inode":121} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -363,7 +363,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":117} + {"inode":118} /home/src/projects/project/packages/package2/src: {"inode":14} /home/src/projects/project/packages/package2/src/index.ts: @@ -371,7 +371,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":30} + {"inode":31} Timeout callback:: count: 1 8: timerToInvalidateFailedLookupResolutions *new* @@ -436,8 +436,8 @@ packages/package2/src/index.ts -//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 118 -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 119 +//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 119 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 120 PolledWatches:: /home/src/projects/node_modules/@types: @@ -465,9 +465,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":120} + {"inode":121} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -475,7 +475,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":117} + {"inode":118} /home/src/projects/project/packages/package2/src: {"inode":14} /home/src/projects/project/packages/package2/src/index.ts: @@ -483,7 +483,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":30} + {"inode":31} Program root files: [ @@ -568,7 +568,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":117} + {"inode":118} /home/src/projects/project/packages/package2/src: {"inode":14} /home/src/projects/project/packages/package2/src/index.ts: @@ -576,13 +576,13 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":30} + {"inode":31} FsWatches *deleted*:: /home/src/projects/project/packages/package1/dist: - {"inode":120} + {"inode":121} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":122} + {"inode":123} Timeout callback:: count: 2 10: timerToUpdateProgram *new* @@ -690,8 +690,8 @@ Scheduling invalidateFailedLookup, Cancelled earlier one Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/node_modules/package1 :: WatchInfo: /home/src/projects/project/node_modules/package1 1 undefined Failed Lookup Locations -//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 118 -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 119 +//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 119 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 120 PolledWatches:: /home/src/projects/node_modules: *new* @@ -729,7 +729,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":117} + {"inode":118} /home/src/projects/project/packages/package2/src: {"inode":14} /home/src/projects/project/packages/package2/src/index.ts: @@ -737,7 +737,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":30} + {"inode":31} Timeout callback:: count: 1 16: timerToInvalidateFailedLookupResolutions *new* @@ -927,14 +927,14 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 123 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 124 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 126 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 124 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 125 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 export type FooType = "foo"; export type BarType = "bar"; @@ -981,7 +981,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -989,7 +989,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":117} + {"inode":118} /home/src/projects/project/packages/package2/src: {"inode":14} /home/src/projects/project/packages/package2/src/index.ts: @@ -997,7 +997,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":30} + {"inode":31} Timeout callback:: count: 1 21: timerToInvalidateFailedLookupResolutions *new* @@ -1062,8 +1062,8 @@ packages/package2/src/index.ts -//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 118 -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 119 +//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 119 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 120 PolledWatches:: /home/src/projects/node_modules/@types: @@ -1091,9 +1091,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1101,7 +1101,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":117} + {"inode":118} /home/src/projects/project/packages/package2/src: {"inode":14} /home/src/projects/project/packages/package2/src/index.ts: @@ -1109,7 +1109,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":30} + {"inode":31} Program root files: [ diff --git a/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js b/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js index 638e444f1ea20..c59a6b756224f 100644 --- a/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js +++ b/tests/baselines/reference/tscWatch/symlinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js @@ -82,22 +82,22 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 30 +//// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 31 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 118 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 119 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 119 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 120 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 120 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 121 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 121 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 122 { "root": [ "./src/index.ts" @@ -173,12 +173,12 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/packages/packag Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/packages/package2 1 undefined Wild card directory -//// [/home/src/projects/project/packages/package2/dist/index.js] Inode:: 123 +//// [/home/src/projects/project/packages/package2/dist/index.js] Inode:: 124 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] Inode:: 124 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] Inode:: 125 export {}; @@ -205,9 +205,9 @@ FsWatches:: /home/src/projects/project/packages/package1: *new* {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":117} + {"inode":118} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":119} + {"inode":120} /home/src/projects/project/packages/package1/package.json: *new* {"inode":7} /home/src/projects/project/packages/package1/src: *new* @@ -215,7 +215,7 @@ FsWatches:: /home/src/projects/project/packages/package2: *new* {"inode":11} /home/src/projects/project/packages/package2/dist: *new* - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package2/src: *new* {"inode":14} /home/src/projects/project/packages/package2/src/index.ts: *new* @@ -223,7 +223,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: *new* {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: *new* - {"inode":30} + {"inode":31} Program root files: [ "/home/src/projects/project/packages/package2/src/index.ts" @@ -309,7 +309,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package2/src: {"inode":14} /home/src/projects/project/packages/package2/src/index.ts: @@ -317,13 +317,13 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":30} + {"inode":31} FsWatches *deleted*:: /home/src/projects/project/packages/package1/dist: - {"inode":117} + {"inode":118} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":119} + {"inode":120} Timeout callback:: count: 2 1: timerToUpdateProgram *new* @@ -434,8 +434,8 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/node_ sysLog:: Elapsed:: *ms:: onTimerToUpdateChildWatches:: 0 undefined -//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 123 -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 124 +//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 124 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 125 PolledWatches:: /home/src/projects/node_modules: *new* @@ -473,7 +473,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package2/src: {"inode":14} /home/src/projects/project/packages/package2/src/index.ts: @@ -481,7 +481,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":30} + {"inode":31} Timeout callback:: count: 1 7: timerToInvalidateFailedLookupResolutions *new* @@ -671,14 +671,14 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 120 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 121 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 126 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 121 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 122 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 export type FooType = "foo"; export type BarType = "bar"; @@ -725,7 +725,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -733,7 +733,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package2/src: {"inode":14} /home/src/projects/project/packages/package2/src/index.ts: @@ -741,7 +741,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":30} + {"inode":31} Timeout callback:: count: 1 12: timerToInvalidateFailedLookupResolutions *new* @@ -806,8 +806,8 @@ packages/package2/src/index.ts -//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 123 -//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 124 +//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 124 +//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 125 PolledWatches:: /home/src/projects/node_modules/@types: @@ -835,9 +835,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -845,7 +845,7 @@ FsWatches:: /home/src/projects/project/packages/package2: {"inode":11} /home/src/projects/project/packages/package2/dist: - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package2/src: {"inode":14} /home/src/projects/project/packages/package2/src/index.ts: @@ -853,7 +853,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":30} + {"inode":31} Program root files: [ diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js index a42a35a3e1c84..0a1098650d5c1 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js @@ -206,7 +206,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 unde Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 undefined Wild card directory -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 139 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 140 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -284,7 +284,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 140 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 141 export const a = 10; @@ -302,7 +302,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 141 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 142 export const a = 10; @@ -320,18 +320,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 143 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 144 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 144 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 145 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 145 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 146 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -351,14 +351,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 146 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 147 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 148 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 149 { "root": [ "../src/c.ts", @@ -368,18 +368,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 150 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 151 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 151 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 152 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 152 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 153 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -400,15 +400,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 153 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 154 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 155 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 156 { "root": [ "../src/a.ts", @@ -460,7 +460,7 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":149} + {"inode":150} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -593,7 +593,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 139 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 140 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -621,11 +621,11 @@ PolledWatches *deleted*:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":149} + {"inode":150} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":151} + {"inode":152} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":153} + {"inode":154} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -639,11 +639,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":142} + {"inode":143} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":144} + {"inode":145} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":146} + {"inode":147} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: @@ -698,7 +698,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 156 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 157 export const a = 10; @@ -716,7 +716,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 157 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 158 export const a = 10; @@ -856,17 +856,17 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":149} + {"inode":150} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":151} + {"inode":152} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":153} + {"inode":154} /home/src/projects/c/3/c-impl/c/lib: - {"inode":142} + {"inode":143} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":144} + {"inode":145} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":146} + {"inode":147} Timeout callback:: count: 2 18: timerToUpdateProgram *new* @@ -984,7 +984,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 139 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 140 PolledWatches:: /home/src/projects/b/2/b-impl/b/node_modules/@types: @@ -1099,18 +1099,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 159 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 160 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 160 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 161 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 161 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 162 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1130,14 +1130,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 162 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 163 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 163 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 164 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 165 { "root": [ "../src/c.ts", @@ -1147,18 +1147,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 166 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 167 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 167 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 168 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 168 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 169 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1179,15 +1179,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 169 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 170 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 170 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 171 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 { "root": [ "../src/a.ts", @@ -1239,7 +1239,7 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":165} + {"inode":166} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1370,7 +1370,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 139 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 140 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -1398,11 +1398,11 @@ PolledWatches *deleted*:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":165} + {"inode":166} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":167} + {"inode":168} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":169} + {"inode":170} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1416,11 +1416,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":158} + {"inode":159} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":160} + {"inode":161} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":162} + {"inode":163} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js index cd178e641f3ea..886d61e0b4126 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js @@ -206,7 +206,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 unde Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 undefined Wild card directory -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 139 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 140 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -280,7 +280,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 140 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 141 export const a = 10; @@ -298,7 +298,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 141 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 142 export const a = 10; @@ -316,18 +316,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 143 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 144 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 144 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 145 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 145 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 146 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -347,14 +347,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 146 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 147 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 148 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 149 { "root": [ "../src/c.ts", @@ -364,18 +364,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 150 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 151 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 151 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 152 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 152 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 153 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -396,15 +396,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 153 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 154 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 155 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 156 { "root": [ "../src/a.ts", @@ -552,7 +552,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 139 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 140 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -580,9 +580,9 @@ PolledWatches *deleted*:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":151} + {"inode":152} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":153} + {"inode":154} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b/2/b-impl/b/src/index.ts: @@ -590,9 +590,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":144} + {"inode":145} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":146} + {"inode":147} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: @@ -659,7 +659,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 156 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 157 export const a = 10; @@ -688,7 +688,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 157 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 158 export const a = 10; @@ -827,13 +827,13 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":151} + {"inode":152} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":153} + {"inode":154} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":144} + {"inode":145} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":146} + {"inode":147} FsWatchesRecursive:: /home/src/projects/a: @@ -963,7 +963,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 139 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 140 PolledWatches:: /home/src/projects/b/2/b-impl/b/node_modules/@types: @@ -1059,18 +1059,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 159 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 160 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 160 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 161 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 161 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 162 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1090,14 +1090,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 162 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 163 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 163 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 164 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 165 { "root": [ "../src/c.ts", @@ -1107,18 +1107,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 166 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 167 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 167 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 168 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 168 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 169 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1139,15 +1139,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 169 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 170 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 170 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 171 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 { "root": [ "../src/a.ts", @@ -1293,7 +1293,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 139 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 140 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -1321,9 +1321,9 @@ PolledWatches *deleted*:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":167} + {"inode":168} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":169} + {"inode":170} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b/2/b-impl/b/src/index.ts: @@ -1331,9 +1331,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":160} + {"inode":161} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":162} + {"inode":163} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js index c1eb87e9d0906..5f6215dc01ef8 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js @@ -88,18 +88,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 139 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 140 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 140 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 141 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 141 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 142 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -119,14 +119,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 142 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 143 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 143 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 144 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 144 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 145 { "root": [ "../src/c.ts", @@ -136,18 +136,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 146 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 147 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 147 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 148 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 148 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 149 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -168,15 +168,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 149 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 150 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 150 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 151 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 151 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 152 { "root": [ "../src/a.ts", @@ -291,7 +291,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 unde Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 undefined Wild card directory -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 153 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 154 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -313,11 +313,11 @@ PolledWatches:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":145} + {"inode":146} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":147} + {"inode":148} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":149} + {"inode":150} /home/src/projects/a/1/a-impl/a/node_modules: *new* {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: *new* @@ -331,11 +331,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: *new* {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":138} + {"inode":139} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":140} + {"inode":141} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":142} + {"inode":143} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: *new* @@ -383,7 +383,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 154 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 155 export const a = 10; @@ -401,7 +401,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 155 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 156 export const a = 10; @@ -419,7 +419,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 156 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 157 export const a = 10; @@ -437,7 +437,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 157 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 158 export const a = 10; @@ -577,17 +577,17 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":145} + {"inode":146} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":147} + {"inode":148} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":149} + {"inode":150} /home/src/projects/c/3/c-impl/c/lib: - {"inode":138} + {"inode":139} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":140} + {"inode":141} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":142} + {"inode":143} Timeout callback:: count: 2 13: timerToUpdateProgram *new* @@ -705,7 +705,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 153 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 154 PolledWatches:: /home/src/projects/b/2/b-impl/b/node_modules/@types: @@ -820,18 +820,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 159 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 160 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 160 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 161 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 161 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 162 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -851,14 +851,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 162 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 163 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 163 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 164 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 165 { "root": [ "../src/c.ts", @@ -868,18 +868,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 166 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 167 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 167 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 168 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 168 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 169 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -900,15 +900,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 169 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 170 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 170 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 171 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 { "root": [ "../src/a.ts", @@ -960,7 +960,7 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":165} + {"inode":166} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1091,7 +1091,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 153 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 154 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -1119,11 +1119,11 @@ PolledWatches *deleted*:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":165} + {"inode":166} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":167} + {"inode":168} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":169} + {"inode":170} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1137,11 +1137,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":158} + {"inode":159} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":160} + {"inode":161} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":162} + {"inode":163} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js index e4e2bd9cd6ef9..4be5a86db0738 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js @@ -88,18 +88,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 139 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 140 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 140 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 141 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 141 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 142 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -119,14 +119,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 142 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 143 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 143 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 144 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 144 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 145 { "root": [ "../src/c.ts", @@ -136,18 +136,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 146 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 147 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 147 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 148 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 148 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 149 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -168,15 +168,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 149 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 150 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 150 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 151 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 151 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 152 { "root": [ "../src/a.ts", @@ -291,7 +291,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 unde Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/b/2/b-impl/b/src 1 undefined Wild card directory -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 153 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] Inode:: 154 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -313,9 +313,9 @@ PolledWatches:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":147} + {"inode":148} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":149} + {"inode":150} /home/src/projects/a/1/a-impl/a/package.json: *new* {"inode":24} /home/src/projects/b/2/b-impl/b/src/index.ts: *new* @@ -323,9 +323,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: *new* {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":140} + {"inode":141} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":142} + {"inode":143} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: *new* @@ -385,7 +385,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 154 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 155 export const a = 10; @@ -414,7 +414,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 155 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 156 export const a = 10; @@ -443,7 +443,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in a Input:: -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 156 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 157 export const a = 10; @@ -472,7 +472,7 @@ exitCode:: ExitStatus.undefined Change:: change in unrelated folder in c Input:: -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 157 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 158 export const a = 10; @@ -611,13 +611,13 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":147} + {"inode":148} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":149} + {"inode":150} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":140} + {"inode":141} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":142} + {"inode":143} FsWatchesRecursive:: /home/src/projects/a: @@ -747,7 +747,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 153 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 154 PolledWatches:: /home/src/projects/b/2/b-impl/b/node_modules/@types: @@ -843,18 +843,18 @@ exitCode:: ExitStatus.undefined Change:: Build dependencies Input:: -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 159 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 160 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 160 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 161 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 161 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 162 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -874,14 +874,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 162 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 163 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 163 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 164 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 165 { "root": [ "../src/c.ts", @@ -891,18 +891,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 166 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 167 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 167 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 168 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 168 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 169 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -923,15 +923,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 169 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 170 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 170 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 171 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 { "root": [ "../src/a.ts", @@ -1077,7 +1077,7 @@ src/index.ts -//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 153 +//// [/home/src/projects/b/2/b-impl/b/lib/index.js] file written with same contents Inode:: 154 PolledWatches:: /home/src/projects/a/1/a-impl/a/lib/node_modules: *new* @@ -1105,9 +1105,9 @@ PolledWatches *deleted*:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":167} + {"inode":168} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":169} + {"inode":170} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b/2/b-impl/b/src/index.ts: @@ -1115,9 +1115,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":160} + {"inode":161} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":162} + {"inode":163} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true-useFsEventsOnParentDirectory.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true-useFsEventsOnParentDirectory.js index 529f77d063d79..c7f8464520dcf 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true-useFsEventsOnParentDirectory.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true-useFsEventsOnParentDirectory.js @@ -46,7 +46,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node -//// [/user/username/projects/myproject/main.js] Inode:: 108 +//// [/user/username/projects/myproject/main.js] Inode:: 109 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; @@ -132,7 +132,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] Inode:: 108 +//// [/user/username/projects/myproject/main.js] Inode:: 109 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.y = exports.x = void 0; diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true.js index 03e0b738bdc7a..a3f7dcdfff70b 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/fsWatchWithTimestamp-true.js @@ -46,7 +46,7 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node -//// [/user/username/projects/myproject/main.js] Inode:: 108 +//// [/user/username/projects/myproject/main.js] Inode:: 109 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; @@ -134,7 +134,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] Inode:: 108 +//// [/user/username/projects/myproject/main.js] Inode:: 109 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.y = exports.x = void 0; diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-event-ends-with-tilde.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-event-ends-with-tilde.js index e2f5092527000..6c82439fdfb7e 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-event-ends-with-tilde.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-event-ends-with-tilde.js @@ -58,7 +58,7 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myprojec -//// [/user/username/projects/myproject/main.js] Inode:: 109 +//// [/user/username/projects/myproject/main.js] Inode:: 110 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var foo_1 = require("./foo"); @@ -114,7 +114,7 @@ exitCode:: ExitStatus.undefined Change:: Replace file with rename event that introduces error Input:: -//// [/user/username/projects/myproject/foo.d.ts] Inode:: 110 +//// [/user/username/projects/myproject/foo.d.ts] Inode:: 111 export function foo2(): string; @@ -163,7 +163,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/foo.d.ts: - {"inode":110} *new* + {"inode":111} *new* /user/username/projects/myproject/main.ts: {"inode":5} /user/username/projects/myproject/tsconfig.json: @@ -204,7 +204,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 109 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 110 Timeout callback:: count: 0 9: timerToInvalidateFailedLookupResolutions *deleted* @@ -238,7 +238,7 @@ exitCode:: ExitStatus.undefined Change:: Replace file with rename event that fixes error Input:: -//// [/user/username/projects/myproject/foo.d.ts] Inode:: 111 +//// [/user/username/projects/myproject/foo.d.ts] Inode:: 112 export function foo(): string; @@ -287,7 +287,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/foo.d.ts: - {"inode":111} *new* + {"inode":112} *new* /user/username/projects/myproject/main.ts: {"inode":5} /user/username/projects/myproject/tsconfig.json: @@ -295,7 +295,7 @@ FsWatches:: FsWatches *deleted*:: /user/username/projects/myproject/foo.d.ts: - {"inode":110} + {"inode":111} Timeout callback:: count: 2 16: timerToUpdateProgram *new* @@ -318,7 +318,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 109 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 110 Timeout callback:: count: 0 18: timerToInvalidateFailedLookupResolutions *deleted* diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-occurs-when-file-is-still-on-the-disk.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-occurs-when-file-is-still-on-the-disk.js index a7e75b38541e6..dbd390e67dbcb 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-occurs-when-file-is-still-on-the-disk.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode-when-rename-occurs-when-file-is-still-on-the-disk.js @@ -54,12 +54,12 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node -//// [/user/username/projects/myproject/foo.js] Inode:: 109 +//// [/user/username/projects/myproject/foo.js] Inode:: 110 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/user/username/projects/myproject/main.js] Inode:: 110 +//// [/user/username/projects/myproject/main.js] Inode:: 111 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var foo_1 = require("./foo"); @@ -113,7 +113,7 @@ exitCode:: ExitStatus.undefined Change:: Introduce error such that when callback happens file is already appeared Input:: -//// [/user/username/projects/myproject/foo.ts] Inode:: 111 +//// [/user/username/projects/myproject/foo.ts] Inode:: 112 export declare function foo2(): string; @@ -173,8 +173,8 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/foo.js] file written with same contents Inode:: 109 -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 110 +//// [/user/username/projects/myproject/foo.js] file written with same contents Inode:: 110 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 111 Program root files: [ @@ -205,7 +205,7 @@ exitCode:: ExitStatus.undefined Change:: Replace file with rename event that fixes error Input:: -//// [/user/username/projects/myproject/foo.ts] Inode:: 112 +//// [/user/username/projects/myproject/foo.ts] Inode:: 113 export declare function foo(): string; @@ -234,7 +234,7 @@ FsWatches:: /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":13} /user/username/projects/myproject/foo.ts: - {"inode":112} *new* + {"inode":113} *new* /user/username/projects/myproject/main.ts: {"inode":5} /user/username/projects/myproject/tsconfig.json: @@ -263,8 +263,8 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/foo.js] file written with same contents Inode:: 109 -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 110 +//// [/user/username/projects/myproject/foo.js] file written with same contents Inode:: 110 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 111 Program root files: [ diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode.js index 7bf3603ccdffa..2ae73d17a3697 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsWatch/when-using-file-watching-thats-on-inode.js @@ -58,7 +58,7 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /user/username/projects/myprojec -//// [/user/username/projects/myproject/main.js] Inode:: 109 +//// [/user/username/projects/myproject/main.js] Inode:: 110 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var foo_1 = require("./foo"); @@ -114,7 +114,7 @@ exitCode:: ExitStatus.undefined Change:: Replace file with rename event that introduces error Input:: -//// [/user/username/projects/myproject/foo.d.ts] Inode:: 110 +//// [/user/username/projects/myproject/foo.d.ts] Inode:: 111 export function foo2(): string; @@ -151,7 +151,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/foo.d.ts: - {"inode":110} *new* + {"inode":111} *new* /user/username/projects/myproject/main.ts: {"inode":5} /user/username/projects/myproject/tsconfig.json: @@ -192,7 +192,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 109 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 110 Timeout callback:: count: 0 5: timerToInvalidateFailedLookupResolutions *deleted* @@ -226,7 +226,7 @@ exitCode:: ExitStatus.undefined Change:: Replace file with rename event that fixes error Input:: -//// [/user/username/projects/myproject/foo.d.ts] Inode:: 111 +//// [/user/username/projects/myproject/foo.d.ts] Inode:: 112 export function foo(): string; @@ -263,7 +263,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/foo.d.ts: - {"inode":111} *new* + {"inode":112} *new* /user/username/projects/myproject/main.ts: {"inode":5} /user/username/projects/myproject/tsconfig.json: @@ -271,7 +271,7 @@ FsWatches:: FsWatches *deleted*:: /user/username/projects/myproject/foo.d.ts: - {"inode":110} + {"inode":111} Timeout callback:: count: 2 9: timerToUpdateProgram *new* @@ -294,7 +294,7 @@ CreatingProgramWith:: -//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 109 +//// [/user/username/projects/myproject/main.js] file written with same contents Inode:: 110 Timeout callback:: count: 0 10: timerToInvalidateFailedLookupResolutions *deleted* diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js index 73df3b79f64c4..6fe8b973aebff 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js @@ -35,7 +35,7 @@ Output:: -//// [/a/username/projects/project/src/file1.js] Inode:: 109 +//// [/a/username/projects/project/src/file1.js] Inode:: 110 @@ -75,7 +75,7 @@ exitCode:: ExitStatus.undefined Change:: Rename file1 to file2 Input:: -//// [/a/username/projects/project/src/file2.ts] Inode:: 110 +//// [/a/username/projects/project/src/file2.ts] Inode:: 111 //// [/a/username/projects/project/src/file1.ts] deleted @@ -129,7 +129,7 @@ Output:: -//// [/a/username/projects/project/src/file2.js] Inode:: 111 +//// [/a/username/projects/project/src/file2.js] Inode:: 112 @@ -139,7 +139,7 @@ PolledWatches *deleted*:: FsWatches:: /a/username/projects/project/src/file2.ts: *new* - {"inode":110} + {"inode":111} /a/username/projects/project/tsconfig.json: {"inode":7} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js index a42416c7d1cb8..c2eed780bf9b1 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js @@ -35,7 +35,7 @@ Output:: -//// [/a/username/projects/project/src/file1.js] Inode:: 109 +//// [/a/username/projects/project/src/file1.js] Inode:: 110 @@ -82,7 +82,7 @@ exitCode:: ExitStatus.undefined Change:: Rename file1 to file2 Input:: -//// [/a/username/projects/project/src/file2.ts] Inode:: 110 +//// [/a/username/projects/project/src/file2.ts] Inode:: 111 //// [/a/username/projects/project/src/file1.ts] deleted @@ -129,7 +129,7 @@ Output:: -//// [/a/username/projects/project/src/file2.js] Inode:: 111 +//// [/a/username/projects/project/src/file2.js] Inode:: 112 @@ -149,7 +149,7 @@ FsWatches:: /a/username/projects/project/src: {"inode":5} /a/username/projects/project/src/file2.ts: *new* - {"inode":110} + {"inode":111} /a/username/projects/project/tsconfig.json: {"inode":7} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js index 6f37e99c0ea28..41a25759646d0 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js @@ -35,7 +35,7 @@ Output:: -//// [/a/username/projects/project/src/file1.js] Inode:: 109 +//// [/a/username/projects/project/src/file1.js] Inode:: 110 @@ -82,7 +82,7 @@ exitCode:: ExitStatus.undefined Change:: Rename file1 to file2 Input:: -//// [/a/username/projects/project/src/file2.ts] Inode:: 110 +//// [/a/username/projects/project/src/file2.ts] Inode:: 111 //// [/a/username/projects/project/src/file1.ts] deleted @@ -129,7 +129,7 @@ Output:: -//// [/a/username/projects/project/src/file2.js] Inode:: 111 +//// [/a/username/projects/project/src/file2.js] Inode:: 112 @@ -149,7 +149,7 @@ PolledWatches *deleted*:: FsWatches:: /a/username/projects/project/src/file2.ts: *new* - {"inode":110} + {"inode":111} /a/username/projects/project/tsconfig.json: {"inode":7} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders-with-synchronousWatchDirectory.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders-with-synchronousWatchDirectory.js index ce9d0b341d227..a3621606d84a9 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders-with-synchronousWatchDirectory.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders-with-synchronousWatchDirectory.js @@ -100,7 +100,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/user/projects/myproject 1 {"synchron Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/user/projects/myproject 1 {"synchronousWatchDirectory":true} Wild card directory -//// [/home/user/projects/myproject/src/file.js] Inode:: 119 +//// [/home/user/projects/myproject/src/file.js] Inode:: 120 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -315,7 +315,7 @@ FileWatcher:: Close:: WatchInfo: /home/user/projects/package.json 2000 {"synchro -//// [/home/user/projects/myproject/src/file.js] file written with same contents Inode:: 119 +//// [/home/user/projects/myproject/src/file.js] file written with same contents Inode:: 120 PolledWatches:: /home/user/projects/myproject/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js index afc7cc6d67471..79f2d712be647 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js @@ -95,7 +95,7 @@ DirectoryWatcher:: Added:: WatchInfo: /home/user/projects/myproject 1 undefined Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/user/projects/myproject 1 undefined Wild card directory -//// [/home/user/projects/myproject/src/file.js] Inode:: 119 +//// [/home/user/projects/myproject/src/file.js] Inode:: 120 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -321,7 +321,7 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /home/user/projects/myproject/no sysLog:: Elapsed:: *ms:: onTimerToUpdateChildWatches:: 0 undefined -//// [/home/user/projects/myproject/src/file.js] file written with same contents Inode:: 119 +//// [/home/user/projects/myproject/src/file.js] file written with same contents Inode:: 120 PolledWatches:: /home/user/projects/myproject/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js index 26d544a743fea..c58a99d5f97f1 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js @@ -38,14 +38,14 @@ Output:: -//// [/user/username/projects/myproject/dist/file2.js] Inode:: 111 +//// [/user/username/projects/myproject/dist/file2.js] Inode:: 112 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; exports.x = 10; -//// [/user/username/projects/myproject/dist/file1.js] Inode:: 112 +//// [/user/username/projects/myproject/dist/file1.js] Inode:: 113 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -63,7 +63,7 @@ FsWatches:: /user/username/projects/myproject: *new* {"inode":4} /user/username/projects/myproject/dist: *new* - {"inode":110} + {"inode":111} /user/username/projects/myproject/src: *new* {"inode":5} /user/username/projects/myproject/src/file1.ts: *new* @@ -110,7 +110,7 @@ exitCode:: ExitStatus.undefined Change:: rename the file Input:: -//// [/user/username/projects/myproject/src/renamed.ts] Inode:: 113 +//// [/user/username/projects/myproject/src/renamed.ts] Inode:: 114 export const x = 10; //// [/user/username/projects/myproject/src/file2.ts] deleted @@ -133,7 +133,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/dist: - {"inode":110} + {"inode":111} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: @@ -167,7 +167,7 @@ Output:: -//// [/user/username/projects/myproject/dist/file1.js] file written with same contents Inode:: 112 +//// [/user/username/projects/myproject/dist/file1.js] file written with same contents Inode:: 113 PolledWatches:: /user/username/projects/myproject/node_modules/@types: @@ -187,7 +187,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/dist: - {"inode":110} + {"inode":111} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: @@ -250,7 +250,7 @@ Output:: -//// [/user/username/projects/myproject/dist/renamed.js] Inode:: 114 +//// [/user/username/projects/myproject/dist/renamed.js] Inode:: 115 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; @@ -274,13 +274,13 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/dist: - {"inode":110} + {"inode":111} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: {"inode":6} /user/username/projects/myproject/src/renamed.ts: *new* - {"inode":113} + {"inode":114} /user/username/projects/myproject/tsconfig.json: {"inode":8} diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js index 578cc12c41415..31654cb546b63 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js @@ -39,12 +39,12 @@ Output:: -//// [/user/username/projects/myproject/dist/file1.js] Inode:: 113 +//// [/user/username/projects/myproject/dist/file1.js] Inode:: 114 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/user/username/projects/myproject/dist/file1.d.ts] Inode:: 114 +//// [/user/username/projects/myproject/dist/file1.d.ts] Inode:: 115 export {}; @@ -69,7 +69,7 @@ FsWatches:: /user/username/projects/myproject: *new* {"inode":4} /user/username/projects/myproject/dist: *new* - {"inode":112} + {"inode":113} /user/username/projects/myproject/node_modules: *new* {"inode":7} /user/username/projects/myproject/node_modules/file2: *new* @@ -120,7 +120,7 @@ exitCode:: ExitStatus.undefined Change:: Add new file, should schedule and run timeout to update directory watcher Input:: -//// [/user/username/projects/myproject/src/file3.ts] Inode:: 115 +//// [/user/username/projects/myproject/src/file3.ts] Inode:: 116 export const y = 10; @@ -158,14 +158,14 @@ Output:: -//// [/user/username/projects/myproject/dist/file3.js] Inode:: 116 +//// [/user/username/projects/myproject/dist/file3.js] Inode:: 117 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.y = void 0; exports.y = 10; -//// [/user/username/projects/myproject/dist/file3.d.ts] Inode:: 117 +//// [/user/username/projects/myproject/dist/file3.d.ts] Inode:: 118 export declare const y = 10; @@ -190,7 +190,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/dist: - {"inode":112} + {"inode":113} /user/username/projects/myproject/node_modules: {"inode":7} /user/username/projects/myproject/node_modules/file2: @@ -202,7 +202,7 @@ FsWatches:: /user/username/projects/myproject/src/file1.ts: {"inode":6} /user/username/projects/myproject/src/file3.ts: *new* - {"inode":115} + {"inode":116} /user/username/projects/myproject/tsconfig.json: {"inode":10} diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js index 95bcc66b5cf11..09e93ff2ffb48 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js @@ -34,7 +34,7 @@ Output:: -//// [/user/username/projects/myproject/src/file1.js] Inode:: 112 +//// [/user/username/projects/myproject/src/file1.js] Inode:: 113 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -187,7 +187,7 @@ Output:: -//// [/user/username/projects/myproject/src/file1.js] file written with same contents Inode:: 112 +//// [/user/username/projects/myproject/src/file1.js] file written with same contents Inode:: 113 PolledWatches:: /user/username/projects/myproject/node_modules: @@ -337,7 +337,7 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/node_modules: *new* - {"inode":113} + {"inode":114} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: @@ -365,7 +365,7 @@ exitCode:: ExitStatus.undefined Change:: npm install index file in file2 Input:: -//// [/user/username/projects/myproject/node_modules/file2/index.d.ts] Inode:: 115 +//// [/user/username/projects/myproject/node_modules/file2/index.d.ts] Inode:: 116 export const x = 10; @@ -395,9 +395,9 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/node_modules: - {"inode":113} -/user/username/projects/myproject/node_modules/file2: *new* {"inode":114} +/user/username/projects/myproject/node_modules/file2: *new* + {"inode":115} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: @@ -447,7 +447,7 @@ Output:: -//// [/user/username/projects/myproject/src/file1.js] file written with same contents Inode:: 112 +//// [/user/username/projects/myproject/src/file1.js] file written with same contents Inode:: 113 PolledWatches:: /user/username/projects/myproject/node_modules/@types: @@ -473,11 +473,11 @@ FsWatches:: /user/username/projects/myproject: {"inode":4} /user/username/projects/myproject/node_modules: - {"inode":113} -/user/username/projects/myproject/node_modules/file2: {"inode":114} -/user/username/projects/myproject/node_modules/file2/index.d.ts: *new* +/user/username/projects/myproject/node_modules/file2: {"inode":115} +/user/username/projects/myproject/node_modules/file2/index.d.ts: *new* + {"inode":116} /user/username/projects/myproject/src: {"inode":5} /user/username/projects/myproject/src/file1.ts: diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching-extendedDiagnostics.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching-extendedDiagnostics.js index 8a49616b9b82c..49d327ce12280 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching-extendedDiagnostics.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching-extendedDiagnostics.js @@ -75,7 +75,7 @@ DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {"excl Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 {"excludeDirectories":["/user/username/projects/myproject/**/temp"]} Wild card directory -//// [/user/username/projects/myproject/src/main.js] Inode:: 116 +//// [/user/username/projects/myproject/src/main.js] Inode:: 117 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var bar_1 = require("bar"); @@ -175,7 +175,7 @@ exitCode:: ExitStatus.undefined Change:: add new folder to temp Input:: -//// [/user/username/projects/myproject/node_modules/bar/temp/fooBar/index.d.ts] Inode:: 118 +//// [/user/username/projects/myproject/node_modules/bar/temp/fooBar/index.d.ts] Inode:: 119 export function temp(): string; diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching.js index 9aea9607c9c2a..12063ba07e99b 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-excludeDirectories-option-with-recursive-directory-watching.js @@ -52,7 +52,7 @@ Output:: -//// [/user/username/projects/myproject/src/main.js] Inode:: 116 +//// [/user/username/projects/myproject/src/main.js] Inode:: 117 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var bar_1 = require("bar"); @@ -140,7 +140,7 @@ exitCode:: ExitStatus.undefined Change:: add new folder to temp Input:: -//// [/user/username/projects/myproject/node_modules/bar/temp/fooBar/index.d.ts] Inode:: 118 +//// [/user/username/projects/myproject/node_modules/bar/temp/fooBar/index.d.ts] Inode:: 119 export function temp(): string; diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js index 40d9e621d30ff..2568ba92a11b9 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js @@ -43,11 +43,11 @@ sysLog:: /home/src/tslibs/TS/Lib/lib.d.ts:: Changing to watchFile sysLog:: /user/username/projects/project:: Changing to watchFile -//// [/user/username/projects/project/commonFile1.js] Inode:: 109 +//// [/user/username/projects/project/commonFile1.js] Inode:: 110 var x = 1; -//// [/user/username/projects/project/commonFile2.js] Inode:: 110 +//// [/user/username/projects/project/commonFile2.js] Inode:: 111 var y = 1; diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js index a76bc0caf6f85..2d7d2509c0cd9 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js @@ -38,11 +38,11 @@ Output:: -//// [/user/username/projects/project/commonFile1.js] Inode:: 109 +//// [/user/username/projects/project/commonFile1.js] Inode:: 110 var x = 1; -//// [/user/username/projects/project/commonFile2.js] Inode:: 110 +//// [/user/username/projects/project/commonFile2.js] Inode:: 111 var y = 1; diff --git a/tests/baselines/reference/tsserver/projectErrors/file-rename-on-wsl2.js b/tests/baselines/reference/tsserver/projectErrors/file-rename-on-wsl2.js index 2e5a5bbc6b625..0d7ba63f90f38 100644 --- a/tests/baselines/reference/tsserver/projectErrors/file-rename-on-wsl2.js +++ b/tests/baselines/reference/tsserver/projectErrors/file-rename-on-wsl2.js @@ -217,7 +217,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/username/workspaces/project/tsconfig.j Info seq [hh:mm:ss:mss] Scheduled: *ensureProjectForOpenFiles* Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/username/workspaces/project/src/b.ts 2:: WatchInfo: /home/username/workspaces/project/src/b.ts 500 undefined WatchType: Closed Script info Before request -//// [/home/username/workspaces/project/src/c.ts] Inode:: 112 +//// [/home/username/workspaces/project/src/c.ts] Inode:: 113 export const b = 10; //// [/home/username/workspaces/project/src/b.ts] deleted @@ -495,7 +495,7 @@ FsWatches:: /home/username/workspaces/project/src: {"inode":5} /home/username/workspaces/project/src/c.ts: *new* - {"inode":112} + {"inode":113} /home/username/workspaces/project/tsconfig.json: {"inode":8} diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location-with-currentDirectory-at-root.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location-with-currentDirectory-at-root.js index 09bfef7dfce0c..fb8753c61c8fa 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location-with-currentDirectory-at-root.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location-with-currentDirectory-at-root.js @@ -87,12 +87,12 @@ Info seq [hh:mm:ss:mss] Files (2) Info seq [hh:mm:ss:mss] ----------------------------------------------- TI:: Creating typing installer -//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 11 +//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 12 FsWatches:: /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: *new* - {"inode":11} + {"inode":12} Projects:: /dev/null/inferredProject1* (Inferred) *new* @@ -119,10 +119,10 @@ TI:: [hh:mm:ss:mss] Updating types-registry npm package... TI:: [hh:mm:ss:mss] npm install --ignore-scripts types-registry@latest TI:: [hh:mm:ss:mss] Updated types-registry npm package TI:: typing installer creation complete -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 105 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 106 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 108 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 109 { "entries": {} } diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location.js index 177a19a9dc8cb..a8208082277bf 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-fails-in-global-typings-location.js @@ -122,7 +122,7 @@ Info seq [hh:mm:ss:mss] Files (2) Info seq [hh:mm:ss:mss] ----------------------------------------------- TI:: Creating typing installer -//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 14 +//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 15 PolledWatches:: @@ -149,7 +149,7 @@ FsWatches:: /home/src/Vscode/Projects/bin: *new* {"inode":5} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: *new* - {"inode":14} + {"inode":15} Projects:: /dev/null/inferredProject1* (Inferred) *new* @@ -176,10 +176,10 @@ TI:: [hh:mm:ss:mss] Updating types-registry npm package... TI:: [hh:mm:ss:mss] npm install --ignore-scripts types-registry@latest TI:: [hh:mm:ss:mss] Updated types-registry npm package TI:: typing installer creation complete -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 108 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 109 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 111 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 112 { "entries": {} } @@ -342,7 +342,7 @@ FsWatches:: /home/src/Vscode/Projects/bin: {"inode":5} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: - {"inode":14} + {"inode":15} Projects:: /dev/null/inferredProject1* (Inferred) *changed* diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing-with-currentDirectory-at-root.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing-with-currentDirectory-at-root.js index 040df42e480af..707552ade6efc 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing-with-currentDirectory-at-root.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing-with-currentDirectory-at-root.js @@ -23,10 +23,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 109 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 110 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 111 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 112 { "entries": {} } @@ -140,7 +140,7 @@ Info seq [hh:mm:ss:mss] Files (3) Info seq [hh:mm:ss:mss] ----------------------------------------------- TI:: Creating typing installer -//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 18 +//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 19 PolledWatches:: @@ -153,9 +153,9 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":109} + {"inode":110} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: *new* - {"inode":18} + {"inode":19} FsWatchesRecursive:: /home/src/Library/Caches/typescript/node_modules: *new* diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing.js index 00278e2746506..00cc24e1b8d7a 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-failing.js @@ -23,10 +23,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 112 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 113 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 114 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 115 { "entries": {} } @@ -175,7 +175,7 @@ Info seq [hh:mm:ss:mss] Files (3) Info seq [hh:mm:ss:mss] ----------------------------------------------- TI:: Creating typing installer -//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 21 +//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 22 PolledWatches:: @@ -202,7 +202,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":112} + {"inode":113} /home/src/Vscode: *new* {"inode":10} /home/src/Vscode/Projects: *new* @@ -210,7 +210,7 @@ FsWatches:: /home/src/Vscode/Projects/bin: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: *new* - {"inode":21} + {"inode":22} FsWatchesRecursive:: /home/src/Library/Caches/typescript/node_modules: *new* @@ -402,7 +402,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: - {"inode":112} + {"inode":113} /home/src/Vscode: {"inode":10} /home/src/Vscode/Projects: @@ -410,7 +410,7 @@ FsWatches:: /home/src/Vscode/Projects/bin: {"inode":12} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: - {"inode":21} + {"inode":22} FsWatchesRecursive:: /home/src/Library/Caches/typescript/node_modules: diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-with-currentDirectory-at-root.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-with-currentDirectory-at-root.js index b656984c4d9c8..1168c71b878c5 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-with-currentDirectory-at-root.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file-with-currentDirectory-at-root.js @@ -27,10 +27,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 111 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 112 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 113 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 114 { "entries": {} } @@ -147,7 +147,7 @@ Info seq [hh:mm:ss:mss] Files (4) Info seq [hh:mm:ss:mss] ----------------------------------------------- TI:: Creating typing installer -//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 20 +//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 21 PolledWatches:: @@ -162,9 +162,9 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":111} + {"inode":112} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: *new* - {"inode":20} + {"inode":21} FsWatchesRecursive:: /home/src/Library/Caches/typescript/node_modules: *new* diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file.js index da4b54c4122c3..d98db532fd95c 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-import-from-the-cache-file.js @@ -27,10 +27,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 114 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 115 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 116 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 117 { "entries": {} } @@ -182,7 +182,7 @@ Info seq [hh:mm:ss:mss] Files (4) Info seq [hh:mm:ss:mss] ----------------------------------------------- TI:: Creating typing installer -//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 23 +//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 24 PolledWatches:: @@ -211,7 +211,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":114} + {"inode":115} /home/src/Vscode: *new* {"inode":12} /home/src/Vscode/Projects: *new* @@ -219,7 +219,7 @@ FsWatches:: /home/src/Vscode/Projects/bin: *new* {"inode":14} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: *new* - {"inode":23} + {"inode":24} FsWatchesRecursive:: /home/src/Library/Caches/typescript/node_modules: *new* @@ -407,7 +407,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: - {"inode":114} + {"inode":115} /home/src/Vscode: {"inode":12} /home/src/Vscode/Projects: @@ -415,7 +415,7 @@ FsWatches:: /home/src/Vscode/Projects/bin: {"inode":14} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: - {"inode":23} + {"inode":24} FsWatchesRecursive:: /home/src/Library/Caches/typescript/node_modules: diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file-with-currentDirectory-at-root.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file-with-currentDirectory-at-root.js index c6aa628a602ea..1324c92540416 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file-with-currentDirectory-at-root.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file-with-currentDirectory-at-root.js @@ -27,10 +27,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 110 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 111 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 112 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 113 { "entries": {} } @@ -136,7 +136,7 @@ Info seq [hh:mm:ss:mss] Files (4) Info seq [hh:mm:ss:mss] ----------------------------------------------- TI:: Creating typing installer -//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 19 +//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 20 PolledWatches:: @@ -149,9 +149,9 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":110} + {"inode":111} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: *new* - {"inode":19} + {"inode":20} FsWatchesRecursive:: /home/src/Library/Caches/typescript/node_modules: *new* diff --git a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file.js b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file.js index c640d83a04ace..709c453c8067b 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file.js +++ b/tests/baselines/reference/tsserver/resolutionCache/when-resolution-is-succeeds-in-global-typings-location-with-relative-import-from-the-cache-file.js @@ -27,10 +27,10 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/Library/Caches/typescript/package.json] Inode:: 113 +//// [/home/src/Library/Caches/typescript/package.json] Inode:: 114 { "private": true } -//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 115 +//// [/home/src/Library/Caches/typescript/node_modules/types-registry/index.json] Inode:: 116 { "entries": {} } @@ -171,7 +171,7 @@ Info seq [hh:mm:ss:mss] Files (4) Info seq [hh:mm:ss:mss] ----------------------------------------------- TI:: Creating typing installer -//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 22 +//// [/home/src/tslibs/TS/Lib/lib.es2020.full.d.ts] *Lib* Inode:: 23 PolledWatches:: @@ -198,7 +198,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: *new* - {"inode":113} + {"inode":114} /home/src/Vscode: *new* {"inode":11} /home/src/Vscode/Projects: *new* @@ -206,7 +206,7 @@ FsWatches:: /home/src/Vscode/Projects/bin: *new* {"inode":13} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: *new* - {"inode":22} + {"inode":23} FsWatchesRecursive:: /home/src/Library/Caches/typescript/node_modules: *new* @@ -392,7 +392,7 @@ PolledWatches:: FsWatches:: /home/src/Library/Caches/typescript/package.json: - {"inode":113} + {"inode":114} /home/src/Vscode: {"inode":11} /home/src/Vscode/Projects: @@ -400,7 +400,7 @@ FsWatches:: /home/src/Vscode/Projects/bin: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts: - {"inode":22} + {"inode":23} FsWatchesRecursive:: /home/src/Library/Caches/typescript/node_modules: diff --git a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux-canUseWatchEvents.js index a6d432bcb9d2c..e2666b14e05c0 100644 --- a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux-canUseWatchEvents.js @@ -508,7 +508,7 @@ Info seq [hh:mm:ss:mss] response: } } After request -//// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 33 +//// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 34 PolledWatches:: @@ -707,20 +707,20 @@ Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/p Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo.readable.baseline.txt created Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo.readable.baseline.txt updated Before request -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 121 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 122 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 122 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 123 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 123 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 124 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 124 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 125 { "root": [ "./src/index.ts" @@ -1470,14 +1470,14 @@ Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/p Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo updated Custom watchDirectory:: Triggered Ignored:: {"id":8,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo.readable.baseline.txt updated Before request -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 123 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 124 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 126 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 124 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 125 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 export type FooType = "foo"; export type BarType = "bar"; diff --git a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux.js b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux.js index 229fdf9253bd6..42816a946128d 100644 --- a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux.js +++ b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-Linux.js @@ -325,7 +325,7 @@ Info seq [hh:mm:ss:mss] response: } } After request -//// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 33 +//// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 34 PolledWatches:: @@ -364,7 +364,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: *new* {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: *new* - {"inode":33} + {"inode":34} Projects:: /home/src/projects/project/packages/package2/tsconfig.json (Configured) *new* @@ -517,20 +517,20 @@ After running Immedidate callback:: count: 0 Build dependencies Before running Timeout callback:: count: 1 7: timerToUpdateChildWatches -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 121 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 122 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 122 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 123 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 123 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 124 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 124 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 125 { "root": [ "./src/index.ts" @@ -576,7 +576,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":120} + {"inode":121} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -590,7 +590,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":33} + {"inode":34} Timeout callback:: count: 1 9: /home/src/projects/project/packages/package2/tsconfig.jsonFailedLookupInvalidation *new* @@ -718,9 +718,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":120} + {"inode":121} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -734,7 +734,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":33} + {"inode":34} Projects:: /home/src/projects/project/packages/package2/tsconfig.json (Configured) *changed* @@ -925,13 +925,13 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":33} + {"inode":34} FsWatches *deleted*:: /home/src/projects/project/packages/package1/dist: - {"inode":120} + {"inode":121} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":122} + {"inode":123} Timeout callback:: count: 3 13: /home/src/projects/project/packages/package2/tsconfig.json *new* @@ -1124,7 +1124,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":33} + {"inode":34} Timeout callback:: count: 1 20: /home/src/projects/project/packages/package2/tsconfig.jsonFailedLookupInvalidation *new* @@ -1411,14 +1411,14 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /home/src/projects/project Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/project/packages/package1/dist/index.d.ts 0:: WatchInfo: /home/src/projects/project/packages/package1/dist/index.d.ts 500 undefined WatchType: Closed Script info Before running Timeout callback:: count: 1 25: timerToUpdateChildWatches -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 123 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 124 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 126 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 124 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 125 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 export type FooType = "foo"; export type BarType = "bar"; @@ -1452,7 +1452,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1466,7 +1466,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":33} + {"inode":34} Timeout callback:: count: 1 25: timerToUpdateChildWatches *new* @@ -1518,9 +1518,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1534,7 +1534,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":33} + {"inode":34} Timeout callback:: count: 1 27: /home/src/projects/project/packages/package2/tsconfig.jsonFailedLookupInvalidation *new* @@ -1660,9 +1660,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1676,7 +1676,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":33} + {"inode":34} Projects:: /home/src/projects/project/packages/package2/tsconfig.json (Configured) *changed* diff --git a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux-canUseWatchEvents.js index fe58e8de15844..3359f57d47592 100644 --- a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux-canUseWatchEvents.js @@ -85,22 +85,22 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 33 +//// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 34 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 121 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 122 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 122 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 123 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 123 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 124 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 124 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 125 { "root": [ "./src/index.ts" @@ -1066,14 +1066,14 @@ Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/p Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo updated Custom watchDirectory:: Triggered Ignored:: {"id":9,"path":"/home/src/projects/project/node_modules/package1","recursive":true,"ignoreUpdate":true}:: /home/src/projects/project/node_modules/package1/tsconfig.tsbuildinfo.readable.baseline.txt updated Before request -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 123 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 124 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 126 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 124 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 125 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 export type FooType = "foo"; export type BarType = "bar"; diff --git a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js index e769a091e4c7e..d2da3cf86bdfc 100644 --- a/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js +++ b/tests/baselines/reference/tsserver/symLinks/monorepo-style-sibling-packages-symlinked-package1-built-Linux.js @@ -85,22 +85,22 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 33 +//// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 34 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 121 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 122 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 122 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 123 export type FooType = "foo"; export type BarType = "bar"; -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 123 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 124 {"root":["./src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 124 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 125 { "root": [ "./src/index.ts" @@ -327,9 +327,9 @@ FsWatches:: /home/src/projects/project/packages/package1: *new* {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":120} + {"inode":121} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":122} + {"inode":123} /home/src/projects/project/packages/package1/package.json: *new* {"inode":7} /home/src/projects/project/packages/package1/src: *new* @@ -343,7 +343,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: *new* {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: *new* - {"inode":33} + {"inode":34} Projects:: /home/src/projects/project/packages/package2/tsconfig.json (Configured) *new* @@ -533,13 +533,13 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":33} + {"inode":34} FsWatches *deleted*:: /home/src/projects/project/packages/package1/dist: - {"inode":120} + {"inode":121} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":122} + {"inode":123} Timeout callback:: count: 3 2: /home/src/projects/project/packages/package2/tsconfig.json *new* @@ -736,7 +736,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":33} + {"inode":34} Timeout callback:: count: 1 9: /home/src/projects/project/packages/package2/tsconfig.jsonFailedLookupInvalidation *new* @@ -1024,14 +1024,14 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /home/src/projects/project Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/project/packages/package1/dist/index.d.ts 0:: WatchInfo: /home/src/projects/project/packages/package1/dist/index.d.ts 500 undefined WatchType: Closed Script info Before running Timeout callback:: count: 1 14: timerToUpdateChildWatches -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 123 -//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 124 -//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 126 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 124 +//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 125 +//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 127 +//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128 export type FooType = "foo"; export type BarType = "bar"; @@ -1065,7 +1065,7 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist/index.d.ts: *new* - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1079,7 +1079,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":33} + {"inode":34} Timeout callback:: count: 1 14: timerToUpdateChildWatches *new* @@ -1131,9 +1131,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: *new* - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1147,7 +1147,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":33} + {"inode":34} Timeout callback:: count: 1 16: /home/src/projects/project/packages/package2/tsconfig.jsonFailedLookupInvalidation *new* @@ -1273,9 +1273,9 @@ FsWatches:: /home/src/projects/project/packages/package1: {"inode":6} /home/src/projects/project/packages/package1/dist: - {"inode":125} + {"inode":126} /home/src/projects/project/packages/package1/dist/index.d.ts: - {"inode":127} + {"inode":128} /home/src/projects/project/packages/package1/package.json: {"inode":7} /home/src/projects/project/packages/package1/src: @@ -1289,7 +1289,7 @@ FsWatches:: /home/src/projects/project/packages/package2/tsconfig.json: {"inode":13} /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: - {"inode":33} + {"inode":34} Projects:: /home/src/projects/project/packages/package2/tsconfig.json (Configured) *changed* diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux-canUseWatchEvents.js index 0c627935951ff..cb9ca8fd83021 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux-canUseWatchEvents.js @@ -602,7 +602,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 141 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 142 export const a = 10; @@ -732,7 +732,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 142 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 143 export const a = 10; @@ -882,18 +882,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":5,"path":"/home/src/projects/b Custom watchDirectory:: Triggered Ignored:: {"id":5,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt updated Custom watchDirectory:: Triggered Ignored:: {"id":5,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib updated Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 144 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 145 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 145 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 146 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 146 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 147 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -913,14 +913,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 148 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 149 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 150 { "root": [ "../src/c.ts", @@ -930,18 +930,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 151 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 152 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 152 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 153 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 153 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 154 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -962,15 +962,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 155 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 156 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 157 { "root": [ "../src/a.ts", @@ -1483,7 +1483,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 157 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 158 export const a = 10; @@ -1599,7 +1599,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 158 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 159 export const a = 10; @@ -2295,18 +2295,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/ Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt updated Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib updated Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 160 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 161 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 161 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 162 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 162 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 163 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -2326,14 +2326,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 163 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 164 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 165 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 166 { "root": [ "../src/c.ts", @@ -2343,18 +2343,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 167 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 168 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 168 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 169 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 169 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 170 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -2375,15 +2375,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 170 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 171 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 172 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 173 { "root": [ "../src/a.ts", diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux.js index a19f0fd0cd93d..795c65a32a3ef 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-Linux.js @@ -424,7 +424,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 141 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 142 export const a = 10; @@ -554,7 +554,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 142 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 143 export const a = 10; @@ -685,18 +685,18 @@ After running Immedidate callback:: count: 0 Build dependencies Before running Timeout callback:: count: 1 5: timerToUpdateChildWatches -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 144 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 145 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 145 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 146 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 146 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 147 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -716,14 +716,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 148 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 149 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 150 { "root": [ "../src/c.ts", @@ -733,18 +733,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 151 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 152 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 152 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 153 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 153 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 154 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -765,15 +765,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 155 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 156 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 157 { "root": [ "../src/a.ts", @@ -819,7 +819,7 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":150} + {"inode":151} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -970,11 +970,11 @@ PolledWatches *deleted*:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":150} + {"inode":151} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":152} + {"inode":153} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":154} + {"inode":155} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -986,11 +986,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":143} + {"inode":144} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":145} + {"inode":146} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":147} + {"inode":148} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: @@ -1143,7 +1143,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 157 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 158 export const a = 10; @@ -1259,7 +1259,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 158 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 159 export const a = 10; @@ -1493,17 +1493,17 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":150} + {"inode":151} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":152} + {"inode":153} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":154} + {"inode":155} /home/src/projects/c/3/c-impl/c/lib: - {"inode":143} + {"inode":144} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":145} + {"inode":146} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":147} + {"inode":148} Timeout callback:: count: 3 28: /home/src/projects/b/2/b-impl/b/tsconfig.json *new* @@ -1829,18 +1829,18 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /home/src/projects/a/1/a-i Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/a/1/a-impl/a/lib/index.d.ts 0:: WatchInfo: /home/src/projects/a/1/a-impl/a/lib/index.d.ts 500 undefined WatchType: Closed Script info Before running Timeout callback:: count: 1 37: timerToUpdateChildWatches -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 160 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 161 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 161 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 162 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 162 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 163 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1860,14 +1860,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 163 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 164 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 165 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 166 { "root": [ "../src/c.ts", @@ -1877,18 +1877,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 167 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 168 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 168 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 169 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 169 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 170 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1909,15 +1909,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 170 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 171 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 172 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 173 { "root": [ "../src/a.ts", @@ -1962,9 +1962,9 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":168} + {"inode":169} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":170} + {"inode":171} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1980,9 +1980,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":161} + {"inode":162} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":163} + {"inode":164} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -2051,11 +2051,11 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":166} + {"inode":167} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":168} + {"inode":169} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":170} + {"inode":171} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -2071,9 +2071,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":161} + {"inode":162} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":163} + {"inode":164} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -2205,11 +2205,11 @@ PolledWatches *deleted*:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":166} + {"inode":167} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":168} + {"inode":169} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":170} + {"inode":171} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -2221,11 +2221,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":159} + {"inode":160} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":161} + {"inode":162} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":163} + {"inode":164} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs-canUseWatchEvents.js index 6daf2abc71149..bfb4649ad8365 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs-canUseWatchEvents.js @@ -602,7 +602,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 141 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 142 export const a = 10; @@ -732,7 +732,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 142 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 143 export const a = 10; @@ -869,18 +869,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":5,"path":"/home/src/projects/b Custom watchDirectory:: Triggered Ignored:: {"id":5,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo created Custom watchDirectory:: Triggered Ignored:: {"id":5,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt created Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 144 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 145 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 145 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 146 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 146 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 147 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -900,14 +900,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 148 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 149 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 150 { "root": [ "../src/c.ts", @@ -917,18 +917,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 151 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 152 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 152 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 153 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 153 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 154 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -949,15 +949,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 155 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 156 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 157 { "root": [ "../src/a.ts", @@ -1470,7 +1470,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 157 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 158 export const a = 10; @@ -1586,7 +1586,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 158 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 159 export const a = 10; @@ -2269,18 +2269,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/ Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo created Custom watchDirectory:: Triggered Ignored:: {"id":25,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt created Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 160 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 161 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 161 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 162 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 162 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 163 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -2300,14 +2300,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 163 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 164 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 165 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 166 { "root": [ "../src/c.ts", @@ -2317,18 +2317,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 167 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 168 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 168 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 169 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 169 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 170 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -2349,15 +2349,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 170 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 171 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 172 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 173 { "root": [ "../src/a.ts", diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs.js index 8838800aa1c80..643dba557524f 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-MacOs.js @@ -420,7 +420,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 141 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 142 export const a = 10; @@ -550,7 +550,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 142 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 143 export const a = 10; @@ -702,18 +702,18 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt :: WatchInfo: /home/src/projects/b/2/b-impl/b/node_modules/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 10: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 144 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 145 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 145 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 146 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 146 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 147 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -733,14 +733,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 148 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 148 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 149 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 149 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 150 { "root": [ "../src/c.ts", @@ -750,18 +750,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 151 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 152 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 152 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 153 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 153 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 154 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -782,15 +782,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 155 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 155 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 156 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 156 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 157 { "root": [ "../src/a.ts", @@ -931,17 +931,17 @@ PolledWatches *deleted*:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":152} + {"inode":153} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":154} + {"inode":155} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":145} + {"inode":146} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":147} + {"inode":148} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: @@ -1110,7 +1110,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/a/2/unrelated/anotherFile.ts :: WatchInfo: /home/src/projects/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 14: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 157 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 158 export const a = 10; @@ -1234,7 +1234,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/c/4/unrelated/anotherFile.ts :: WatchInfo: /home/src/projects/c 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 16: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 158 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 159 export const a = 10; @@ -1462,13 +1462,13 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":152} + {"inode":153} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":154} + {"inode":155} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":145} + {"inode":146} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":147} + {"inode":148} FsWatchesRecursive:: /home/src/projects/a: @@ -1827,18 +1827,18 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt :: WatchInfo: /home/src/projects/b/2/b-impl/b/node_modules/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 47: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 160 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 161 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 161 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 162 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 162 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 163 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1858,14 +1858,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 163 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 164 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 165 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 166 { "root": [ "../src/c.ts", @@ -1875,18 +1875,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 167 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 168 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 168 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 169 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 169 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 170 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1907,15 +1907,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 170 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 171 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 172 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 173 { "root": [ "../src/a.ts", @@ -1958,17 +1958,17 @@ PolledWatches *deleted*:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":168} + {"inode":169} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":170} + {"inode":171} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":161} + {"inode":162} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":163} + {"inode":164} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -2135,17 +2135,17 @@ PolledWatches *deleted*:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":168} + {"inode":169} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":170} + {"inode":171} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":161} + {"inode":162} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":163} + {"inode":164} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux-canUseWatchEvents.js index ce8a90c7da91d..c0dc3ecb8d5cb 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux-canUseWatchEvents.js @@ -91,18 +91,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 142 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 143 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 143 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 144 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 144 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 145 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -122,14 +122,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 145 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 146 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 146 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 147 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 148 { "root": [ "../src/c.ts", @@ -139,18 +139,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 149 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 150 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 150 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 151 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 151 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 152 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -171,15 +171,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 152 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 153 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 153 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 154 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 { "root": [ "../src/a.ts", @@ -771,7 +771,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 155 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 156 export const a = 10; @@ -887,7 +887,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 156 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 157 export const a = 10; @@ -1003,7 +1003,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 157 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 158 export const a = 10; @@ -1119,7 +1119,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 158 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 159 export const a = 10; @@ -1817,18 +1817,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":20,"path":"/home/src/projects/ Custom watchDirectory:: Triggered Ignored:: {"id":20,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt updated Custom watchDirectory:: Triggered Ignored:: {"id":20,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib updated Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 160 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 161 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 161 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 162 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 162 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 163 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1848,14 +1848,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 163 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 164 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 165 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 166 { "root": [ "../src/c.ts", @@ -1865,18 +1865,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 167 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 168 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 168 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 169 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 169 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 170 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1897,15 +1897,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 170 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 171 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 172 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 173 { "root": [ "../src/a.ts", diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux.js index e47b094ef5f3a..67ec892ddfad9 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-Linux.js @@ -91,18 +91,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 142 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 143 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 143 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 144 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 144 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 145 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -122,14 +122,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 145 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 146 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 146 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 147 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 148 { "root": [ "../src/c.ts", @@ -139,18 +139,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 149 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 150 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 150 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 151 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 151 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 152 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -171,15 +171,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 152 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 153 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 153 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 154 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 { "root": [ "../src/a.ts", @@ -377,11 +377,11 @@ PolledWatches:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":148} + {"inode":149} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":150} + {"inode":151} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":152} + {"inode":153} /home/src/projects/a/1/a-impl/a/node_modules: *new* {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: *new* @@ -393,11 +393,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: *new* {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":141} + {"inode":142} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":143} + {"inode":144} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":145} + {"inode":146} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: *new* @@ -541,7 +541,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 155 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 156 export const a = 10; @@ -657,7 +657,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 156 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 157 export const a = 10; @@ -773,7 +773,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 157 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 158 export const a = 10; @@ -889,7 +889,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 158 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 159 export const a = 10; @@ -1123,17 +1123,17 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":148} + {"inode":149} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":150} + {"inode":151} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":152} + {"inode":153} /home/src/projects/c/3/c-impl/c/lib: - {"inode":141} + {"inode":142} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":143} + {"inode":144} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":145} + {"inode":146} Timeout callback:: count: 3 21: /home/src/projects/b/2/b-impl/b/tsconfig.json *new* @@ -1461,18 +1461,18 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /home/src/projects/a/1/a-i Info seq [hh:mm:ss:mss] Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/a/1/a-impl/a/lib/index.d.ts 0:: WatchInfo: /home/src/projects/a/1/a-impl/a/lib/index.d.ts 500 undefined WatchType: Closed Script info Before running Timeout callback:: count: 1 30: timerToUpdateChildWatches -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 160 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 161 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 161 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 162 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 162 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 163 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1492,14 +1492,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 163 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 164 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 165 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 166 { "root": [ "../src/c.ts", @@ -1509,18 +1509,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 167 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 168 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 168 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 169 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 169 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 170 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1541,15 +1541,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 170 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 171 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 172 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 173 { "root": [ "../src/a.ts", @@ -1594,9 +1594,9 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":168} + {"inode":169} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":170} + {"inode":171} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1612,9 +1612,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":161} + {"inode":162} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":163} + {"inode":164} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -1683,11 +1683,11 @@ FsWatches:: /home/src/projects/a/1/a-impl/a: {"inode":19} /home/src/projects/a/1/a-impl/a/lib: *new* - {"inode":166} + {"inode":167} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":168} + {"inode":169} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":170} + {"inode":171} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1703,9 +1703,9 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":161} + {"inode":162} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":163} + {"inode":164} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -1837,11 +1837,11 @@ PolledWatches *deleted*:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib: - {"inode":166} + {"inode":167} /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":168} + {"inode":169} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":170} + {"inode":171} /home/src/projects/a/1/a-impl/a/node_modules: {"inode":25} /home/src/projects/a/1/a-impl/a/package.json: @@ -1853,11 +1853,11 @@ FsWatches:: /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib: *new* - {"inode":159} + {"inode":160} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":161} + {"inode":162} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":163} + {"inode":164} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs-canUseWatchEvents.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs-canUseWatchEvents.js index 1fe1ab61d7ff1..3789ab418085b 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs-canUseWatchEvents.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs-canUseWatchEvents.js @@ -91,18 +91,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 142 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 143 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 143 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 144 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 144 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 145 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -122,14 +122,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 145 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 146 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 146 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 147 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 148 { "root": [ "../src/c.ts", @@ -139,18 +139,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 149 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 150 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 150 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 151 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 151 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 152 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -171,15 +171,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 152 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 153 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 153 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 154 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 { "root": [ "../src/a.ts", @@ -771,7 +771,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 155 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 156 export const a = 10; @@ -887,7 +887,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 156 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 157 export const a = 10; @@ -1003,7 +1003,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in a Before running Timeout callback:: count: 0 -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 157 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 158 export const a = 10; @@ -1119,7 +1119,7 @@ After running Immedidate callback:: count: 0 change in unrelated folder in c Before running Timeout callback:: count: 0 -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 158 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 159 export const a = 10; @@ -1804,18 +1804,18 @@ Custom watchDirectory:: Triggered Ignored:: {"id":20,"path":"/home/src/projects/ Custom watchDirectory:: Triggered Ignored:: {"id":20,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo created Custom watchDirectory:: Triggered Ignored:: {"id":20,"path":"/home/src/projects/b/2/b-impl/b/node_modules/a","recursive":true,"ignoreUpdate":true}:: /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt created Before request -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 160 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 161 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 161 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 162 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 162 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 163 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1835,14 +1835,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 163 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 164 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 165 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 166 { "root": [ "../src/c.ts", @@ -1852,18 +1852,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 167 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 168 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 168 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 169 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 169 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 170 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1884,15 +1884,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 170 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 171 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 172 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 173 { "root": [ "../src/a.ts", diff --git a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs.js b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs.js index e2c84313250ba..5b4b0cf008887 100644 --- a/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs.js +++ b/tests/baselines/reference/tsserver/symLinks/packages-outside-project-folder-built-MacOs.js @@ -91,18 +91,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 142 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 143 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 143 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 144 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 144 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 145 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -122,14 +122,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 145 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 146 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 146 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 147 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 147 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 148 { "root": [ "../src/c.ts", @@ -139,18 +139,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 149 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 150 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 150 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 151 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 151 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 152 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -171,15 +171,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 152 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 153 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 153 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 154 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 154 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 155 { "root": [ "../src/a.ts", @@ -377,17 +377,17 @@ PolledWatches:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":150} + {"inode":151} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":152} + {"inode":153} /home/src/projects/a/1/a-impl/a/package.json: *new* {"inode":24} /home/src/projects/b/2/b-impl/b/tsconfig.json: *new* {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":143} + {"inode":144} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":145} + {"inode":146} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: *new* @@ -547,7 +547,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/a/2/unrelated/somethingUnrelated.ts :: WatchInfo: /home/src/projects/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 2: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 155 +//// [/home/src/projects/a/2/unrelated/somethingUnrelated.ts] Inode:: 156 export const a = 10; @@ -671,7 +671,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/c/4/unrelated/somethingUnrelated.ts :: WatchInfo: /home/src/projects/c 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 4: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 156 +//// [/home/src/projects/c/4/unrelated/somethingUnrelated.ts] Inode:: 157 export const a = 10; @@ -795,7 +795,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/a/2/unrelated/anotherFile.ts :: WatchInfo: /home/src/projects/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 6: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 157 +//// [/home/src/projects/a/2/unrelated/anotherFile.ts] Inode:: 158 export const a = 10; @@ -919,7 +919,7 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/c/4/unrelated/anotherFile.ts :: WatchInfo: /home/src/projects/c 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 8: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 158 +//// [/home/src/projects/c/4/unrelated/anotherFile.ts] Inode:: 159 export const a = 10; @@ -1147,13 +1147,13 @@ FsWatches:: FsWatches *deleted*:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":150} + {"inode":151} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":152} + {"inode":153} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":143} + {"inode":144} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":145} + {"inode":146} FsWatchesRecursive:: /home/src/projects/a: @@ -1514,18 +1514,18 @@ Info seq [hh:mm:ss:mss] Scheduled: /home/src/projects/b/2/b-impl/b/tsconfig.jso Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/b/2/b-impl/b/node_modules/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt :: WatchInfo: /home/src/projects/b/2/b-impl/b/node_modules/a 1 undefined Project: /home/src/projects/b/2/b-impl/b/tsconfig.json WatchType: Failed Lookup Locations Before running Timeout callback:: count: 1 39: /home/src/projects/b/2/b-impl/b/tsconfig.jsonFailedLookupInvalidation -//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 160 +//// [/home/src/projects/c/3/c-impl/c/lib/c.js] Inode:: 161 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.c = void 0; exports.c = 'test'; -//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 161 +//// [/home/src/projects/c/3/c-impl/c/lib/c.d.ts] Inode:: 162 export declare const c: string; -//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 162 +//// [/home/src/projects/c/3/c-impl/c/lib/index.js] Inode:: 163 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1545,14 +1545,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./c"), exports); -//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 163 +//// [/home/src/projects/c/3/c-impl/c/lib/index.d.ts] Inode:: 164 export * from './c'; -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 164 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo] Inode:: 165 {"root":["../src/c.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 165 +//// [/home/src/projects/c/3/c-impl/c/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 166 { "root": [ "../src/c.ts", @@ -1562,18 +1562,18 @@ export * from './c'; "size": 68 } -//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 167 +//// [/home/src/projects/a/1/a-impl/a/lib/a.js] Inode:: 168 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.a = void 0; exports.a = 'test'; -//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 168 +//// [/home/src/projects/a/1/a-impl/a/lib/a.d.ts] Inode:: 169 export declare const a: string; -//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 169 +//// [/home/src/projects/a/1/a-impl/a/lib/index.js] Inode:: 170 "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1594,15 +1594,15 @@ __exportStar(require("./a"), exports); __exportStar(require("c"), exports); -//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 170 +//// [/home/src/projects/a/1/a-impl/a/lib/index.d.ts] Inode:: 171 export * from './a'; export * from 'c'; -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 171 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo] Inode:: 172 {"root":["../src/a.ts","../src/index.ts"],"version":"FakeTSVersion"} -//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 172 +//// [/home/src/projects/a/1/a-impl/a/lib/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 173 { "root": [ "../src/a.ts", @@ -1645,17 +1645,17 @@ PolledWatches *deleted*:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: *new* - {"inode":168} + {"inode":169} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: *new* - {"inode":170} + {"inode":171} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: *new* - {"inode":161} + {"inode":162} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: *new* - {"inode":163} + {"inode":164} /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":45} @@ -1822,17 +1822,17 @@ PolledWatches *deleted*:: FsWatches:: /home/src/projects/a/1/a-impl/a/lib/a.d.ts: - {"inode":168} + {"inode":169} /home/src/projects/a/1/a-impl/a/lib/index.d.ts: - {"inode":170} + {"inode":171} /home/src/projects/a/1/a-impl/a/package.json: {"inode":24} /home/src/projects/b/2/b-impl/b/tsconfig.json: {"inode":36} /home/src/projects/c/3/c-impl/c/lib/c.d.ts: - {"inode":161} + {"inode":162} /home/src/projects/c/3/c-impl/c/lib/index.d.ts: - {"inode":163} + {"inode":164} /home/src/projects/c/3/c-impl/c/package.json: *new* {"inode":12} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/watchEnvironment/recursive-directory-does-not-watch-files-starting-with-dot-in-node_modules.js b/tests/baselines/reference/tsserver/watchEnvironment/recursive-directory-does-not-watch-files-starting-with-dot-in-node_modules.js index 2ceae269d429c..64cf20cd41f51 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/recursive-directory-does-not-watch-files-starting-with-dot-in-node_modules.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/recursive-directory-does-not-watch-files-starting-with-dot-in-node_modules.js @@ -217,26 +217,26 @@ ScriptInfos:: /a/username/workspace/project/tsconfig.json After writing ignored file or folder -//// [/a/username/workspace/project/node_modules/.cache/someFile.d.ts] Inode:: 116 +//// [/a/username/workspace/project/node_modules/.cache/someFile.d.ts] Inode:: 117 After writing ignored file or folder -//// [/a/username/workspace/project/node_modules/.cacheFile.ts] Inode:: 117 +//// [/a/username/workspace/project/node_modules/.cacheFile.ts] Inode:: 118 After writing ignored file or folder -//// [/a/username/workspace/project/.git/someFile.d.ts] Inode:: 119 +//// [/a/username/workspace/project/.git/someFile.d.ts] Inode:: 120 After writing ignored file or folder -//// [/a/username/workspace/project/.gitCache.d.ts] Inode:: 120 +//// [/a/username/workspace/project/.gitCache.d.ts] Inode:: 121 After writing ignored file or folder -//// [/a/username/workspace/project/src/.#field.ts] Inode:: 121 +//// [/a/username/workspace/project/src/.#field.ts] Inode:: 122 diff --git a/tests/baselines/reference/tsserver/watchEnvironment/uses-dynamic-polling-when-file-is-added-to-subfolder.js b/tests/baselines/reference/tsserver/watchEnvironment/uses-dynamic-polling-when-file-is-added-to-subfolder.js index 7f686b274959c..9496882b241a2 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/uses-dynamic-polling-when-file-is-added-to-subfolder.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/uses-dynamic-polling-when-file-is-added-to-subfolder.js @@ -243,7 +243,7 @@ After request Before running Timeout callback:: count: 1 1: pollPollingIntervalQueue -//// [/a/username/workspace/project/src/file2.ts] Inode:: 113 +//// [/a/username/workspace/project/src/file2.ts] Inode:: 114 @@ -357,7 +357,7 @@ FsWatches:: /a/username/workspace/project/src/file1.ts: {"inode":7} /a/username/workspace/project/src/file2.ts: *new* - {"inode":113} + {"inode":114} /a/username/workspace/project/tsconfig.json: {"inode":8} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/watchEnvironment/uses-non-recursive-watchDirectory-when-file-is-added-to-subfolder.js b/tests/baselines/reference/tsserver/watchEnvironment/uses-non-recursive-watchDirectory-when-file-is-added-to-subfolder.js index 46defc73cad3d..69b6730ee4824 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/uses-non-recursive-watchDirectory-when-file-is-added-to-subfolder.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/uses-non-recursive-watchDirectory-when-file-is-added-to-subfolder.js @@ -259,7 +259,7 @@ Before running Timeout callback:: count: 3 1: /a/username/workspace/project/tsconfig.json 2: *ensureProjectForOpenFiles* 3: /a/username/workspace/project/tsconfig.jsonFailedLookupInvalidation -//// [/a/username/workspace/project/src/file2.ts] Inode:: 113 +//// [/a/username/workspace/project/src/file2.ts] Inode:: 114 @@ -343,7 +343,7 @@ FsWatches:: /a/username/workspace/project/src/file1.ts: {"inode":7} /a/username/workspace/project/src/file2.ts: *new* - {"inode":113} + {"inode":114} /a/username/workspace/project/tsconfig.json: {"inode":8} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/watchEnvironment/uses-watchFile-when-file-is-added-to-subfolder.js b/tests/baselines/reference/tsserver/watchEnvironment/uses-watchFile-when-file-is-added-to-subfolder.js index da104ef3024c8..c4ea53dd1c78a 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/uses-watchFile-when-file-is-added-to-subfolder.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/uses-watchFile-when-file-is-added-to-subfolder.js @@ -262,7 +262,7 @@ Before running Timeout callback:: count: 3 3: /a/username/workspace/project/tsconfig.json 4: *ensureProjectForOpenFiles* 5: /a/username/workspace/project/tsconfig.jsonFailedLookupInvalidation -//// [/a/username/workspace/project/src/file2.ts] Inode:: 113 +//// [/a/username/workspace/project/src/file2.ts] Inode:: 114 @@ -333,7 +333,7 @@ FsWatches:: /a/username/workspace/project/src/file1.ts: {"inode":7} /a/username/workspace/project/src/file2.ts: *new* - {"inode":113} + {"inode":114} /a/username/workspace/project/tsconfig.json: {"inode":8} /home/src/tslibs/TS/Lib/lib.d.ts: diff --git a/tests/baselines/reference/tsserver/watchEnvironment/watching-npm-install-in-codespaces-where-workspaces-folder-is-hosted-at-root.js b/tests/baselines/reference/tsserver/watchEnvironment/watching-npm-install-in-codespaces-where-workspaces-folder-is-hosted-at-root.js index 3af7065f46640..04897a48f2a34 100644 --- a/tests/baselines/reference/tsserver/watchEnvironment/watching-npm-install-in-codespaces-where-workspaces-folder-is-hosted-at-root.js +++ b/tests/baselines/reference/tsserver/watchEnvironment/watching-npm-install-in-codespaces-where-workspaces-folder-is-hosted-at-root.js @@ -654,7 +654,7 @@ Projects:: dirty: true *changed* Before request -//// [/workspaces/somerepo/node_modules/@types/random-seed/index.d.ts] Inode:: 117 +//// [/workspaces/somerepo/node_modules/@types/random-seed/index.d.ts] Inode:: 118 export function randomSeed(): string; @@ -674,9 +674,9 @@ FsWatches:: /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":18} /workspaces/somerepo/node_modules: *new* - {"inode":114} -/workspaces/somerepo/node_modules/@types: *new* {"inode":115} +/workspaces/somerepo/node_modules/@types: *new* + {"inode":116} /workspaces/somerepo/src: {"inode":3} /workspaces/somerepo/src/tsconfig.json: @@ -770,9 +770,9 @@ FsWatches:: /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":18} /workspaces/somerepo/node_modules: - {"inode":114} -/workspaces/somerepo/node_modules/@types: {"inode":115} +/workspaces/somerepo/node_modules/@types: + {"inode":116} /workspaces/somerepo/src: {"inode":3} /workspaces/somerepo/src/tsconfig.json: @@ -902,11 +902,11 @@ FsWatches:: /home/src/tslibs/TS/Lib/lib.d.ts: {"inode":18} /workspaces/somerepo/node_modules: - {"inode":114} -/workspaces/somerepo/node_modules/@types: {"inode":115} -/workspaces/somerepo/node_modules/@types/random-seed: *new* +/workspaces/somerepo/node_modules/@types: {"inode":116} +/workspaces/somerepo/node_modules/@types/random-seed: *new* + {"inode":117} /workspaces/somerepo/src: {"inode":3} /workspaces/somerepo/src/tsconfig.json: From 9bf5aa7fe234d58b1fa4b435f9a0b9dcd16fe216 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Wed, 4 Dec 2024 08:47:16 -0800 Subject: [PATCH 08/46] Do not require import attributes for JSON imports in `--module node16` (#60673) --- src/compiler/checker.ts | 3 +- .../nodeModulesJson(module=node16).errors.txt | 81 +++++++++++ ...=> nodeModulesJson(module=node16).symbols} | 6 +- ...s => nodeModulesJson(module=node16).types} | 6 +- ...deModulesJson(module=nodenext).errors.txt} | 6 +- .../nodeModulesJson(module=nodenext).symbols | 79 +++++++++++ .../nodeModulesJson(module=nodenext).types | 129 ++++++++++++++++++ .../cases/conformance/node/nodeModulesJson.ts | 8 +- 8 files changed, 304 insertions(+), 14 deletions(-) create mode 100644 tests/baselines/reference/nodeModulesJson(module=node16).errors.txt rename tests/baselines/reference/{nodeModulesJson.symbols => nodeModulesJson(module=node16).symbols} (89%) rename tests/baselines/reference/{nodeModulesJson.types => nodeModulesJson(module=node16).types} (89%) rename tests/baselines/reference/{nodeModulesJson.errors.txt => nodeModulesJson(module=nodenext).errors.txt} (92%) create mode 100644 tests/baselines/reference/nodeModulesJson(module=nodenext).symbols create mode 100644 tests/baselines/reference/nodeModulesJson(module=nodenext).types diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 397a424ee7b27..cd1409b13f37a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -48100,7 +48100,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } } - if (isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) { + if (moduleKind === ModuleKind.NodeNext && isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) { + // Import attributes/assertions are not allowed in --module node16, so don't suggest adding one error(node.moduleSpecifier, Diagnostics.Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0, ModuleKind[moduleKind]); } } diff --git a/tests/baselines/reference/nodeModulesJson(module=node16).errors.txt b/tests/baselines/reference/nodeModulesJson(module=node16).errors.txt new file mode 100644 index 0000000000000..989bb7dcf9a58 --- /dev/null +++ b/tests/baselines/reference/nodeModulesJson(module=node16).errors.txt @@ -0,0 +1,81 @@ +/loosey.cts(1,36): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', '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', 'nodenext', or 'preserve'. +/main.mts(6,52): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +/main.mts(8,10): error TS1544: Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to 'Node16'. +/main.mts(8,41): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +/main.mts(9,42): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +/main.mts(10,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 + import typed from "actually-json/typed"; // Error in nodenext + + import config from "./config.json" with { type: "json" }; // Ok + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', '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', 'nodenext', or 'preserve'. + import config2 from "./config.json"; // Error in nodenext, no attribute + 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', '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', 'nodenext', or 'preserve'. + 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 TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. + 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.symbols b/tests/baselines/reference/nodeModulesJson(module=node16).symbols similarity index 89% rename from tests/baselines/reference/nodeModulesJson.symbols rename to tests/baselines/reference/nodeModulesJson(module=node16).symbols index 5f26b469ae9f3..42c68c640a2e7 100644 --- a/tests/baselines/reference/nodeModulesJson.symbols +++ b/tests/baselines/reference/nodeModulesJson(module=node16).symbols @@ -26,10 +26,10 @@ export default _default; import { oops } from "not.json"; // Ok >oops : Symbol(oops, Decl(main.mts, 0, 8)) -import moreOops from "actually-json"; // Error +import moreOops from "actually-json"; // Error in nodenext >moreOops : Symbol(moreOops, Decl(main.mts, 1, 6)) -import typed from "actually-json/typed"; // Error +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 @@ -39,7 +39,7 @@ 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, no attribute +import config2 from "./config.json"; // Error in nodenext, no attribute >config2 : Symbol(config2, Decl(main.mts, 6, 6)) import { version } from "./config.json" with { type: "json" }; // Error, named import diff --git a/tests/baselines/reference/nodeModulesJson.types b/tests/baselines/reference/nodeModulesJson(module=node16).types similarity index 89% rename from tests/baselines/reference/nodeModulesJson.types rename to tests/baselines/reference/nodeModulesJson(module=node16).types index 2c992f8548a03..2c41926af320a 100644 --- a/tests/baselines/reference/nodeModulesJson.types +++ b/tests/baselines/reference/nodeModulesJson(module=node16).types @@ -38,11 +38,11 @@ import { oops } from "not.json"; // Ok >oops : (json: string) => any > : ^ ^^ ^^^^^ -import moreOops from "actually-json"; // Error +import moreOops from "actually-json"; // Error in nodenext >moreOops : {} > : ^^ -import typed from "actually-json/typed"; // Error +import typed from "actually-json/typed"; // Error in nodenext >typed : typeof typed > : ^^^^^^^^^^^^ @@ -60,7 +60,7 @@ import { default as config1 } from "./config.json" with { type: "json" }; // Ok >type : any > : ^^^ -import config2 from "./config.json"; // Error, no attribute +import config2 from "./config.json"; // Error in nodenext, no attribute >config2 : { version: number; } > : ^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/nodeModulesJson.errors.txt b/tests/baselines/reference/nodeModulesJson(module=nodenext).errors.txt similarity index 92% rename from tests/baselines/reference/nodeModulesJson.errors.txt rename to tests/baselines/reference/nodeModulesJson(module=nodenext).errors.txt index 8e9a050cffbce..bf355357b0905 100644 --- a/tests/baselines/reference/nodeModulesJson.errors.txt +++ b/tests/baselines/reference/nodeModulesJson(module=nodenext).errors.txt @@ -43,16 +43,16 @@ ==== /main.mts (5 errors) ==== import { oops } from "not.json"; // Ok - import moreOops from "actually-json"; // Error + 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 'NodeNext'. - import typed from "actually-json/typed"; // Error + 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 'NodeNext'. 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, no attribute + 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 'NodeNext'. import { version } from "./config.json" with { type: "json" }; // Error, named import diff --git a/tests/baselines/reference/nodeModulesJson(module=nodenext).symbols b/tests/baselines/reference/nodeModulesJson(module=nodenext).symbols new file mode 100644 index 0000000000000..42c68c640a2e7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesJson(module=nodenext).symbols @@ -0,0 +1,79 @@ +//// [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 { version } from "./config.json" with { type: "json" }; // Error, named import +>version : Symbol(version, Decl(main.mts, 7, 8)) + +import * as config3 from "./config.json" with { type: "json" }; +>config3 : Symbol(config3, Decl(main.mts, 8, 6)) + +config3.version; // Error +>config3 : Symbol(config3, Decl(main.mts, 8, 6)) + +config3.default; // Ok +>config3.default : Symbol("/config") +>config3 : Symbol(config3, Decl(main.mts, 8, 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=nodenext).types b/tests/baselines/reference/nodeModulesJson(module=nodenext).types new file mode 100644 index 0000000000000..2c41926af320a --- /dev/null +++ b/tests/baselines/reference/nodeModulesJson(module=nodenext).types @@ -0,0 +1,129 @@ +//// [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 { 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/cases/conformance/node/nodeModulesJson.ts b/tests/cases/conformance/node/nodeModulesJson.ts index c983d561cdfd9..e231ec9b0aa1d 100644 --- a/tests/cases/conformance/node/nodeModulesJson.ts +++ b/tests/cases/conformance/node/nodeModulesJson.ts @@ -1,4 +1,4 @@ -// @module: nodenext +// @module: node16,nodenext // @resolveJsonModule: true // @noEmit: true @@ -38,12 +38,12 @@ export default _default; // @Filename: /main.mts import { oops } from "not.json"; // Ok -import moreOops from "actually-json"; // Error -import typed from "actually-json/typed"; // Error +import moreOops from "actually-json"; // Error in nodenext +import typed from "actually-json/typed"; // Error in nodenext 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, no attribute +import config2 from "./config.json"; // Error in nodenext, no attribute import { version } from "./config.json" with { type: "json" }; // Error, named import import * as config3 from "./config.json" with { type: "json" }; config3.version; // Error From 6b1ea96b9404ccfc8e66e22fa2a7b645781255c3 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Wed, 4 Dec 2024 09:13:13 -0800 Subject: [PATCH 09/46] Fix flow node improper reuse (#60662) --- src/compiler/binder.ts | 4 ++++ .../fourslash/unreachableStatementNodeReuse.ts | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/cases/fourslash/unreachableStatementNodeReuse.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index b071f72b712c2..41966df6672e9 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -21,6 +21,7 @@ import { BreakOrContinueStatement, CallChain, CallExpression, + canHaveFlowNode, canHaveLocals, canHaveSymbol, CaseBlock, @@ -1104,6 +1105,9 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { // and set it before we descend into nodes that could actually be part of an assignment pattern. inAssignmentPattern = false; if (checkUnreachable(node)) { + if (canHaveFlowNode(node) && node.flowNode) { + node.flowNode = undefined; + } bindEachChild(node); bindJSDoc(node); inAssignmentPattern = saveInAssignmentPattern; diff --git a/tests/cases/fourslash/unreachableStatementNodeReuse.ts b/tests/cases/fourslash/unreachableStatementNodeReuse.ts new file mode 100644 index 0000000000000..9ede6fd059c95 --- /dev/null +++ b/tests/cases/fourslash/unreachableStatementNodeReuse.ts @@ -0,0 +1,13 @@ +/// + +//// function test() { +//// return/*a*/abc(); +//// return; +//// } +//// function abc() { } + +verify.numberOfErrorsInCurrentFile(1); + +goTo.marker("a") +edit.insert(" "); +verify.noErrors(); \ No newline at end of file From 676d32994813badf283a0b1601665c901dd697f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Wed, 4 Dec 2024 21:04:14 +0100 Subject: [PATCH 10/46] Avoid incorrectly reusing assertion nodes from property assignments (#60576) --- src/compiler/expressionToTypeNode.ts | 6 +- ...tionNodeNotReusedWhenTypeNotEquivalent1.js | 34 ++++++++ ...odeNotReusedWhenTypeNotEquivalent1.symbols | 78 +++++++++++++++++++ ...nNodeNotReusedWhenTypeNotEquivalent1.types | 74 ++++++++++++++++++ ...tionNodeNotReusedWhenTypeNotEquivalent1.ts | 27 +++++++ ...tionNodeNotReusedWhenTypeNotEquivalent1.ts | 36 +++++++++ 6 files changed, 252 insertions(+), 3 deletions(-) create mode 100644 tests/baselines/reference/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.js create mode 100644 tests/baselines/reference/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.symbols create mode 100644 tests/baselines/reference/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.types create mode 100644 tests/cases/compiler/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts create mode 100644 tests/cases/fourslash/quickInfoAssertionNodeNotReusedWhenTypeNotEquivalent1.ts diff --git a/src/compiler/expressionToTypeNode.ts b/src/compiler/expressionToTypeNode.ts index 7f54ab49406c5..ad4f8321066e9 100644 --- a/src/compiler/expressionToTypeNode.ts +++ b/src/compiler/expressionToTypeNode.ts @@ -706,12 +706,12 @@ export function createSyntacticTypeNodeBuilder( } if (!result && node.kind === SyntaxKind.PropertyAssignment) { const initializer = node.initializer; - const type = isJSDocTypeAssertion(initializer) ? getJSDocTypeAssertionType(initializer) : + const assertionNode = isJSDocTypeAssertion(initializer) ? getJSDocTypeAssertionType(initializer) : initializer.kind === SyntaxKind.AsExpression || initializer.kind === SyntaxKind.TypeAssertionExpression ? (initializer as AsExpression | TypeAssertion).type : undefined; - if (type && !isConstTypeReference(type)) { - result = serializeExistingTypeNode(type, context); + if (assertionNode && !isConstTypeReference(assertionNode) && resolver.canReuseTypeNodeAnnotation(context, node, assertionNode, symbol)) { + result = serializeExistingTypeNode(assertionNode, context); } } return result ?? inferTypeOfDeclaration(node, symbol, context, /*reportFallback*/ false); diff --git a/tests/baselines/reference/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.js b/tests/baselines/reference/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.js new file mode 100644 index 0000000000000..dc81a99aa63d7 --- /dev/null +++ b/tests/baselines/reference/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.js @@ -0,0 +1,34 @@ +//// [tests/cases/compiler/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts] //// + +//// [declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts] +type Wrapper = { + _type: T; +}; + +declare function stringWrapper(): Wrapper; + +declare function objWrapper>>( + obj: T, +): Wrapper; + +const value = objWrapper({ + prop1: stringWrapper() as Wrapper<"hello">, +}); + +type Unwrap = T extends Wrapper + ? T["_type"] extends Record> + ? { [Key in keyof T["_type"]]: Unwrap } + : T["_type"] + : never; + +declare function unwrap(wrapper: T): Unwrap; + +export const unwrapped = unwrap(value); + + + + +//// [declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.d.ts] +export declare const unwrapped: { + prop1: "hello"; +}; diff --git a/tests/baselines/reference/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.symbols b/tests/baselines/reference/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.symbols new file mode 100644 index 0000000000000..fcfc2f0f54962 --- /dev/null +++ b/tests/baselines/reference/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.symbols @@ -0,0 +1,78 @@ +//// [tests/cases/compiler/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts] //// + +=== declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts === +type Wrapper = { +>Wrapper : Symbol(Wrapper, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 0, 0)) +>T : Symbol(T, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 0, 13)) + + _type: T; +>_type : Symbol(_type, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 0, 19)) +>T : Symbol(T, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 0, 13)) + +}; + +declare function stringWrapper(): Wrapper; +>stringWrapper : Symbol(stringWrapper, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 2, 2)) +>Wrapper : Symbol(Wrapper, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 0, 0)) + +declare function objWrapper>>( +>objWrapper : Symbol(objWrapper, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 4, 50)) +>T : Symbol(T, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 6, 28)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>Wrapper : Symbol(Wrapper, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 0, 0)) + + obj: T, +>obj : Symbol(obj, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 6, 68)) +>T : Symbol(T, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 6, 28)) + +): Wrapper; +>Wrapper : Symbol(Wrapper, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 0, 0)) +>T : Symbol(T, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 6, 28)) + +const value = objWrapper({ +>value : Symbol(value, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 10, 5)) +>objWrapper : Symbol(objWrapper, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 4, 50)) + + prop1: stringWrapper() as Wrapper<"hello">, +>prop1 : Symbol(prop1, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 10, 26)) +>stringWrapper : Symbol(stringWrapper, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 2, 2)) +>Wrapper : Symbol(Wrapper, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 0, 0)) + +}); + +type Unwrap = T extends Wrapper +>Unwrap : Symbol(Unwrap, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 12, 3)) +>T : Symbol(T, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 14, 12)) +>T : Symbol(T, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 14, 12)) +>Wrapper : Symbol(Wrapper, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 0, 0)) + + ? T["_type"] extends Record> +>T : Symbol(T, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 14, 12)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>Wrapper : Symbol(Wrapper, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 0, 0)) + + ? { [Key in keyof T["_type"]]: Unwrap } +>Key : Symbol(Key, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 16, 9)) +>T : Symbol(T, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 14, 12)) +>Unwrap : Symbol(Unwrap, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 12, 3)) +>T : Symbol(T, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 14, 12)) +>Key : Symbol(Key, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 16, 9)) + + : T["_type"] +>T : Symbol(T, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 14, 12)) + + : never; + +declare function unwrap(wrapper: T): Unwrap; +>unwrap : Symbol(unwrap, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 18, 10)) +>T : Symbol(T, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 20, 24)) +>wrapper : Symbol(wrapper, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 20, 27)) +>T : Symbol(T, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 20, 24)) +>Unwrap : Symbol(Unwrap, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 12, 3)) +>T : Symbol(T, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 20, 24)) + +export const unwrapped = unwrap(value); +>unwrapped : Symbol(unwrapped, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 22, 12)) +>unwrap : Symbol(unwrap, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 18, 10)) +>value : Symbol(value, Decl(declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts, 10, 5)) + diff --git a/tests/baselines/reference/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.types b/tests/baselines/reference/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.types new file mode 100644 index 0000000000000..d432618693d4f --- /dev/null +++ b/tests/baselines/reference/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.types @@ -0,0 +1,74 @@ +//// [tests/cases/compiler/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts] //// + +=== declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts === +type Wrapper = { +>Wrapper : Wrapper +> : ^^^^^^^^^^ + + _type: T; +>_type : T +> : ^ + +}; + +declare function stringWrapper(): Wrapper; +>stringWrapper : () => Wrapper +> : ^^^^^^ + +declare function objWrapper>>( +>objWrapper : >>(obj: T) => Wrapper +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ + + obj: T, +>obj : T +> : ^ + +): Wrapper; + +const value = objWrapper({ +>value : Wrapper<{ prop1: Wrapper<"hello">; }> +> : ^^^^^^^^^^^^^^^^^ ^^^^ +>objWrapper({ prop1: stringWrapper() as Wrapper<"hello">,}) : Wrapper<{ prop1: Wrapper<"hello">; }> +> : ^^^^^^^^^^^^^^^^^ ^^^^ +>objWrapper : >>(obj: T) => Wrapper +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ +>{ prop1: stringWrapper() as Wrapper<"hello">,} : { prop1: Wrapper<"hello">; } +> : ^^^^^^^^^ ^^^ + + prop1: stringWrapper() as Wrapper<"hello">, +>prop1 : Wrapper<"hello"> +> : ^^^^^^^^^^^^^^^^ +>stringWrapper() as Wrapper<"hello"> : Wrapper<"hello"> +> : ^^^^^^^^^^^^^^^^ +>stringWrapper() : Wrapper +> : ^^^^^^^^^^^^^^^ +>stringWrapper : () => Wrapper +> : ^^^^^^ + +}); + +type Unwrap = T extends Wrapper +>Unwrap : Unwrap +> : ^^^^^^^^^ + + ? T["_type"] extends Record> + ? { [Key in keyof T["_type"]]: Unwrap } + : T["_type"] + : never; + +declare function unwrap(wrapper: T): Unwrap; +>unwrap : (wrapper: T) => Unwrap +> : ^ ^^ ^^ ^^^^^ +>wrapper : T +> : ^ + +export const unwrapped = unwrap(value); +>unwrapped : { prop1: "hello"; } +> : ^^^^^^^^^^^^^^^^^^^ +>unwrap(value) : { prop1: "hello"; } +> : ^^^^^^^^^^^^^^^^^^^ +>unwrap : (wrapper: T) => Unwrap +> : ^ ^^ ^^ ^^^^^ +>value : Wrapper<{ prop1: Wrapper<"hello">; }> +> : ^^^^^^^^^^^^^^^^^ ^^^^ + diff --git a/tests/cases/compiler/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts b/tests/cases/compiler/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts new file mode 100644 index 0000000000000..05cedc8b10aba --- /dev/null +++ b/tests/cases/compiler/declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.ts @@ -0,0 +1,27 @@ +// @strict: true +// @declaration: true +// @emitDeclarationOnly: true + +type Wrapper = { + _type: T; +}; + +declare function stringWrapper(): Wrapper; + +declare function objWrapper>>( + obj: T, +): Wrapper; + +const value = objWrapper({ + prop1: stringWrapper() as Wrapper<"hello">, +}); + +type Unwrap = T extends Wrapper + ? T["_type"] extends Record> + ? { [Key in keyof T["_type"]]: Unwrap } + : T["_type"] + : never; + +declare function unwrap(wrapper: T): Unwrap; + +export const unwrapped = unwrap(value); diff --git a/tests/cases/fourslash/quickInfoAssertionNodeNotReusedWhenTypeNotEquivalent1.ts b/tests/cases/fourslash/quickInfoAssertionNodeNotReusedWhenTypeNotEquivalent1.ts new file mode 100644 index 0000000000000..aa14e0fa5eb1b --- /dev/null +++ b/tests/cases/fourslash/quickInfoAssertionNodeNotReusedWhenTypeNotEquivalent1.ts @@ -0,0 +1,36 @@ +/// + +// https://github.com/microsoft/TypeScript/issues/60573 + +// @strict: true + +//// type Wrapper = { +//// _type: T; +//// }; +//// +//// function stringWrapper(): Wrapper { +//// return { _type: "" }; +//// } +//// +//// function objWrapper>>( +//// obj: T, +//// ): Wrapper { +//// return { _type: obj }; +//// } +//// +//// const value = objWrapper({ +//// prop1: stringWrapper() as Wrapper<"hello">, +//// }); +//// +//// type Unwrap> = T["_type"] extends Record< +//// string, +//// Wrapper +//// > +//// ? { [Key in keyof T["_type"]]: Unwrap } +//// : T["_type"]; +//// +//// type Test/*1*/ = Unwrap; + +verify.quickInfoAt("1", `type Test = { + prop1: "hello"; +}`) From 42f893ff75e0bcf73eb936d3e986bd7c3358cb8c Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 4 Dec 2024 13:21:16 -0800 Subject: [PATCH 11/46] Mark the inherited any-based index signature so it can be elided in declaration emit (#60680) --- src/compiler/checker.ts | 6 ++- .../declarationEmitClassInherritsAny.js | 45 +++++++++++++++++++ .../declarationEmitClassInherritsAny.symbols | 10 +++++ .../declarationEmitClassInherritsAny.types | 14 ++++++ .../declarationEmitClassInherritsAny.ts | 3 ++ 5 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/declarationEmitClassInherritsAny.js create mode 100644 tests/baselines/reference/declarationEmitClassInherritsAny.symbols create mode 100644 tests/baselines/reference/declarationEmitClassInherritsAny.types create mode 100644 tests/cases/compiler/declarationEmitClassInherritsAny.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index cd1409b13f37a..933df66dc7aa2 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2151,6 +2151,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { var silentNeverSignature = createSignature(/*declaration*/ undefined, /*typeParameters*/ undefined, /*thisParameter*/ undefined, emptyArray, silentNeverType, /*resolvedTypePredicate*/ undefined, 0, SignatureFlags.None); var enumNumberIndexInfo = createIndexInfo(numberType, stringType, /*isReadonly*/ true); + var anyBaseTypeIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false); var iterationTypesCache = new Map(); // cache for common IterationTypes instances var noIterationTypes: IterationTypes = { @@ -13454,7 +13455,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); callSignatures = concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, SignatureKind.Call)); constructSignatures = concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, SignatureKind.Construct)); - const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [createIndexInfo(stringType, anyType, /*isReadonly*/ false)]; + const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [anyBaseTypeIndexInfo]; indexInfos = concatenate(indexInfos, filter(inheritedIndexInfos, info => !findIndexInfo(indexInfos, info.keyType))); } } @@ -13986,7 +13987,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { addInheritedMembers(members, getPropertiesOfType(baseConstructorType)); } else if (baseConstructorType === anyType) { - baseConstructorIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false); + baseConstructorIndexInfo = anyBaseTypeIndexInfo; } } @@ -50781,6 +50782,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { result ||= []; for (const info of infoList!) { if (info.declaration) continue; + if (info === anyBaseTypeIndexInfo) continue; // inherited, but looks like a late-bound signature because it has no declarations const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker); if (node && infoList === staticInfos) { (((node as Mutable).modifiers ||= factory.createNodeArray()) as MutableNodeArray).unshift(factory.createModifier(SyntaxKind.StaticKeyword)); diff --git a/tests/baselines/reference/declarationEmitClassInherritsAny.js b/tests/baselines/reference/declarationEmitClassInherritsAny.js new file mode 100644 index 0000000000000..8c4103422b2e9 --- /dev/null +++ b/tests/baselines/reference/declarationEmitClassInherritsAny.js @@ -0,0 +1,45 @@ +//// [tests/cases/compiler/declarationEmitClassInherritsAny.ts] //// + +//// [declarationEmitClassInherritsAny.ts] +const anyThing = class {} as any; +export class Foo extends anyThing {} + +//// [declarationEmitClassInherritsAny.js] +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Foo = void 0; +var anyThing = /** @class */ (function () { + function class_1() { + } + return class_1; +}()); +var Foo = /** @class */ (function (_super) { + __extends(Foo, _super); + function Foo() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Foo; +}(anyThing)); +exports.Foo = Foo; + + +//// [declarationEmitClassInherritsAny.d.ts] +declare const anyThing: any; +export declare class Foo extends anyThing { +} +export {}; diff --git a/tests/baselines/reference/declarationEmitClassInherritsAny.symbols b/tests/baselines/reference/declarationEmitClassInherritsAny.symbols new file mode 100644 index 0000000000000..81b11da2ee0b7 --- /dev/null +++ b/tests/baselines/reference/declarationEmitClassInherritsAny.symbols @@ -0,0 +1,10 @@ +//// [tests/cases/compiler/declarationEmitClassInherritsAny.ts] //// + +=== declarationEmitClassInherritsAny.ts === +const anyThing = class {} as any; +>anyThing : Symbol(anyThing, Decl(declarationEmitClassInherritsAny.ts, 0, 5)) + +export class Foo extends anyThing {} +>Foo : Symbol(Foo, Decl(declarationEmitClassInherritsAny.ts, 0, 33)) +>anyThing : Symbol(anyThing, Decl(declarationEmitClassInherritsAny.ts, 0, 5)) + diff --git a/tests/baselines/reference/declarationEmitClassInherritsAny.types b/tests/baselines/reference/declarationEmitClassInherritsAny.types new file mode 100644 index 0000000000000..39d65e433f824 --- /dev/null +++ b/tests/baselines/reference/declarationEmitClassInherritsAny.types @@ -0,0 +1,14 @@ +//// [tests/cases/compiler/declarationEmitClassInherritsAny.ts] //// + +=== declarationEmitClassInherritsAny.ts === +const anyThing = class {} as any; +>anyThing : any +>class {} as any : any +>class {} : typeof (Anonymous class) +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + +export class Foo extends anyThing {} +>Foo : Foo +> : ^^^ +>anyThing : any + diff --git a/tests/cases/compiler/declarationEmitClassInherritsAny.ts b/tests/cases/compiler/declarationEmitClassInherritsAny.ts new file mode 100644 index 0000000000000..7749e21320c14 --- /dev/null +++ b/tests/cases/compiler/declarationEmitClassInherritsAny.ts @@ -0,0 +1,3 @@ +// @declaration: true +const anyThing = class {} as any; +export class Foo extends anyThing {} \ No newline at end of file From 410513462673bad5696dad89b7103f31681ca1c6 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Wed, 4 Dec 2024 13:22:25 -0800 Subject: [PATCH 12/46] Include type-meaning 'extends' clause in auto-import fix list (#59853) --- src/services/codefixes/importFixes.ts | 1 + tests/cases/fourslash/importNameCodeFix_all.ts | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index b23b7c127e872..a1537c8bde5b7 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -183,6 +183,7 @@ const errorCodes: readonly number[] = [ Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode.code, Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig.code, Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code, + Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code, Diagnostics.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found.code, ]; diff --git a/tests/cases/fourslash/importNameCodeFix_all.ts b/tests/cases/fourslash/importNameCodeFix_all.ts index f76a5d1aa6950..de0527f5c9c0f 100644 --- a/tests/cases/fourslash/importNameCodeFix_all.ts +++ b/tests/cases/fourslash/importNameCodeFix_all.ts @@ -21,6 +21,12 @@ ////declare function e(): void; ////export = e; +// @Filename: /disposable.d.ts +////export declare class Disposable { } + +// @Filename: /disposable_global.d.ts +////interface Disposable { } + // @Filename: /user.ts ////import * as b from "./b"; ////import { } from "./c"; @@ -31,6 +37,7 @@ ////cd; cd; c0; c0; ////dd; dd; d0; d0; d1; d1; ////e; e; +////class X extends Disposable { } goTo.file("/user.ts"); verify.codeFixAll({ @@ -41,11 +48,13 @@ verify.codeFixAll({ import bd, * as b from "./b"; import cd, { c0 } from "./c"; import dd, { d0, d1 } from "./d"; +import { Disposable } from "./disposable"; import e = require("./e"); ad; ad; a0; a0; bd; bd; b.b0; b.b0; cd; cd; c0; c0; dd; dd; d0; d0; d1; d1; -e; e;`, +e; e; +class X extends Disposable { }`, }); From 517da72a57c878e5d4fbd260e7f1f8b019efbb27 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 4 Dec 2024 15:13:20 -0800 Subject: [PATCH 13/46] Cache started nonexistent property error checks to prevent reentrancy in the check (#60683) --- src/compiler/checker.ts | 7 +++++ src/compiler/types.ts | 1 + ...ctWithThisInNamePositionNoCrash.errors.txt | 16 ++++++++++ ...kingObjectWithThisInNamePositionNoCrash.js | 31 +++++++++++++++++++ ...bjectWithThisInNamePositionNoCrash.symbols | 16 ++++++++++ ...gObjectWithThisInNamePositionNoCrash.types | 31 +++++++++++++++++++ ...kingObjectWithThisInNamePositionNoCrash.ts | 9 ++++++ 7 files changed, 111 insertions(+) create mode 100644 tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.errors.txt create mode 100644 tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.js create mode 100644 tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.symbols create mode 100644 tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.types create mode 100644 tests/cases/compiler/checkingObjectWithThisInNamePositionNoCrash.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 933df66dc7aa2..5fd1f29a39892 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -34466,6 +34466,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } function reportNonexistentProperty(propNode: Identifier | PrivateIdentifier, containingType: Type, isUncheckedJS: boolean) { + const links = getNodeLinks(propNode); + const cache = (links.nonExistentPropCheckCache ||= new Set()); + const key = `${getTypeId(containingType)}|${isUncheckedJS}`; + if (cache.has(key)) { + return; + } + cache.add(key); let errorInfo: DiagnosticMessageChain | undefined; let relatedInfo: Diagnostic | undefined; if (!isPrivateIdentifier(propNode) && containingType.flags & TypeFlags.Union && !(containingType.flags & TypeFlags.Primitive)) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 6516c0b233a2e..46ff57009e7fa 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -6254,6 +6254,7 @@ export interface NodeLinks { potentialUnusedRenamedBindingElementsInTypes?: BindingElement[]; externalHelpersModule?: Symbol; // Resolved symbol for the external helpers module instantiationExpressionTypes?: Map; // Cache of instantiation expression types for the node + nonExistentPropCheckCache?: Set; } /** @internal */ diff --git a/tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.errors.txt b/tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.errors.txt new file mode 100644 index 0000000000000..e59c81e953e16 --- /dev/null +++ b/tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.errors.txt @@ -0,0 +1,16 @@ +checkingObjectWithThisInNamePositionNoCrash.ts(2,5): error TS7023: 'doit' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +checkingObjectWithThisInNamePositionNoCrash.ts(4,19): error TS2339: Property 'a' does not exist on type '{ doit(): { [x: number]: string; }; }'. + + +==== checkingObjectWithThisInNamePositionNoCrash.ts (2 errors) ==== + export const thing = { + doit() { + ~~~~ +!!! error TS7023: 'doit' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. + return { + [this.a]: "", // should refer to the outer object with the doit method, notably not present + ~ +!!! error TS2339: Property 'a' does not exist on type '{ doit(): { [x: number]: string; }; }'. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.js b/tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.js new file mode 100644 index 0000000000000..462afe05d5fda --- /dev/null +++ b/tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.js @@ -0,0 +1,31 @@ +//// [tests/cases/compiler/checkingObjectWithThisInNamePositionNoCrash.ts] //// + +//// [checkingObjectWithThisInNamePositionNoCrash.ts] +export const thing = { + doit() { + return { + [this.a]: "", // should refer to the outer object with the doit method, notably not present + } + } +} + +//// [checkingObjectWithThisInNamePositionNoCrash.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.thing = void 0; +exports.thing = { + doit: function () { + var _a; + return _a = {}, + _a[this.a] = "", + _a; + } +}; + + +//// [checkingObjectWithThisInNamePositionNoCrash.d.ts] +export declare const thing: { + doit(): { + [x: number]: string; + }; +}; diff --git a/tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.symbols b/tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.symbols new file mode 100644 index 0000000000000..6622b9f23682e --- /dev/null +++ b/tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.symbols @@ -0,0 +1,16 @@ +//// [tests/cases/compiler/checkingObjectWithThisInNamePositionNoCrash.ts] //// + +=== checkingObjectWithThisInNamePositionNoCrash.ts === +export const thing = { +>thing : Symbol(thing, Decl(checkingObjectWithThisInNamePositionNoCrash.ts, 0, 12)) + + doit() { +>doit : Symbol(doit, Decl(checkingObjectWithThisInNamePositionNoCrash.ts, 0, 22)) + + return { + [this.a]: "", // should refer to the outer object with the doit method, notably not present +>[this.a] : Symbol([this.a], Decl(checkingObjectWithThisInNamePositionNoCrash.ts, 2, 16)) +>this : Symbol(thing, Decl(checkingObjectWithThisInNamePositionNoCrash.ts, 0, 20)) + } + } +} diff --git a/tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.types b/tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.types new file mode 100644 index 0000000000000..cf00ba84fd1f2 --- /dev/null +++ b/tests/baselines/reference/checkingObjectWithThisInNamePositionNoCrash.types @@ -0,0 +1,31 @@ +//// [tests/cases/compiler/checkingObjectWithThisInNamePositionNoCrash.ts] //// + +=== checkingObjectWithThisInNamePositionNoCrash.ts === +export const thing = { +>thing : { doit(): { [x: number]: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ doit() { return { [this.a]: "", // should refer to the outer object with the doit method, notably not present } }} : { doit(): { [x: number]: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + doit() { +>doit : () => { [x: number]: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + return { +>{ [this.a]: "", // should refer to the outer object with the doit method, notably not present } : { [x: number]: string; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + + [this.a]: "", // should refer to the outer object with the doit method, notably not present +>[this.a] : string +> : ^^^^^^ +>this.a : any +> : ^^^ +>this : { doit(): { [x: number]: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>a : any +> : ^^^ +>"" : "" +> : ^^ + } + } +} diff --git a/tests/cases/compiler/checkingObjectWithThisInNamePositionNoCrash.ts b/tests/cases/compiler/checkingObjectWithThisInNamePositionNoCrash.ts new file mode 100644 index 0000000000000..db6a56d346fbb --- /dev/null +++ b/tests/cases/compiler/checkingObjectWithThisInNamePositionNoCrash.ts @@ -0,0 +1,9 @@ +// @strict: true +// @declaration: true +export const thing = { + doit() { + return { + [this.a]: "", // should refer to the outer object with the doit method, notably not present + } + } +} \ No newline at end of file From 12d96878bc51df4b1707b6f92f5094f51513a16d Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 4 Dec 2024 16:44:24 -0800 Subject: [PATCH 14/46] Lookup non-local element factory for reference marking when marking fragment references (#60684) --- src/compiler/checker.ts | 5 ++-- .../jsxFragmentAndFactoryUsedOnFragmentUse.js | 25 +++++++++++++++++++ ...ragmentAndFactoryUsedOnFragmentUse.symbols | 17 +++++++++++++ ...xFragmentAndFactoryUsedOnFragmentUse.types | 22 ++++++++++++++++ ...jsxFragmentAndFactoryUsedOnFragmentUse.tsx | 13 ++++++++++ 5 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/jsxFragmentAndFactoryUsedOnFragmentUse.js create mode 100644 tests/baselines/reference/jsxFragmentAndFactoryUsedOnFragmentUse.symbols create mode 100644 tests/baselines/reference/jsxFragmentAndFactoryUsedOnFragmentUse.types create mode 100644 tests/cases/compiler/jsxFragmentAndFactoryUsedOnFragmentUse.tsx diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5fd1f29a39892..2dbd59bf51ef4 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -30042,8 +30042,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // if JsxFragment, additionally mark jsx pragma as referenced, since `getJsxNamespace` above would have resolved to only the fragment factory if they are distinct if (isJsxOpeningFragment(node)) { const file = getSourceFileOfNode(node); - const localJsxNamespace = getLocalJsxNamespace(file); - if (localJsxNamespace) { + const entity = getJsxFactoryEntity(file); + if (entity) { + const localJsxNamespace = getFirstIdentifier(entity).escapedText; resolveName( jsxFactoryLocation, localJsxNamespace, diff --git a/tests/baselines/reference/jsxFragmentAndFactoryUsedOnFragmentUse.js b/tests/baselines/reference/jsxFragmentAndFactoryUsedOnFragmentUse.js new file mode 100644 index 0000000000000..d30158153ae59 --- /dev/null +++ b/tests/baselines/reference/jsxFragmentAndFactoryUsedOnFragmentUse.js @@ -0,0 +1,25 @@ +//// [tests/cases/compiler/jsxFragmentAndFactoryUsedOnFragmentUse.tsx] //// + +//// [index.tsx] +import {element, fragment} from "./jsx"; + +export const a = <>fragment text + +//// [jsx.ts] +export function element() {} + +export function fragment() {} + +//// [jsx.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.element = element; +exports.fragment = fragment; +function element() { } +function fragment() { } +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +var jsx_1 = require("./jsx"); +exports.a = (0, jsx_1.element)(jsx_1.fragment, null, "fragment text"); diff --git a/tests/baselines/reference/jsxFragmentAndFactoryUsedOnFragmentUse.symbols b/tests/baselines/reference/jsxFragmentAndFactoryUsedOnFragmentUse.symbols new file mode 100644 index 0000000000000..c3152c3e6b4f6 --- /dev/null +++ b/tests/baselines/reference/jsxFragmentAndFactoryUsedOnFragmentUse.symbols @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/jsxFragmentAndFactoryUsedOnFragmentUse.tsx] //// + +=== index.tsx === +import {element, fragment} from "./jsx"; +>element : Symbol(element, Decl(index.tsx, 0, 8)) +>fragment : Symbol(fragment, Decl(index.tsx, 0, 16)) + +export const a = <>fragment text +>a : Symbol(a, Decl(index.tsx, 2, 12)) + +=== jsx.ts === +export function element() {} +>element : Symbol(element, Decl(jsx.ts, 0, 0)) + +export function fragment() {} +>fragment : Symbol(fragment, Decl(jsx.ts, 0, 28)) + diff --git a/tests/baselines/reference/jsxFragmentAndFactoryUsedOnFragmentUse.types b/tests/baselines/reference/jsxFragmentAndFactoryUsedOnFragmentUse.types new file mode 100644 index 0000000000000..c2562565bb57d --- /dev/null +++ b/tests/baselines/reference/jsxFragmentAndFactoryUsedOnFragmentUse.types @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/jsxFragmentAndFactoryUsedOnFragmentUse.tsx] //// + +=== index.tsx === +import {element, fragment} from "./jsx"; +>element : () => void +> : ^^^^^^^^^^ +>fragment : () => void +> : ^^^^^^^^^^ + +export const a = <>fragment text +>a : any +><>fragment text : any + +=== jsx.ts === +export function element() {} +>element : () => void +> : ^^^^^^^^^^ + +export function fragment() {} +>fragment : () => void +> : ^^^^^^^^^^ + diff --git a/tests/cases/compiler/jsxFragmentAndFactoryUsedOnFragmentUse.tsx b/tests/cases/compiler/jsxFragmentAndFactoryUsedOnFragmentUse.tsx new file mode 100644 index 0000000000000..fcbb20a5c8388 --- /dev/null +++ b/tests/cases/compiler/jsxFragmentAndFactoryUsedOnFragmentUse.tsx @@ -0,0 +1,13 @@ +// @jsx: react +// @jsxFactory: element +// @jsxFragmentFactory: fragment +// @noUnusedLocals: true +// @filename: index.tsx +import {element, fragment} from "./jsx"; + +export const a = <>fragment text + +// @filename: jsx.ts +export function element() {} + +export function fragment() {} \ No newline at end of file From 9ef98be5175bf8ee25c33ad1117ff13cf3877135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Thu, 5 Dec 2024 18:21:08 +0100 Subject: [PATCH 15/46] Add extra test cases for fixed `reportNonexistentProperty` crashes (#60690) --- ...tionNonexistentPropertyNoCrash1.errors.txt | 16 ++++++ ...tyOnFunctionNonexistentPropertyNoCrash1.js | 37 +++++++++++++ ...unctionNonexistentPropertyNoCrash1.symbols | 28 ++++++++++ ...nFunctionNonexistentPropertyNoCrash1.types | 54 +++++++++++++++++++ ...NonexistentPropertyNoCrash1.baseline.jsonc | 50 +++++++++++++++++ ...tyOnFunctionNonexistentPropertyNoCrash1.ts | 16 ++++++ .../findAllRefsNonexistentPropertyNoCrash1.ts | 51 ++++++++++++++++++ 7 files changed, 252 insertions(+) create mode 100644 tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.errors.txt create mode 100644 tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.js create mode 100644 tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.symbols create mode 100644 tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.types create mode 100644 tests/baselines/reference/findAllRefsNonexistentPropertyNoCrash1.baseline.jsonc create mode 100644 tests/cases/compiler/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.ts create mode 100644 tests/cases/fourslash/findAllRefsNonexistentPropertyNoCrash1.ts diff --git a/tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.errors.txt b/tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.errors.txt new file mode 100644 index 0000000000000..31cab81a7d092 --- /dev/null +++ b/tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.errors.txt @@ -0,0 +1,16 @@ +index.js(5,21): error TS2339: Property 'fn' does not exist on type '{ (...args: any[]): void; readonly name: string; }'. + + +==== index.js (1 errors) ==== + export function test(fn) { + const composed = function (...args) { } + + Object.defineProperty(composed, 'name', { + value: composed.fn + '_test' + ~~ +!!! error TS2339: Property 'fn' does not exist on type '{ (...args: any[]): void; readonly name: string; }'. + }) + + return composed + } + \ No newline at end of file diff --git a/tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.js b/tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.js new file mode 100644 index 0000000000000..f8d30fa1c9818 --- /dev/null +++ b/tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.js @@ -0,0 +1,37 @@ +//// [tests/cases/compiler/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.ts] //// + +//// [index.js] +export function test(fn) { + const composed = function (...args) { } + + Object.defineProperty(composed, 'name', { + value: composed.fn + '_test' + }) + + return composed +} + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.test = test; +function test(fn) { + var composed = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + }; + Object.defineProperty(composed, 'name', { + value: composed.fn + '_test' + }); + return composed; +} + + +//// [index.d.ts] +export function test(fn: any): { + (...args: any[]): void; + readonly name: string; +}; diff --git a/tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.symbols b/tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.symbols new file mode 100644 index 0000000000000..e734b172fb0a9 --- /dev/null +++ b/tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.symbols @@ -0,0 +1,28 @@ +//// [tests/cases/compiler/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.ts] //// + +=== index.js === +export function test(fn) { +>test : Symbol(test, Decl(index.js, 0, 0)) +>fn : Symbol(fn, Decl(index.js, 0, 21)) + + const composed = function (...args) { } +>composed : Symbol(composed, Decl(index.js, 1, 7)) +>args : Symbol(args, Decl(index.js, 1, 29)) + + Object.defineProperty(composed, 'name', { +>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) +>composed : Symbol(composed, Decl(index.js, 1, 7)) +>'name' : Symbol(composed.name, Decl(index.js, 1, 41)) + + value: composed.fn + '_test' +>value : Symbol(value, Decl(index.js, 3, 43)) +>composed : Symbol(composed, Decl(index.js, 1, 7)) + + }) + + return composed +>composed : Symbol(composed, Decl(index.js, 1, 7)) +} + diff --git a/tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.types b/tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.types new file mode 100644 index 0000000000000..6d6373bccdff5 --- /dev/null +++ b/tests/baselines/reference/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.types @@ -0,0 +1,54 @@ +//// [tests/cases/compiler/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.ts] //// + +=== index.js === +export function test(fn) { +>test : (fn: any) => { (...args: any[]): void; readonly name: string; } +> : ^ ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fn : any +> : ^^^ + + const composed = function (...args) { } +>composed : { (...args: any[]): void; readonly name: string; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>function (...args) { } : { (...args: any[]): void; readonly name: string; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>args : any[] +> : ^^^^^ + + Object.defineProperty(composed, 'name', { +>Object.defineProperty(composed, 'name', { value: composed.fn + '_test' }) : { (...args: any[]): void; readonly name: string; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +> : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^ +>Object : ObjectConstructor +> : ^^^^^^^^^^^^^^^^^ +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +> : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^ +>composed : { (...args: any[]): void; readonly name: string; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>'name' : "name" +> : ^^^^^^ +>{ value: composed.fn + '_test' } : { value: string; } +> : ^^^^^^^^^^^^^^^^^^ + + value: composed.fn + '_test' +>value : string +> : ^^^^^^ +>composed.fn + '_test' : string +> : ^^^^^^ +>composed.fn : any +> : ^^^ +>composed : { (...args: any[]): void; readonly name: string; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fn : any +> : ^^^ +>'_test' : "_test" +> : ^^^^^^^ + + }) + + return composed +>composed : { (...args: any[]): void; readonly name: string; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +} + diff --git a/tests/baselines/reference/findAllRefsNonexistentPropertyNoCrash1.baseline.jsonc b/tests/baselines/reference/findAllRefsNonexistentPropertyNoCrash1.baseline.jsonc new file mode 100644 index 0000000000000..5b8a0cb9414a6 --- /dev/null +++ b/tests/baselines/reference/findAllRefsNonexistentPropertyNoCrash1.baseline.jsonc @@ -0,0 +1,50 @@ +// === findAllReferences === +// === /tests/cases/fourslash/src/parser.js === +// --- (line: 10) skipped --- +// variable: function () { +// let name; +// +// if (parserInput.currentChar() === "[|{| isInString: true |}@|]") { +// return name[1]; +// } +// }, +// --- (line: 18) skipped --- + +// === /tests/cases/fourslash/./src/parser.js === +// --- (line: 10) skipped --- +// variable: function () { +// let name; +// +// if (parserInput.currentChar() === "/*FIND ALL REFS*/@") { +// return name[1]; +// } +// }, +// --- (line: 18) skipped --- + + // === Definitions === + // === /tests/cases/fourslash/src/parser.js === + // --- (line: 10) skipped --- + // variable: function () { + // let name; + // + // if (parserInput.currentChar() === "[|@|]") { + // return name[1]; + // } + // }, + // --- (line: 18) skipped --- + + // === Details === + [ + { + "containerKind": "", + "containerName": "", + "kind": "var", + "name": "@", + "displayParts": [ + { + "text": "\"@\"", + "kind": "stringLiteral" + } + ] + } + ] \ No newline at end of file diff --git a/tests/cases/compiler/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.ts b/tests/cases/compiler/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.ts new file mode 100644 index 0000000000000..525d7b1feb4fe --- /dev/null +++ b/tests/cases/compiler/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.ts @@ -0,0 +1,16 @@ +// @allowJs: true +// @checkJs: true +// @declaration: true +// @outDir: dist + +// @filename: index.js + +export function test(fn) { + const composed = function (...args) { } + + Object.defineProperty(composed, 'name', { + value: composed.fn + '_test' + }) + + return composed +} diff --git a/tests/cases/fourslash/findAllRefsNonexistentPropertyNoCrash1.ts b/tests/cases/fourslash/findAllRefsNonexistentPropertyNoCrash1.ts new file mode 100644 index 0000000000000..3a9c392617d68 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsNonexistentPropertyNoCrash1.ts @@ -0,0 +1,51 @@ +/// + +// @strict: true +// @allowJs: true +// @checkJs: true + +// @filename: ./src/parser-input.js +//// export default () => { +//// let input; +//// +//// const parserInput = {}; +//// +//// parserInput.currentChar = () => input.charAt(parserInput.i); +//// +//// parserInput.end = () => { +//// const isFinished = parserInput.i >= input.length; +//// +//// return { +//// isFinished, +//// furthest: parserInput.i, +//// }; +//// }; +//// +//// return parserInput; +//// }; + +// @filename: ./src/parser.js +//// import getParserInput from "./parser-input"; +//// +//// const Parser = function Parser(context, imports, fileInfo, currentIndex) { +//// currentIndex = currentIndex || 0; +//// let parsers; +//// const parserInput = getParserInput(); +//// +//// return { +//// parserInput, +//// parsers: (parsers = { +//// variable: function () { +//// let name; +//// +//// if (parserInput.currentChar() === "/*1*/@") { +//// return name[1]; +//// } +//// }, +//// }), +//// }; +//// }; +//// +//// export default Parser; + +verify.baselineFindAllReferences("1"); From edd278a10415476afb90f3f0523e132805626e52 Mon Sep 17 00:00:00 2001 From: Hannah Oshlag Date: Thu, 5 Dec 2024 15:16:53 -0800 Subject: [PATCH 16/46] Switch coverage image from ubuntu-22.04 to mariner-2.0 (#60541) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac26e687fd0ed..03bdee7c3c9cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: runs-on: - 'self-hosted' - '1ES.Pool=TypeScript-1ES-GitHub-Large' - - '1ES.ImageOverride=ubuntu-22.04' + - '1ES.ImageOverride=mariner-2.0' permissions: id-token: write From 239a2a936f30de0172d1700695c8f746e9009255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Fri, 6 Dec 2024 20:05:25 +0100 Subject: [PATCH 17/46] Error on `override` used on dynamically named class members (#60691) --- src/compiler/checker.ts | 9 +++ src/compiler/diagnosticMessages.json | 8 ++ ...Name1(noimplicitoverride=false).errors.txt | 33 ++++++++ ...eDynamicName1(noimplicitoverride=false).js | 49 ++++++++++++ ...micName1(noimplicitoverride=false).symbols | 52 +++++++++++++ ...namicName1(noimplicitoverride=false).types | 74 ++++++++++++++++++ ...cName1(noimplicitoverride=true).errors.txt | 33 ++++++++ ...deDynamicName1(noimplicitoverride=true).js | 49 ++++++++++++ ...amicName1(noimplicitoverride=true).symbols | 52 +++++++++++++ ...ynamicName1(noimplicitoverride=true).types | 74 ++++++++++++++++++ ...ture1(noimplicitoverride=false).errors.txt | 33 ++++++++ ...dexSignature1(noimplicitoverride=false).js | 49 ++++++++++++ ...gnature1(noimplicitoverride=false).symbols | 53 +++++++++++++ ...Signature1(noimplicitoverride=false).types | 76 +++++++++++++++++++ ...ature1(noimplicitoverride=true).errors.txt | 33 ++++++++ ...ndexSignature1(noimplicitoverride=true).js | 49 ++++++++++++ ...ignature1(noimplicitoverride=true).symbols | 53 +++++++++++++ ...xSignature1(noimplicitoverride=true).types | 76 +++++++++++++++++++ ...Name1(noimplicitoverride=false).errors.txt | 30 ++++++++ ...BindableName1(noimplicitoverride=false).js | 49 ++++++++++++ ...bleName1(noimplicitoverride=false).symbols | 52 +++++++++++++ ...dableName1(noimplicitoverride=false).types | 74 ++++++++++++++++++ ...eName1(noimplicitoverride=true).errors.txt | 33 ++++++++ ...eBindableName1(noimplicitoverride=true).js | 49 ++++++++++++ ...ableName1(noimplicitoverride=true).symbols | 52 +++++++++++++ ...ndableName1(noimplicitoverride=true).types | 74 ++++++++++++++++++ .../override/overrideDynamicName1.ts | 30 ++++++++ .../overrideLateBindableIndexSignature1.ts | 30 ++++++++ .../override/overrideLateBindableName1.ts | 30 ++++++++ 29 files changed, 1358 insertions(+) create mode 100644 tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).errors.txt create mode 100644 tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).js create mode 100644 tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).symbols create mode 100644 tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).types create mode 100644 tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).errors.txt create mode 100644 tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).js create mode 100644 tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).symbols create mode 100644 tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).types create mode 100644 tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).errors.txt create mode 100644 tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).js create mode 100644 tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).symbols create mode 100644 tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).types create mode 100644 tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).errors.txt create mode 100644 tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).js create mode 100644 tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).symbols create mode 100644 tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).types create mode 100644 tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).errors.txt create mode 100644 tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).js create mode 100644 tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).symbols create mode 100644 tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).types create mode 100644 tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).errors.txt create mode 100644 tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).js create mode 100644 tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).symbols create mode 100644 tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).types create mode 100644 tests/cases/conformance/override/overrideDynamicName1.ts create mode 100644 tests/cases/conformance/override/overrideLateBindableIndexSignature1.ts create mode 100644 tests/cases/conformance/override/overrideLateBindableName1.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2dbd59bf51ef4..b439b7fd9c579 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -46774,6 +46774,15 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { ): MemberOverrideStatus { const isJs = isInJSFile(node); const nodeInAmbientContext = !!(node.flags & NodeFlags.Ambient); + if (memberHasOverrideModifier && member?.valueDeclaration && isClassElement(member.valueDeclaration) && member.valueDeclaration.name && isNonBindableDynamicName(member.valueDeclaration.name)) { + error( + errorNode, + isJs ? + Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic : + Diagnostics.This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic, + ); + return MemberOverrideStatus.HasInvalidOverride; + } if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) { const thisType = memberIsStatic ? staticType : typeWithThis; const baseType = memberIsStatic ? baseStaticType : baseWithThis; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 7f686076f1824..0b2951d8dee2d 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -4417,6 +4417,14 @@ "category": "Error", "code": 4126 }, + "This member cannot have an 'override' modifier because its name is dynamic.": { + "category": "Error", + "code": 4127 + }, + "This member cannot have a JSDoc comment with an '@override' tag because its name is dynamic.": { + "category": "Error", + "code": 4128 + }, "The current host does not support the '{0}' option.": { "category": "Error", diff --git a/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).errors.txt b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).errors.txt new file mode 100644 index 0000000000000..dc4b60e7ee311 --- /dev/null +++ b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).errors.txt @@ -0,0 +1,33 @@ +overrideDynamicName1.ts(8,12): error TS4127: This member cannot have an 'override' modifier because its name is dynamic. +overrideDynamicName1.ts(22,12): error TS4127: This member cannot have an 'override' modifier because its name is dynamic. + + +==== overrideDynamicName1.ts (2 errors) ==== + let prop = "foo" + + class Base1 { + [prop]() {} + } + + class Derived1 extends Base1 { + override [prop]() {} + ~~~~~~ +!!! error TS4127: This member cannot have an 'override' modifier because its name is dynamic. + } + + class Base2 { + [prop]() {} + } + + class Derived2 extends Base2 { + [prop]() {} + } + + class Base3 {} + + class Derived3 extends Base3 { + override [prop]() {} + ~~~~~~ +!!! error TS4127: This member cannot have an 'override' modifier because its name is dynamic. + } + \ No newline at end of file diff --git a/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).js b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).js new file mode 100644 index 0000000000000..9066e8c7d57a3 --- /dev/null +++ b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).js @@ -0,0 +1,49 @@ +//// [tests/cases/conformance/override/overrideDynamicName1.ts] //// + +//// [overrideDynamicName1.ts] +let prop = "foo" + +class Base1 { + [prop]() {} +} + +class Derived1 extends Base1 { + override [prop]() {} +} + +class Base2 { + [prop]() {} +} + +class Derived2 extends Base2 { + [prop]() {} +} + +class Base3 {} + +class Derived3 extends Base3 { + override [prop]() {} +} + + + + +//// [overrideDynamicName1.d.ts] +declare let prop: string; +declare class Base1 { + [x: string]: () => void; +} +declare class Derived1 extends Base1 { + [x: string]: () => void; +} +declare class Base2 { + [x: string]: () => void; +} +declare class Derived2 extends Base2 { + [x: string]: () => void; +} +declare class Base3 { +} +declare class Derived3 extends Base3 { + [x: string]: () => void; +} diff --git a/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).symbols b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).symbols new file mode 100644 index 0000000000000..3f4a38edda3f5 --- /dev/null +++ b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).symbols @@ -0,0 +1,52 @@ +//// [tests/cases/conformance/override/overrideDynamicName1.ts] //// + +=== overrideDynamicName1.ts === +let prop = "foo" +>prop : Symbol(prop, Decl(overrideDynamicName1.ts, 0, 3)) + +class Base1 { +>Base1 : Symbol(Base1, Decl(overrideDynamicName1.ts, 0, 16)) + + [prop]() {} +>[prop] : Symbol(Base1[prop], Decl(overrideDynamicName1.ts, 2, 13)) +>prop : Symbol(prop, Decl(overrideDynamicName1.ts, 0, 3)) +} + +class Derived1 extends Base1 { +>Derived1 : Symbol(Derived1, Decl(overrideDynamicName1.ts, 4, 1)) +>Base1 : Symbol(Base1, Decl(overrideDynamicName1.ts, 0, 16)) + + override [prop]() {} +>[prop] : Symbol(Derived1[prop], Decl(overrideDynamicName1.ts, 6, 30)) +>prop : Symbol(prop, Decl(overrideDynamicName1.ts, 0, 3)) +} + +class Base2 { +>Base2 : Symbol(Base2, Decl(overrideDynamicName1.ts, 8, 1)) + + [prop]() {} +>[prop] : Symbol(Base2[prop], Decl(overrideDynamicName1.ts, 10, 13)) +>prop : Symbol(prop, Decl(overrideDynamicName1.ts, 0, 3)) +} + +class Derived2 extends Base2 { +>Derived2 : Symbol(Derived2, Decl(overrideDynamicName1.ts, 12, 1)) +>Base2 : Symbol(Base2, Decl(overrideDynamicName1.ts, 8, 1)) + + [prop]() {} +>[prop] : Symbol(Derived2[prop], Decl(overrideDynamicName1.ts, 14, 30)) +>prop : Symbol(prop, Decl(overrideDynamicName1.ts, 0, 3)) +} + +class Base3 {} +>Base3 : Symbol(Base3, Decl(overrideDynamicName1.ts, 16, 1)) + +class Derived3 extends Base3 { +>Derived3 : Symbol(Derived3, Decl(overrideDynamicName1.ts, 18, 14)) +>Base3 : Symbol(Base3, Decl(overrideDynamicName1.ts, 16, 1)) + + override [prop]() {} +>[prop] : Symbol(Derived3[prop], Decl(overrideDynamicName1.ts, 20, 30)) +>prop : Symbol(prop, Decl(overrideDynamicName1.ts, 0, 3)) +} + diff --git a/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).types b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).types new file mode 100644 index 0000000000000..c544cdb87396c --- /dev/null +++ b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=false).types @@ -0,0 +1,74 @@ +//// [tests/cases/conformance/override/overrideDynamicName1.ts] //// + +=== overrideDynamicName1.ts === +let prop = "foo" +>prop : string +> : ^^^^^^ +>"foo" : "foo" +> : ^^^^^ + +class Base1 { +>Base1 : Base1 +> : ^^^^^ + + [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : string +> : ^^^^^^ +} + +class Derived1 extends Base1 { +>Derived1 : Derived1 +> : ^^^^^^^^ +>Base1 : Base1 +> : ^^^^^ + + override [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : string +> : ^^^^^^ +} + +class Base2 { +>Base2 : Base2 +> : ^^^^^ + + [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : string +> : ^^^^^^ +} + +class Derived2 extends Base2 { +>Derived2 : Derived2 +> : ^^^^^^^^ +>Base2 : Base2 +> : ^^^^^ + + [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : string +> : ^^^^^^ +} + +class Base3 {} +>Base3 : Base3 +> : ^^^^^ + +class Derived3 extends Base3 { +>Derived3 : Derived3 +> : ^^^^^^^^ +>Base3 : Base3 +> : ^^^^^ + + override [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : string +> : ^^^^^^ +} + diff --git a/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).errors.txt b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).errors.txt new file mode 100644 index 0000000000000..dc4b60e7ee311 --- /dev/null +++ b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).errors.txt @@ -0,0 +1,33 @@ +overrideDynamicName1.ts(8,12): error TS4127: This member cannot have an 'override' modifier because its name is dynamic. +overrideDynamicName1.ts(22,12): error TS4127: This member cannot have an 'override' modifier because its name is dynamic. + + +==== overrideDynamicName1.ts (2 errors) ==== + let prop = "foo" + + class Base1 { + [prop]() {} + } + + class Derived1 extends Base1 { + override [prop]() {} + ~~~~~~ +!!! error TS4127: This member cannot have an 'override' modifier because its name is dynamic. + } + + class Base2 { + [prop]() {} + } + + class Derived2 extends Base2 { + [prop]() {} + } + + class Base3 {} + + class Derived3 extends Base3 { + override [prop]() {} + ~~~~~~ +!!! error TS4127: This member cannot have an 'override' modifier because its name is dynamic. + } + \ No newline at end of file diff --git a/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).js b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).js new file mode 100644 index 0000000000000..9066e8c7d57a3 --- /dev/null +++ b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).js @@ -0,0 +1,49 @@ +//// [tests/cases/conformance/override/overrideDynamicName1.ts] //// + +//// [overrideDynamicName1.ts] +let prop = "foo" + +class Base1 { + [prop]() {} +} + +class Derived1 extends Base1 { + override [prop]() {} +} + +class Base2 { + [prop]() {} +} + +class Derived2 extends Base2 { + [prop]() {} +} + +class Base3 {} + +class Derived3 extends Base3 { + override [prop]() {} +} + + + + +//// [overrideDynamicName1.d.ts] +declare let prop: string; +declare class Base1 { + [x: string]: () => void; +} +declare class Derived1 extends Base1 { + [x: string]: () => void; +} +declare class Base2 { + [x: string]: () => void; +} +declare class Derived2 extends Base2 { + [x: string]: () => void; +} +declare class Base3 { +} +declare class Derived3 extends Base3 { + [x: string]: () => void; +} diff --git a/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).symbols b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).symbols new file mode 100644 index 0000000000000..3f4a38edda3f5 --- /dev/null +++ b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).symbols @@ -0,0 +1,52 @@ +//// [tests/cases/conformance/override/overrideDynamicName1.ts] //// + +=== overrideDynamicName1.ts === +let prop = "foo" +>prop : Symbol(prop, Decl(overrideDynamicName1.ts, 0, 3)) + +class Base1 { +>Base1 : Symbol(Base1, Decl(overrideDynamicName1.ts, 0, 16)) + + [prop]() {} +>[prop] : Symbol(Base1[prop], Decl(overrideDynamicName1.ts, 2, 13)) +>prop : Symbol(prop, Decl(overrideDynamicName1.ts, 0, 3)) +} + +class Derived1 extends Base1 { +>Derived1 : Symbol(Derived1, Decl(overrideDynamicName1.ts, 4, 1)) +>Base1 : Symbol(Base1, Decl(overrideDynamicName1.ts, 0, 16)) + + override [prop]() {} +>[prop] : Symbol(Derived1[prop], Decl(overrideDynamicName1.ts, 6, 30)) +>prop : Symbol(prop, Decl(overrideDynamicName1.ts, 0, 3)) +} + +class Base2 { +>Base2 : Symbol(Base2, Decl(overrideDynamicName1.ts, 8, 1)) + + [prop]() {} +>[prop] : Symbol(Base2[prop], Decl(overrideDynamicName1.ts, 10, 13)) +>prop : Symbol(prop, Decl(overrideDynamicName1.ts, 0, 3)) +} + +class Derived2 extends Base2 { +>Derived2 : Symbol(Derived2, Decl(overrideDynamicName1.ts, 12, 1)) +>Base2 : Symbol(Base2, Decl(overrideDynamicName1.ts, 8, 1)) + + [prop]() {} +>[prop] : Symbol(Derived2[prop], Decl(overrideDynamicName1.ts, 14, 30)) +>prop : Symbol(prop, Decl(overrideDynamicName1.ts, 0, 3)) +} + +class Base3 {} +>Base3 : Symbol(Base3, Decl(overrideDynamicName1.ts, 16, 1)) + +class Derived3 extends Base3 { +>Derived3 : Symbol(Derived3, Decl(overrideDynamicName1.ts, 18, 14)) +>Base3 : Symbol(Base3, Decl(overrideDynamicName1.ts, 16, 1)) + + override [prop]() {} +>[prop] : Symbol(Derived3[prop], Decl(overrideDynamicName1.ts, 20, 30)) +>prop : Symbol(prop, Decl(overrideDynamicName1.ts, 0, 3)) +} + diff --git a/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).types b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).types new file mode 100644 index 0000000000000..c544cdb87396c --- /dev/null +++ b/tests/baselines/reference/overrideDynamicName1(noimplicitoverride=true).types @@ -0,0 +1,74 @@ +//// [tests/cases/conformance/override/overrideDynamicName1.ts] //// + +=== overrideDynamicName1.ts === +let prop = "foo" +>prop : string +> : ^^^^^^ +>"foo" : "foo" +> : ^^^^^ + +class Base1 { +>Base1 : Base1 +> : ^^^^^ + + [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : string +> : ^^^^^^ +} + +class Derived1 extends Base1 { +>Derived1 : Derived1 +> : ^^^^^^^^ +>Base1 : Base1 +> : ^^^^^ + + override [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : string +> : ^^^^^^ +} + +class Base2 { +>Base2 : Base2 +> : ^^^^^ + + [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : string +> : ^^^^^^ +} + +class Derived2 extends Base2 { +>Derived2 : Derived2 +> : ^^^^^^^^ +>Base2 : Base2 +> : ^^^^^ + + [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : string +> : ^^^^^^ +} + +class Base3 {} +>Base3 : Base3 +> : ^^^^^ + +class Derived3 extends Base3 { +>Derived3 : Derived3 +> : ^^^^^^^^ +>Base3 : Base3 +> : ^^^^^ + + override [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : string +> : ^^^^^^ +} + diff --git a/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).errors.txt b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).errors.txt new file mode 100644 index 0000000000000..32329c5769715 --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).errors.txt @@ -0,0 +1,33 @@ +overrideLateBindableIndexSignature1.ts(8,12): error TS4127: This member cannot have an 'override' modifier because its name is dynamic. +overrideLateBindableIndexSignature1.ts(22,12): error TS4127: This member cannot have an 'override' modifier because its name is dynamic. + + +==== overrideLateBindableIndexSignature1.ts (2 errors) ==== + const sym: symbol = Symbol(); + + class Base1 { + [sym]() {} + } + + class Derived1 extends Base1 { + override [sym]() {} + ~~~~~ +!!! error TS4127: This member cannot have an 'override' modifier because its name is dynamic. + } + + class Base2 { + [sym]() {} + } + + class Derived2 extends Base2 { + [sym]() {} + } + + class Base3 {} + + class Derived3 extends Base3 { + override [sym]() {} + ~~~~~ +!!! error TS4127: This member cannot have an 'override' modifier because its name is dynamic. + } + \ No newline at end of file diff --git a/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).js b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).js new file mode 100644 index 0000000000000..d02cbd16d47ea --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).js @@ -0,0 +1,49 @@ +//// [tests/cases/conformance/override/overrideLateBindableIndexSignature1.ts] //// + +//// [overrideLateBindableIndexSignature1.ts] +const sym: symbol = Symbol(); + +class Base1 { + [sym]() {} +} + +class Derived1 extends Base1 { + override [sym]() {} +} + +class Base2 { + [sym]() {} +} + +class Derived2 extends Base2 { + [sym]() {} +} + +class Base3 {} + +class Derived3 extends Base3 { + override [sym]() {} +} + + + + +//// [overrideLateBindableIndexSignature1.d.ts] +declare const sym: symbol; +declare class Base1 { + [x: symbol]: () => void; +} +declare class Derived1 extends Base1 { + [x: symbol]: () => void; +} +declare class Base2 { + [x: symbol]: () => void; +} +declare class Derived2 extends Base2 { + [x: symbol]: () => void; +} +declare class Base3 { +} +declare class Derived3 extends Base3 { + [x: symbol]: () => void; +} diff --git a/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).symbols b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).symbols new file mode 100644 index 0000000000000..cdf2b6c5f707a --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).symbols @@ -0,0 +1,53 @@ +//// [tests/cases/conformance/override/overrideLateBindableIndexSignature1.ts] //// + +=== overrideLateBindableIndexSignature1.ts === +const sym: symbol = Symbol(); +>sym : Symbol(sym, Decl(overrideLateBindableIndexSignature1.ts, 0, 5)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) + +class Base1 { +>Base1 : Symbol(Base1, Decl(overrideLateBindableIndexSignature1.ts, 0, 29)) + + [sym]() {} +>[sym] : Symbol(Base1[sym], Decl(overrideLateBindableIndexSignature1.ts, 2, 13)) +>sym : Symbol(sym, Decl(overrideLateBindableIndexSignature1.ts, 0, 5)) +} + +class Derived1 extends Base1 { +>Derived1 : Symbol(Derived1, Decl(overrideLateBindableIndexSignature1.ts, 4, 1)) +>Base1 : Symbol(Base1, Decl(overrideLateBindableIndexSignature1.ts, 0, 29)) + + override [sym]() {} +>[sym] : Symbol(Derived1[sym], Decl(overrideLateBindableIndexSignature1.ts, 6, 30)) +>sym : Symbol(sym, Decl(overrideLateBindableIndexSignature1.ts, 0, 5)) +} + +class Base2 { +>Base2 : Symbol(Base2, Decl(overrideLateBindableIndexSignature1.ts, 8, 1)) + + [sym]() {} +>[sym] : Symbol(Base2[sym], Decl(overrideLateBindableIndexSignature1.ts, 10, 13)) +>sym : Symbol(sym, Decl(overrideLateBindableIndexSignature1.ts, 0, 5)) +} + +class Derived2 extends Base2 { +>Derived2 : Symbol(Derived2, Decl(overrideLateBindableIndexSignature1.ts, 12, 1)) +>Base2 : Symbol(Base2, Decl(overrideLateBindableIndexSignature1.ts, 8, 1)) + + [sym]() {} +>[sym] : Symbol(Derived2[sym], Decl(overrideLateBindableIndexSignature1.ts, 14, 30)) +>sym : Symbol(sym, Decl(overrideLateBindableIndexSignature1.ts, 0, 5)) +} + +class Base3 {} +>Base3 : Symbol(Base3, Decl(overrideLateBindableIndexSignature1.ts, 16, 1)) + +class Derived3 extends Base3 { +>Derived3 : Symbol(Derived3, Decl(overrideLateBindableIndexSignature1.ts, 18, 14)) +>Base3 : Symbol(Base3, Decl(overrideLateBindableIndexSignature1.ts, 16, 1)) + + override [sym]() {} +>[sym] : Symbol(Derived3[sym], Decl(overrideLateBindableIndexSignature1.ts, 20, 30)) +>sym : Symbol(sym, Decl(overrideLateBindableIndexSignature1.ts, 0, 5)) +} + diff --git a/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).types b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).types new file mode 100644 index 0000000000000..69358487e96b2 --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=false).types @@ -0,0 +1,76 @@ +//// [tests/cases/conformance/override/overrideLateBindableIndexSignature1.ts] //// + +=== overrideLateBindableIndexSignature1.ts === +const sym: symbol = Symbol(); +>sym : symbol +> : ^^^^^^ +>Symbol() : unique symbol +> : ^^^^^^^^^^^^^ +>Symbol : SymbolConstructor +> : ^^^^^^^^^^^^^^^^^ + +class Base1 { +>Base1 : Base1 +> : ^^^^^ + + [sym]() {} +>[sym] : () => void +> : ^^^^^^^^^^ +>sym : symbol +> : ^^^^^^ +} + +class Derived1 extends Base1 { +>Derived1 : Derived1 +> : ^^^^^^^^ +>Base1 : Base1 +> : ^^^^^ + + override [sym]() {} +>[sym] : () => void +> : ^^^^^^^^^^ +>sym : symbol +> : ^^^^^^ +} + +class Base2 { +>Base2 : Base2 +> : ^^^^^ + + [sym]() {} +>[sym] : () => void +> : ^^^^^^^^^^ +>sym : symbol +> : ^^^^^^ +} + +class Derived2 extends Base2 { +>Derived2 : Derived2 +> : ^^^^^^^^ +>Base2 : Base2 +> : ^^^^^ + + [sym]() {} +>[sym] : () => void +> : ^^^^^^^^^^ +>sym : symbol +> : ^^^^^^ +} + +class Base3 {} +>Base3 : Base3 +> : ^^^^^ + +class Derived3 extends Base3 { +>Derived3 : Derived3 +> : ^^^^^^^^ +>Base3 : Base3 +> : ^^^^^ + + override [sym]() {} +>[sym] : () => void +> : ^^^^^^^^^^ +>sym : symbol +> : ^^^^^^ +} + diff --git a/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).errors.txt b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).errors.txt new file mode 100644 index 0000000000000..32329c5769715 --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).errors.txt @@ -0,0 +1,33 @@ +overrideLateBindableIndexSignature1.ts(8,12): error TS4127: This member cannot have an 'override' modifier because its name is dynamic. +overrideLateBindableIndexSignature1.ts(22,12): error TS4127: This member cannot have an 'override' modifier because its name is dynamic. + + +==== overrideLateBindableIndexSignature1.ts (2 errors) ==== + const sym: symbol = Symbol(); + + class Base1 { + [sym]() {} + } + + class Derived1 extends Base1 { + override [sym]() {} + ~~~~~ +!!! error TS4127: This member cannot have an 'override' modifier because its name is dynamic. + } + + class Base2 { + [sym]() {} + } + + class Derived2 extends Base2 { + [sym]() {} + } + + class Base3 {} + + class Derived3 extends Base3 { + override [sym]() {} + ~~~~~ +!!! error TS4127: This member cannot have an 'override' modifier because its name is dynamic. + } + \ No newline at end of file diff --git a/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).js b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).js new file mode 100644 index 0000000000000..d02cbd16d47ea --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).js @@ -0,0 +1,49 @@ +//// [tests/cases/conformance/override/overrideLateBindableIndexSignature1.ts] //// + +//// [overrideLateBindableIndexSignature1.ts] +const sym: symbol = Symbol(); + +class Base1 { + [sym]() {} +} + +class Derived1 extends Base1 { + override [sym]() {} +} + +class Base2 { + [sym]() {} +} + +class Derived2 extends Base2 { + [sym]() {} +} + +class Base3 {} + +class Derived3 extends Base3 { + override [sym]() {} +} + + + + +//// [overrideLateBindableIndexSignature1.d.ts] +declare const sym: symbol; +declare class Base1 { + [x: symbol]: () => void; +} +declare class Derived1 extends Base1 { + [x: symbol]: () => void; +} +declare class Base2 { + [x: symbol]: () => void; +} +declare class Derived2 extends Base2 { + [x: symbol]: () => void; +} +declare class Base3 { +} +declare class Derived3 extends Base3 { + [x: symbol]: () => void; +} diff --git a/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).symbols b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).symbols new file mode 100644 index 0000000000000..cdf2b6c5f707a --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).symbols @@ -0,0 +1,53 @@ +//// [tests/cases/conformance/override/overrideLateBindableIndexSignature1.ts] //// + +=== overrideLateBindableIndexSignature1.ts === +const sym: symbol = Symbol(); +>sym : Symbol(sym, Decl(overrideLateBindableIndexSignature1.ts, 0, 5)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) + +class Base1 { +>Base1 : Symbol(Base1, Decl(overrideLateBindableIndexSignature1.ts, 0, 29)) + + [sym]() {} +>[sym] : Symbol(Base1[sym], Decl(overrideLateBindableIndexSignature1.ts, 2, 13)) +>sym : Symbol(sym, Decl(overrideLateBindableIndexSignature1.ts, 0, 5)) +} + +class Derived1 extends Base1 { +>Derived1 : Symbol(Derived1, Decl(overrideLateBindableIndexSignature1.ts, 4, 1)) +>Base1 : Symbol(Base1, Decl(overrideLateBindableIndexSignature1.ts, 0, 29)) + + override [sym]() {} +>[sym] : Symbol(Derived1[sym], Decl(overrideLateBindableIndexSignature1.ts, 6, 30)) +>sym : Symbol(sym, Decl(overrideLateBindableIndexSignature1.ts, 0, 5)) +} + +class Base2 { +>Base2 : Symbol(Base2, Decl(overrideLateBindableIndexSignature1.ts, 8, 1)) + + [sym]() {} +>[sym] : Symbol(Base2[sym], Decl(overrideLateBindableIndexSignature1.ts, 10, 13)) +>sym : Symbol(sym, Decl(overrideLateBindableIndexSignature1.ts, 0, 5)) +} + +class Derived2 extends Base2 { +>Derived2 : Symbol(Derived2, Decl(overrideLateBindableIndexSignature1.ts, 12, 1)) +>Base2 : Symbol(Base2, Decl(overrideLateBindableIndexSignature1.ts, 8, 1)) + + [sym]() {} +>[sym] : Symbol(Derived2[sym], Decl(overrideLateBindableIndexSignature1.ts, 14, 30)) +>sym : Symbol(sym, Decl(overrideLateBindableIndexSignature1.ts, 0, 5)) +} + +class Base3 {} +>Base3 : Symbol(Base3, Decl(overrideLateBindableIndexSignature1.ts, 16, 1)) + +class Derived3 extends Base3 { +>Derived3 : Symbol(Derived3, Decl(overrideLateBindableIndexSignature1.ts, 18, 14)) +>Base3 : Symbol(Base3, Decl(overrideLateBindableIndexSignature1.ts, 16, 1)) + + override [sym]() {} +>[sym] : Symbol(Derived3[sym], Decl(overrideLateBindableIndexSignature1.ts, 20, 30)) +>sym : Symbol(sym, Decl(overrideLateBindableIndexSignature1.ts, 0, 5)) +} + diff --git a/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).types b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).types new file mode 100644 index 0000000000000..69358487e96b2 --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableIndexSignature1(noimplicitoverride=true).types @@ -0,0 +1,76 @@ +//// [tests/cases/conformance/override/overrideLateBindableIndexSignature1.ts] //// + +=== overrideLateBindableIndexSignature1.ts === +const sym: symbol = Symbol(); +>sym : symbol +> : ^^^^^^ +>Symbol() : unique symbol +> : ^^^^^^^^^^^^^ +>Symbol : SymbolConstructor +> : ^^^^^^^^^^^^^^^^^ + +class Base1 { +>Base1 : Base1 +> : ^^^^^ + + [sym]() {} +>[sym] : () => void +> : ^^^^^^^^^^ +>sym : symbol +> : ^^^^^^ +} + +class Derived1 extends Base1 { +>Derived1 : Derived1 +> : ^^^^^^^^ +>Base1 : Base1 +> : ^^^^^ + + override [sym]() {} +>[sym] : () => void +> : ^^^^^^^^^^ +>sym : symbol +> : ^^^^^^ +} + +class Base2 { +>Base2 : Base2 +> : ^^^^^ + + [sym]() {} +>[sym] : () => void +> : ^^^^^^^^^^ +>sym : symbol +> : ^^^^^^ +} + +class Derived2 extends Base2 { +>Derived2 : Derived2 +> : ^^^^^^^^ +>Base2 : Base2 +> : ^^^^^ + + [sym]() {} +>[sym] : () => void +> : ^^^^^^^^^^ +>sym : symbol +> : ^^^^^^ +} + +class Base3 {} +>Base3 : Base3 +> : ^^^^^ + +class Derived3 extends Base3 { +>Derived3 : Derived3 +> : ^^^^^^^^ +>Base3 : Base3 +> : ^^^^^ + + override [sym]() {} +>[sym] : () => void +> : ^^^^^^^^^^ +>sym : symbol +> : ^^^^^^ +} + diff --git a/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).errors.txt b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).errors.txt new file mode 100644 index 0000000000000..5222bde9970fc --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).errors.txt @@ -0,0 +1,30 @@ +overrideLateBindableName1.ts(22,12): error TS4113: This member cannot have an 'override' modifier because it is not declared in the base class 'Base3'. + + +==== overrideLateBindableName1.ts (1 errors) ==== + const prop = "foo" + + class Base1 { + [prop]() {} + } + + class Derived1 extends Base1 { + override [prop]() {} + } + + class Base2 { + [prop]() {} + } + + class Derived2 extends Base2 { + [prop]() {} + } + + class Base3 {} + + class Derived3 extends Base3 { + override [prop]() {} + ~~~~~~ +!!! error TS4113: This member cannot have an 'override' modifier because it is not declared in the base class 'Base3'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).js b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).js new file mode 100644 index 0000000000000..49e6c2c387705 --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).js @@ -0,0 +1,49 @@ +//// [tests/cases/conformance/override/overrideLateBindableName1.ts] //// + +//// [overrideLateBindableName1.ts] +const prop = "foo" + +class Base1 { + [prop]() {} +} + +class Derived1 extends Base1 { + override [prop]() {} +} + +class Base2 { + [prop]() {} +} + +class Derived2 extends Base2 { + [prop]() {} +} + +class Base3 {} + +class Derived3 extends Base3 { + override [prop]() {} +} + + + + +//// [overrideLateBindableName1.d.ts] +declare const prop = "foo"; +declare class Base1 { + [prop](): void; +} +declare class Derived1 extends Base1 { + [prop](): void; +} +declare class Base2 { + [prop](): void; +} +declare class Derived2 extends Base2 { + [prop](): void; +} +declare class Base3 { +} +declare class Derived3 extends Base3 { + [prop](): void; +} diff --git a/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).symbols b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).symbols new file mode 100644 index 0000000000000..af7e39c350b18 --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).symbols @@ -0,0 +1,52 @@ +//// [tests/cases/conformance/override/overrideLateBindableName1.ts] //// + +=== overrideLateBindableName1.ts === +const prop = "foo" +>prop : Symbol(prop, Decl(overrideLateBindableName1.ts, 0, 5)) + +class Base1 { +>Base1 : Symbol(Base1, Decl(overrideLateBindableName1.ts, 0, 18)) + + [prop]() {} +>[prop] : Symbol(Base1[prop], Decl(overrideLateBindableName1.ts, 2, 13)) +>prop : Symbol(prop, Decl(overrideLateBindableName1.ts, 0, 5)) +} + +class Derived1 extends Base1 { +>Derived1 : Symbol(Derived1, Decl(overrideLateBindableName1.ts, 4, 1)) +>Base1 : Symbol(Base1, Decl(overrideLateBindableName1.ts, 0, 18)) + + override [prop]() {} +>[prop] : Symbol(Derived1[prop], Decl(overrideLateBindableName1.ts, 6, 30)) +>prop : Symbol(prop, Decl(overrideLateBindableName1.ts, 0, 5)) +} + +class Base2 { +>Base2 : Symbol(Base2, Decl(overrideLateBindableName1.ts, 8, 1)) + + [prop]() {} +>[prop] : Symbol(Base2[prop], Decl(overrideLateBindableName1.ts, 10, 13)) +>prop : Symbol(prop, Decl(overrideLateBindableName1.ts, 0, 5)) +} + +class Derived2 extends Base2 { +>Derived2 : Symbol(Derived2, Decl(overrideLateBindableName1.ts, 12, 1)) +>Base2 : Symbol(Base2, Decl(overrideLateBindableName1.ts, 8, 1)) + + [prop]() {} +>[prop] : Symbol(Derived2[prop], Decl(overrideLateBindableName1.ts, 14, 30)) +>prop : Symbol(prop, Decl(overrideLateBindableName1.ts, 0, 5)) +} + +class Base3 {} +>Base3 : Symbol(Base3, Decl(overrideLateBindableName1.ts, 16, 1)) + +class Derived3 extends Base3 { +>Derived3 : Symbol(Derived3, Decl(overrideLateBindableName1.ts, 18, 14)) +>Base3 : Symbol(Base3, Decl(overrideLateBindableName1.ts, 16, 1)) + + override [prop]() {} +>[prop] : Symbol(Derived3[prop], Decl(overrideLateBindableName1.ts, 20, 30)) +>prop : Symbol(prop, Decl(overrideLateBindableName1.ts, 0, 5)) +} + diff --git a/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).types b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).types new file mode 100644 index 0000000000000..1f1c75c1c39d8 --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=false).types @@ -0,0 +1,74 @@ +//// [tests/cases/conformance/override/overrideLateBindableName1.ts] //// + +=== overrideLateBindableName1.ts === +const prop = "foo" +>prop : "foo" +> : ^^^^^ +>"foo" : "foo" +> : ^^^^^ + +class Base1 { +>Base1 : Base1 +> : ^^^^^ + + [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : "foo" +> : ^^^^^ +} + +class Derived1 extends Base1 { +>Derived1 : Derived1 +> : ^^^^^^^^ +>Base1 : Base1 +> : ^^^^^ + + override [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : "foo" +> : ^^^^^ +} + +class Base2 { +>Base2 : Base2 +> : ^^^^^ + + [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : "foo" +> : ^^^^^ +} + +class Derived2 extends Base2 { +>Derived2 : Derived2 +> : ^^^^^^^^ +>Base2 : Base2 +> : ^^^^^ + + [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : "foo" +> : ^^^^^ +} + +class Base3 {} +>Base3 : Base3 +> : ^^^^^ + +class Derived3 extends Base3 { +>Derived3 : Derived3 +> : ^^^^^^^^ +>Base3 : Base3 +> : ^^^^^ + + override [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : "foo" +> : ^^^^^ +} + diff --git a/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).errors.txt b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).errors.txt new file mode 100644 index 0000000000000..7511c3468b334 --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).errors.txt @@ -0,0 +1,33 @@ +overrideLateBindableName1.ts(16,3): error TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Base2'. +overrideLateBindableName1.ts(22,12): error TS4113: This member cannot have an 'override' modifier because it is not declared in the base class 'Base3'. + + +==== overrideLateBindableName1.ts (2 errors) ==== + const prop = "foo" + + class Base1 { + [prop]() {} + } + + class Derived1 extends Base1 { + override [prop]() {} + } + + class Base2 { + [prop]() {} + } + + class Derived2 extends Base2 { + [prop]() {} + ~~~~~~ +!!! error TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Base2'. + } + + class Base3 {} + + class Derived3 extends Base3 { + override [prop]() {} + ~~~~~~ +!!! error TS4113: This member cannot have an 'override' modifier because it is not declared in the base class 'Base3'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).js b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).js new file mode 100644 index 0000000000000..49e6c2c387705 --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).js @@ -0,0 +1,49 @@ +//// [tests/cases/conformance/override/overrideLateBindableName1.ts] //// + +//// [overrideLateBindableName1.ts] +const prop = "foo" + +class Base1 { + [prop]() {} +} + +class Derived1 extends Base1 { + override [prop]() {} +} + +class Base2 { + [prop]() {} +} + +class Derived2 extends Base2 { + [prop]() {} +} + +class Base3 {} + +class Derived3 extends Base3 { + override [prop]() {} +} + + + + +//// [overrideLateBindableName1.d.ts] +declare const prop = "foo"; +declare class Base1 { + [prop](): void; +} +declare class Derived1 extends Base1 { + [prop](): void; +} +declare class Base2 { + [prop](): void; +} +declare class Derived2 extends Base2 { + [prop](): void; +} +declare class Base3 { +} +declare class Derived3 extends Base3 { + [prop](): void; +} diff --git a/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).symbols b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).symbols new file mode 100644 index 0000000000000..af7e39c350b18 --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).symbols @@ -0,0 +1,52 @@ +//// [tests/cases/conformance/override/overrideLateBindableName1.ts] //// + +=== overrideLateBindableName1.ts === +const prop = "foo" +>prop : Symbol(prop, Decl(overrideLateBindableName1.ts, 0, 5)) + +class Base1 { +>Base1 : Symbol(Base1, Decl(overrideLateBindableName1.ts, 0, 18)) + + [prop]() {} +>[prop] : Symbol(Base1[prop], Decl(overrideLateBindableName1.ts, 2, 13)) +>prop : Symbol(prop, Decl(overrideLateBindableName1.ts, 0, 5)) +} + +class Derived1 extends Base1 { +>Derived1 : Symbol(Derived1, Decl(overrideLateBindableName1.ts, 4, 1)) +>Base1 : Symbol(Base1, Decl(overrideLateBindableName1.ts, 0, 18)) + + override [prop]() {} +>[prop] : Symbol(Derived1[prop], Decl(overrideLateBindableName1.ts, 6, 30)) +>prop : Symbol(prop, Decl(overrideLateBindableName1.ts, 0, 5)) +} + +class Base2 { +>Base2 : Symbol(Base2, Decl(overrideLateBindableName1.ts, 8, 1)) + + [prop]() {} +>[prop] : Symbol(Base2[prop], Decl(overrideLateBindableName1.ts, 10, 13)) +>prop : Symbol(prop, Decl(overrideLateBindableName1.ts, 0, 5)) +} + +class Derived2 extends Base2 { +>Derived2 : Symbol(Derived2, Decl(overrideLateBindableName1.ts, 12, 1)) +>Base2 : Symbol(Base2, Decl(overrideLateBindableName1.ts, 8, 1)) + + [prop]() {} +>[prop] : Symbol(Derived2[prop], Decl(overrideLateBindableName1.ts, 14, 30)) +>prop : Symbol(prop, Decl(overrideLateBindableName1.ts, 0, 5)) +} + +class Base3 {} +>Base3 : Symbol(Base3, Decl(overrideLateBindableName1.ts, 16, 1)) + +class Derived3 extends Base3 { +>Derived3 : Symbol(Derived3, Decl(overrideLateBindableName1.ts, 18, 14)) +>Base3 : Symbol(Base3, Decl(overrideLateBindableName1.ts, 16, 1)) + + override [prop]() {} +>[prop] : Symbol(Derived3[prop], Decl(overrideLateBindableName1.ts, 20, 30)) +>prop : Symbol(prop, Decl(overrideLateBindableName1.ts, 0, 5)) +} + diff --git a/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).types b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).types new file mode 100644 index 0000000000000..1f1c75c1c39d8 --- /dev/null +++ b/tests/baselines/reference/overrideLateBindableName1(noimplicitoverride=true).types @@ -0,0 +1,74 @@ +//// [tests/cases/conformance/override/overrideLateBindableName1.ts] //// + +=== overrideLateBindableName1.ts === +const prop = "foo" +>prop : "foo" +> : ^^^^^ +>"foo" : "foo" +> : ^^^^^ + +class Base1 { +>Base1 : Base1 +> : ^^^^^ + + [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : "foo" +> : ^^^^^ +} + +class Derived1 extends Base1 { +>Derived1 : Derived1 +> : ^^^^^^^^ +>Base1 : Base1 +> : ^^^^^ + + override [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : "foo" +> : ^^^^^ +} + +class Base2 { +>Base2 : Base2 +> : ^^^^^ + + [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : "foo" +> : ^^^^^ +} + +class Derived2 extends Base2 { +>Derived2 : Derived2 +> : ^^^^^^^^ +>Base2 : Base2 +> : ^^^^^ + + [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : "foo" +> : ^^^^^ +} + +class Base3 {} +>Base3 : Base3 +> : ^^^^^ + +class Derived3 extends Base3 { +>Derived3 : Derived3 +> : ^^^^^^^^ +>Base3 : Base3 +> : ^^^^^ + + override [prop]() {} +>[prop] : () => void +> : ^^^^^^^^^^ +>prop : "foo" +> : ^^^^^ +} + diff --git a/tests/cases/conformance/override/overrideDynamicName1.ts b/tests/cases/conformance/override/overrideDynamicName1.ts new file mode 100644 index 0000000000000..d1962617a9b1f --- /dev/null +++ b/tests/cases/conformance/override/overrideDynamicName1.ts @@ -0,0 +1,30 @@ +// @strict: true +// @lib: esnext +// @target: esnext +// @noImplicitOverride: true, false +// @declaration: true +// @emitDeclarationOnly: true + +let prop = "foo" + +class Base1 { + [prop]() {} +} + +class Derived1 extends Base1 { + override [prop]() {} +} + +class Base2 { + [prop]() {} +} + +class Derived2 extends Base2 { + [prop]() {} +} + +class Base3 {} + +class Derived3 extends Base3 { + override [prop]() {} +} diff --git a/tests/cases/conformance/override/overrideLateBindableIndexSignature1.ts b/tests/cases/conformance/override/overrideLateBindableIndexSignature1.ts new file mode 100644 index 0000000000000..e30e90d6d0a5b --- /dev/null +++ b/tests/cases/conformance/override/overrideLateBindableIndexSignature1.ts @@ -0,0 +1,30 @@ +// @strict: true +// @lib: esnext +// @target: esnext +// @noImplicitOverride: true, false +// @declaration: true +// @emitDeclarationOnly: true + +const sym: symbol = Symbol(); + +class Base1 { + [sym]() {} +} + +class Derived1 extends Base1 { + override [sym]() {} +} + +class Base2 { + [sym]() {} +} + +class Derived2 extends Base2 { + [sym]() {} +} + +class Base3 {} + +class Derived3 extends Base3 { + override [sym]() {} +} diff --git a/tests/cases/conformance/override/overrideLateBindableName1.ts b/tests/cases/conformance/override/overrideLateBindableName1.ts new file mode 100644 index 0000000000000..0eec3d36ef58a --- /dev/null +++ b/tests/cases/conformance/override/overrideLateBindableName1.ts @@ -0,0 +1,30 @@ +// @strict: true +// @lib: esnext +// @target: esnext +// @noImplicitOverride: true, false +// @declaration: true +// @emitDeclarationOnly: true + +const prop = "foo" + +class Base1 { + [prop]() {} +} + +class Derived1 extends Base1 { + override [prop]() {} +} + +class Base2 { + [prop]() {} +} + +class Derived2 extends Base2 { + [prop]() {} +} + +class Base3 {} + +class Derived3 extends Base3 { + override [prop]() {} +} From 421f5c5458d09dad601604e6eff8765283aef14e Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Fri, 6 Dec 2024 13:47:41 -0800 Subject: [PATCH 18/46] Fix incorrect usage of package.json `types`/`main` in package subdirectories (#60696) --- src/compiler/moduleNameResolver.ts | 26 ++++++++----------- ...on_packageJson_yesAtPackageRoot.trace.json | 25 ------------------ ...AtPackageRoot_fakeScopedPackage.trace.json | 25 ------------------ .../typesVersions.ambientModules.trace.json | 5 ---- ...VersionsDeclarationEmit.ambient.trace.json | 5 ---- 5 files changed, 11 insertions(+), 75 deletions(-) diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index bf68c9d57ad22..5a4b5bd1c931a 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -2208,9 +2208,7 @@ function tryFileLookup(fileName: string, onlyRecordFailures: boolean, state: Mod function loadNodeModuleFromDirectory(extensions: Extensions, candidate: string, onlyRecordFailures: boolean, state: ModuleResolutionState, considerPackageJson = true) { const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : undefined; - const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent; - const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state); - return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths), state); + return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo), state); } /** @internal */ @@ -2243,8 +2241,7 @@ export function getEntrypointsFromPackageJsonInfo( packageJsonInfo.packageDirectory, /*onlyRecordFailures*/ false, loadPackageJsonMainState, - packageJsonInfo.contents.packageJsonContent, - getVersionPathsOfPackageJsonInfo(packageJsonInfo, loadPackageJsonMainState), + packageJsonInfo, ); entrypoints = append(entrypoints, mainResolution?.path); @@ -2481,15 +2478,16 @@ function getPackageJsonInfo(packageDirectory: string, onlyRecordFailures: boolea } } -function loadNodeModuleFromDirectoryWorker(extensions: Extensions, candidate: string, onlyRecordFailures: boolean, state: ModuleResolutionState, jsonContent: PackageJsonPathFields | undefined, versionPaths: VersionPaths | undefined): PathAndExtension | undefined { +function loadNodeModuleFromDirectoryWorker(extensions: Extensions, candidate: string, onlyRecordFailures: boolean, state: ModuleResolutionState, packageJson: PackageJsonInfo | undefined): PathAndExtension | undefined { + const versionPaths = packageJson && getVersionPathsOfPackageJsonInfo(packageJson, state); let packageFile: string | undefined; - if (jsonContent) { + if (packageJson && arePathsEqual(packageJson?.packageDirectory, candidate, state.host)) { if (state.isConfigLookup) { - packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state); + packageFile = readPackageJsonTSConfigField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state); } else { - packageFile = extensions & Extensions.Declaration && readPackageJsonTypesFields(jsonContent, candidate, state) || - extensions & (Extensions.ImplementationFiles | Extensions.Declaration) && readPackageJsonMainField(jsonContent, candidate, state) || + packageFile = extensions & Extensions.Declaration && readPackageJsonTypesFields(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || + extensions & (Extensions.ImplementationFiles | Extensions.Declaration) && readPackageJsonMainField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || undefined; } } @@ -2510,7 +2508,7 @@ function loadNodeModuleFromDirectoryWorker(extensions: Extensions, candidate: st const features = state.features; const candidateIsFromPackageJsonField = state.candidateIsFromPackageJsonField; state.candidateIsFromPackageJsonField = true; - if (jsonContent?.type !== "module") { + if (packageJson?.contents.packageJsonContent.type !== "module") { state.features &= ~NodeResolutionFeatures.EsmMode; } const result = nodeLoadModuleByRelativeName(expandedExtensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ false); @@ -3100,8 +3098,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions: Extensions, modu candidate, !nodeModulesDirectoryExists, state, - packageInfo.contents.packageJsonContent, - getVersionPathsOfPackageJsonInfo(packageInfo, state), + packageInfo, ); return withPackageId(packageInfo, fromDirectory, state); } @@ -3113,8 +3110,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions: Extensions, modu candidate, onlyRecordFailures, state, - packageInfo && packageInfo.contents.packageJsonContent, - packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state), + packageInfo, ); if ( !pathAndExtension && packageInfo diff --git a/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot.trace.json b/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot.trace.json index 83436d6f28bb3..08f6b72c2e57a 100644 --- a/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot.trace.json +++ b/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot.trace.json @@ -9,18 +9,6 @@ "File '/node_modules/foo/bar.ts' does not exist.", "File '/node_modules/foo/bar.tsx' does not exist.", "File '/node_modules/foo/bar.d.ts' does not exist.", - "'package.json' does not have a 'typings' field.", - "'package.json' has 'types' field 'types.d.ts' that references '/node_modules/foo/bar/types.d.ts'.", - "File '/node_modules/foo/bar/types.d.ts' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/foo/bar/types.d.ts', target file types: TypeScript, Declaration.", - "File name '/node_modules/foo/bar/types.d.ts' has a '.d.ts' extension - stripping it.", - "File '/node_modules/foo/bar/types.ts' does not exist.", - "File '/node_modules/foo/bar/types.tsx' does not exist.", - "File '/node_modules/foo/bar/types.d.ts' does not exist.", - "File '/node_modules/foo/bar/types.d.ts.ts' does not exist.", - "File '/node_modules/foo/bar/types.d.ts.tsx' does not exist.", - "File '/node_modules/foo/bar/types.d.ts.d.ts' does not exist.", - "Directory '/node_modules/foo/bar/types.d.ts' does not exist, skipping all lookups in it.", "File '/node_modules/foo/bar/index.ts' does not exist.", "File '/node_modules/foo/bar/index.tsx' does not exist.", "File '/node_modules/foo/bar/index.d.ts' does not exist.", @@ -31,7 +19,6 @@ "File '/node_modules/foo/package.json' exists according to earlier cached lookups.", "File '/node_modules/foo/bar.js' does not exist.", "File '/node_modules/foo/bar.jsx' does not exist.", - "'package.json' does not have a 'main' field.", "File '/node_modules/foo/bar/index.js' exists - use it as a name resolution result.", "'package.json' does not have a 'peerDependencies' field.", "Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update.", @@ -42,18 +29,6 @@ "File '/node_modules/foo/bar.ts' does not exist.", "File '/node_modules/foo/bar.tsx' does not exist.", "File '/node_modules/foo/bar.d.ts' does not exist.", - "'package.json' does not have a 'typings' field.", - "'package.json' has 'types' field 'types.d.ts' that references '/node_modules/foo/bar/types.d.ts'.", - "File '/node_modules/foo/bar/types.d.ts' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/foo/bar/types.d.ts', target file types: TypeScript, Declaration.", - "File name '/node_modules/foo/bar/types.d.ts' has a '.d.ts' extension - stripping it.", - "File '/node_modules/foo/bar/types.ts' does not exist.", - "File '/node_modules/foo/bar/types.tsx' does not exist.", - "File '/node_modules/foo/bar/types.d.ts' does not exist.", - "File '/node_modules/foo/bar/types.d.ts.ts' does not exist.", - "File '/node_modules/foo/bar/types.d.ts.tsx' does not exist.", - "File '/node_modules/foo/bar/types.d.ts.d.ts' does not exist.", - "Directory '/node_modules/foo/bar/types.d.ts' does not exist, skipping all lookups in it.", "File '/node_modules/foo/bar/index.ts' does not exist.", "File '/node_modules/foo/bar/index.tsx' does not exist.", "File '/node_modules/foo/bar/index.d.ts' does not exist.", diff --git a/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_fakeScopedPackage.trace.json b/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_fakeScopedPackage.trace.json index 6595986f256c1..e4ba32f52f320 100644 --- a/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_fakeScopedPackage.trace.json +++ b/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_fakeScopedPackage.trace.json @@ -9,18 +9,6 @@ "File '/node_modules/foo/@bar.ts' does not exist.", "File '/node_modules/foo/@bar.tsx' does not exist.", "File '/node_modules/foo/@bar.d.ts' does not exist.", - "'package.json' does not have a 'typings' field.", - "'package.json' has 'types' field 'types.d.ts' that references '/node_modules/foo/@bar/types.d.ts'.", - "File '/node_modules/foo/@bar/types.d.ts' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/foo/@bar/types.d.ts', target file types: TypeScript, Declaration.", - "File name '/node_modules/foo/@bar/types.d.ts' has a '.d.ts' extension - stripping it.", - "File '/node_modules/foo/@bar/types.ts' does not exist.", - "File '/node_modules/foo/@bar/types.tsx' does not exist.", - "File '/node_modules/foo/@bar/types.d.ts' does not exist.", - "File '/node_modules/foo/@bar/types.d.ts.ts' does not exist.", - "File '/node_modules/foo/@bar/types.d.ts.tsx' does not exist.", - "File '/node_modules/foo/@bar/types.d.ts.d.ts' does not exist.", - "Directory '/node_modules/foo/@bar/types.d.ts' does not exist, skipping all lookups in it.", "File '/node_modules/foo/@bar/index.ts' does not exist.", "File '/node_modules/foo/@bar/index.tsx' does not exist.", "File '/node_modules/foo/@bar/index.d.ts' does not exist.", @@ -31,7 +19,6 @@ "File '/node_modules/foo/package.json' exists according to earlier cached lookups.", "File '/node_modules/foo/@bar.js' does not exist.", "File '/node_modules/foo/@bar.jsx' does not exist.", - "'package.json' does not have a 'main' field.", "File '/node_modules/foo/@bar/index.js' exists - use it as a name resolution result.", "'package.json' does not have a 'peerDependencies' field.", "Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update.", @@ -42,18 +29,6 @@ "File '/node_modules/foo/@bar.ts' does not exist.", "File '/node_modules/foo/@bar.tsx' does not exist.", "File '/node_modules/foo/@bar.d.ts' does not exist.", - "'package.json' does not have a 'typings' field.", - "'package.json' has 'types' field 'types.d.ts' that references '/node_modules/foo/@bar/types.d.ts'.", - "File '/node_modules/foo/@bar/types.d.ts' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/foo/@bar/types.d.ts', target file types: TypeScript, Declaration.", - "File name '/node_modules/foo/@bar/types.d.ts' has a '.d.ts' extension - stripping it.", - "File '/node_modules/foo/@bar/types.ts' does not exist.", - "File '/node_modules/foo/@bar/types.tsx' does not exist.", - "File '/node_modules/foo/@bar/types.d.ts' does not exist.", - "File '/node_modules/foo/@bar/types.d.ts.ts' does not exist.", - "File '/node_modules/foo/@bar/types.d.ts.tsx' does not exist.", - "File '/node_modules/foo/@bar/types.d.ts.d.ts' does not exist.", - "Directory '/node_modules/foo/@bar/types.d.ts' does not exist, skipping all lookups in it.", "File '/node_modules/foo/@bar/index.ts' does not exist.", "File '/node_modules/foo/@bar/index.tsx' does not exist.", "File '/node_modules/foo/@bar/index.d.ts' does not exist.", diff --git a/tests/baselines/reference/typesVersions.ambientModules.trace.json b/tests/baselines/reference/typesVersions.ambientModules.trace.json index 424e9369828da..f50570ce31ddb 100644 --- a/tests/baselines/reference/typesVersions.ambientModules.trace.json +++ b/tests/baselines/reference/typesVersions.ambientModules.trace.json @@ -31,8 +31,6 @@ "File '/.src/node_modules/ext/ts3.1/other.ts' does not exist.", "File '/.src/node_modules/ext/ts3.1/other.tsx' does not exist.", "File '/.src/node_modules/ext/ts3.1/other.d.ts' does not exist.", - "'package.json' does not have a 'typings' field.", - "'package.json' has 'types' field 'index' that references '/.src/node_modules/ext/ts3.1/other/index'.", "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'index'.", "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", @@ -47,7 +45,6 @@ "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'.", "File '/.src/node_modules/ext/ts3.1/other.js' does not exist.", "File '/.src/node_modules/ext/ts3.1/other.jsx' does not exist.", - "'package.json' does not have a 'main' field.", "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'index'.", "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", @@ -63,8 +60,6 @@ "File '/.src/node_modules/ext/ts3.1/other.ts' does not exist.", "File '/.src/node_modules/ext/ts3.1/other.tsx' does not exist.", "File '/.src/node_modules/ext/ts3.1/other.d.ts' does not exist.", - "'package.json' does not have a 'typings' field.", - "'package.json' has 'types' field 'index' that references '/.src/node_modules/ext/ts3.1/other/index'.", "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'index'.", "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json index 424e9369828da..f50570ce31ddb 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json @@ -31,8 +31,6 @@ "File '/.src/node_modules/ext/ts3.1/other.ts' does not exist.", "File '/.src/node_modules/ext/ts3.1/other.tsx' does not exist.", "File '/.src/node_modules/ext/ts3.1/other.d.ts' does not exist.", - "'package.json' does not have a 'typings' field.", - "'package.json' has 'types' field 'index' that references '/.src/node_modules/ext/ts3.1/other/index'.", "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'index'.", "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", @@ -47,7 +45,6 @@ "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'.", "File '/.src/node_modules/ext/ts3.1/other.js' does not exist.", "File '/.src/node_modules/ext/ts3.1/other.jsx' does not exist.", - "'package.json' does not have a 'main' field.", "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'index'.", "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", @@ -63,8 +60,6 @@ "File '/.src/node_modules/ext/ts3.1/other.ts' does not exist.", "File '/.src/node_modules/ext/ts3.1/other.tsx' does not exist.", "File '/.src/node_modules/ext/ts3.1/other.d.ts' does not exist.", - "'package.json' does not have a 'typings' field.", - "'package.json' has 'types' field 'index' that references '/.src/node_modules/ext/ts3.1/other/index'.", "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'index'.", "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", From 3d2b8f33d4ff86ec351ba93a557d37720962c921 Mon Sep 17 00:00:00 2001 From: Isabel Duan Date: Mon, 9 Dec 2024 10:38:37 -0800 Subject: [PATCH 19/46] Remove reference not found errors from `jsx: preserve` (#60687) --- src/compiler/checker.ts | 12 +- ...mentFactoryReference(jsx=react).errors.txt | 15 ++ ...FactoryReference(jsx=react-jsx).errors.txt | 12 ++ ...toryReference(jsx=react-jsxdev).errors.txt | 12 ++ ...formCustomImport(jsx=react-jsx).errors.txt | 5 +- ...mCustomImport(jsx=react-jsxdev).errors.txt | 5 +- ...stomImportPragma(jsx=react-jsx).errors.txt | 5 +- ...mImportPragma(jsx=react-jsxdev).errors.txt | 5 +- .../jsxRuntimePragma(jsx=preserve).js | 88 +++++++++ .../jsxRuntimePragma(jsx=preserve).symbols | 95 +++++++++ .../jsxRuntimePragma(jsx=preserve).types | 183 ++++++++++++++++++ ...ExpressionNoTypeAssertionInJsx2.errors.txt | 5 +- ...ExpressionNoTypeAssertionInJsx4.errors.txt | 5 +- .../compiler/jsxFragmentFactoryReference.tsx | 14 ++ tests/cases/compiler/jsxRuntimePragma.ts | 2 +- 15 files changed, 434 insertions(+), 29 deletions(-) create mode 100644 tests/baselines/reference/jsxFragmentFactoryReference(jsx=react).errors.txt create mode 100644 tests/baselines/reference/jsxFragmentFactoryReference(jsx=react-jsx).errors.txt create mode 100644 tests/baselines/reference/jsxFragmentFactoryReference(jsx=react-jsxdev).errors.txt create mode 100644 tests/baselines/reference/jsxRuntimePragma(jsx=preserve).js create mode 100644 tests/baselines/reference/jsxRuntimePragma(jsx=preserve).symbols create mode 100644 tests/baselines/reference/jsxRuntimePragma(jsx=preserve).types create mode 100644 tests/cases/compiler/jsxFragmentFactoryReference.tsx diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b439b7fd9c579..690b17c376445 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -30015,6 +30015,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const jsxFactoryRefErr = diagnostics && compilerOptions.jsx === JsxEmit.React ? Diagnostics.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found : undefined; const jsxFactoryNamespace = getJsxNamespace(node); const jsxFactoryLocation = isJsxOpeningLikeElement(node) ? node.tagName : node; + const shouldFactoryRefErr = compilerOptions.jsx !== JsxEmit.Preserve && compilerOptions.jsx !== JsxEmit.ReactNative; // #38720/60122, allow null as jsxFragmentFactory let jsxFactorySym: Symbol | undefined; @@ -30022,7 +30023,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { jsxFactorySym = resolveName( jsxFactoryLocation, jsxFactoryNamespace, - (compilerOptions.jsx === JsxEmit.Preserve || compilerOptions.jsx === JsxEmit.ReactNative) ? SymbolFlags.Value & ~SymbolFlags.Enum : SymbolFlags.Value, + shouldFactoryRefErr ? SymbolFlags.Value : SymbolFlags.Value & ~SymbolFlags.Enum, jsxFactoryRefErr, /*isUse*/ true, ); @@ -30048,7 +30049,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { resolveName( jsxFactoryLocation, localJsxNamespace, - (compilerOptions.jsx === JsxEmit.Preserve || compilerOptions.jsx === JsxEmit.ReactNative) ? SymbolFlags.Value & ~SymbolFlags.Enum : SymbolFlags.Value, + shouldFactoryRefErr ? SymbolFlags.Value : SymbolFlags.Value & ~SymbolFlags.Enum, jsxFactoryRefErr, /*isUse*/ true, ); @@ -36841,15 +36842,18 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (sourceFileLinks.jsxFragmentType !== undefined) return sourceFileLinks.jsxFragmentType; const jsxFragmentFactoryName = getJsxNamespace(node); + // #38720/60122, allow null as jsxFragmentFactory - if (jsxFragmentFactoryName === "null") return sourceFileLinks.jsxFragmentType = anyType; + const shouldResolveFactoryReference = (compilerOptions.jsx === JsxEmit.React || compilerOptions.jsxFragmentFactory !== undefined) && jsxFragmentFactoryName !== "null"; + if (!shouldResolveFactoryReference) return sourceFileLinks.jsxFragmentType = anyType; + const shouldModuleRefErr = compilerOptions.jsx !== JsxEmit.Preserve && compilerOptions.jsx !== JsxEmit.ReactNative; const jsxFactoryRefErr = diagnostics ? Diagnostics.Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found : undefined; const jsxFactorySymbol = getJsxNamespaceContainerForImplicitImport(node) ?? resolveName( node, jsxFragmentFactoryName, - (compilerOptions.jsx === JsxEmit.Preserve || compilerOptions.jsx === JsxEmit.ReactNative) ? SymbolFlags.Value & ~SymbolFlags.Enum : SymbolFlags.Value, + shouldModuleRefErr ? SymbolFlags.Value : SymbolFlags.Value & ~SymbolFlags.Enum, /*nameNotFoundMessage*/ jsxFactoryRefErr, /*isUse*/ true, ); diff --git a/tests/baselines/reference/jsxFragmentFactoryReference(jsx=react).errors.txt b/tests/baselines/reference/jsxFragmentFactoryReference(jsx=react).errors.txt new file mode 100644 index 0000000000000..a32738b88ce84 --- /dev/null +++ b/tests/baselines/reference/jsxFragmentFactoryReference(jsx=react).errors.txt @@ -0,0 +1,15 @@ +jsxFragmentFactoryReference.tsx(3,9): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. +jsxFragmentFactoryReference.tsx(3,9): error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found. + + +==== jsxFragmentFactoryReference.tsx (2 errors) ==== + export class LoggedOut { + content = () => ( + <> + ~~ +!!! error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. + ~~ +!!! error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found. + ) + } + \ No newline at end of file diff --git a/tests/baselines/reference/jsxFragmentFactoryReference(jsx=react-jsx).errors.txt b/tests/baselines/reference/jsxFragmentFactoryReference(jsx=react-jsx).errors.txt new file mode 100644 index 0000000000000..11dd272e65c7f --- /dev/null +++ b/tests/baselines/reference/jsxFragmentFactoryReference(jsx=react-jsx).errors.txt @@ -0,0 +1,12 @@ +jsxFragmentFactoryReference.tsx(3,9): error TS2792: Cannot find module 'react/jsx-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? + + +==== jsxFragmentFactoryReference.tsx (1 errors) ==== + export class LoggedOut { + content = () => ( + <> + ~~ +!!! error TS2792: Cannot find module 'react/jsx-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? + ) + } + \ No newline at end of file diff --git a/tests/baselines/reference/jsxFragmentFactoryReference(jsx=react-jsxdev).errors.txt b/tests/baselines/reference/jsxFragmentFactoryReference(jsx=react-jsxdev).errors.txt new file mode 100644 index 0000000000000..b9185baa77ec7 --- /dev/null +++ b/tests/baselines/reference/jsxFragmentFactoryReference(jsx=react-jsxdev).errors.txt @@ -0,0 +1,12 @@ +jsxFragmentFactoryReference.tsx(3,9): error TS2792: Cannot find module 'react/jsx-dev-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? + + +==== jsxFragmentFactoryReference.tsx (1 errors) ==== + export class LoggedOut { + content = () => ( + <> + ~~ +!!! error TS2792: Cannot find module 'react/jsx-dev-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? + ) + } + \ No newline at end of file diff --git a/tests/baselines/reference/jsxJsxsCjsTransformCustomImport(jsx=react-jsx).errors.txt b/tests/baselines/reference/jsxJsxsCjsTransformCustomImport(jsx=react-jsx).errors.txt index 2b8fbaf4e46f0..248540ed384da 100644 --- a/tests/baselines/reference/jsxJsxsCjsTransformCustomImport(jsx=react-jsx).errors.txt +++ b/tests/baselines/reference/jsxJsxsCjsTransformCustomImport(jsx=react-jsx).errors.txt @@ -1,14 +1,11 @@ jsxJsxsCjsTransformCustomImport.tsx(2,11): error TS2875: This JSX tag requires the module path 'preact/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. -jsxJsxsCjsTransformCustomImport.tsx(2,11): error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found. -==== jsxJsxsCjsTransformCustomImport.tsx (2 errors) ==== +==== jsxJsxsCjsTransformCustomImport.tsx (1 errors) ==== /// const a = <> ~~ !!! error TS2875: This JSX tag requires the module path 'preact/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. - ~~ -!!! error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found.

text
diff --git a/tests/baselines/reference/jsxJsxsCjsTransformCustomImport(jsx=react-jsxdev).errors.txt b/tests/baselines/reference/jsxJsxsCjsTransformCustomImport(jsx=react-jsxdev).errors.txt index 31af5093deb3a..e66480f8dce2f 100644 --- a/tests/baselines/reference/jsxJsxsCjsTransformCustomImport(jsx=react-jsxdev).errors.txt +++ b/tests/baselines/reference/jsxJsxsCjsTransformCustomImport(jsx=react-jsxdev).errors.txt @@ -1,14 +1,11 @@ jsxJsxsCjsTransformCustomImport.tsx(2,11): error TS2875: This JSX tag requires the module path 'preact/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. -jsxJsxsCjsTransformCustomImport.tsx(2,11): error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found. -==== jsxJsxsCjsTransformCustomImport.tsx (2 errors) ==== +==== jsxJsxsCjsTransformCustomImport.tsx (1 errors) ==== /// const a = <> ~~ !!! error TS2875: This JSX tag requires the module path 'preact/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. - ~~ -!!! error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found.

text
diff --git a/tests/baselines/reference/jsxJsxsCjsTransformCustomImportPragma(jsx=react-jsx).errors.txt b/tests/baselines/reference/jsxJsxsCjsTransformCustomImportPragma(jsx=react-jsx).errors.txt index 7155c43a5dad4..c37e010cab834 100644 --- a/tests/baselines/reference/jsxJsxsCjsTransformCustomImportPragma(jsx=react-jsx).errors.txt +++ b/tests/baselines/reference/jsxJsxsCjsTransformCustomImportPragma(jsx=react-jsx).errors.txt @@ -1,5 +1,4 @@ preact.tsx(3,11): error TS2875: This JSX tag requires the module path 'preact/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. -preact.tsx(3,11): error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found. ==== react.tsx (0 errors) ==== @@ -13,14 +12,12 @@ preact.tsx(3,11): error TS2879: Using JSX fragments requires fragment factory 'R export {}; -==== preact.tsx (2 errors) ==== +==== preact.tsx (1 errors) ==== /// /* @jsxImportSource preact */ const a = <> ~~ !!! error TS2875: This JSX tag requires the module path 'preact/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. - ~~ -!!! error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found.

text
diff --git a/tests/baselines/reference/jsxJsxsCjsTransformCustomImportPragma(jsx=react-jsxdev).errors.txt b/tests/baselines/reference/jsxJsxsCjsTransformCustomImportPragma(jsx=react-jsxdev).errors.txt index ad4bb3c20b12a..79e8e02a87b2f 100644 --- a/tests/baselines/reference/jsxJsxsCjsTransformCustomImportPragma(jsx=react-jsxdev).errors.txt +++ b/tests/baselines/reference/jsxJsxsCjsTransformCustomImportPragma(jsx=react-jsxdev).errors.txt @@ -1,5 +1,4 @@ preact.tsx(3,11): error TS2875: This JSX tag requires the module path 'preact/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. -preact.tsx(3,11): error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found. ==== react.tsx (0 errors) ==== @@ -13,14 +12,12 @@ preact.tsx(3,11): error TS2879: Using JSX fragments requires fragment factory 'R export {}; -==== preact.tsx (2 errors) ==== +==== preact.tsx (1 errors) ==== /// /* @jsxImportSource preact */ const a = <> ~~ !!! error TS2875: This JSX tag requires the module path 'preact/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. - ~~ -!!! error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found.

text
diff --git a/tests/baselines/reference/jsxRuntimePragma(jsx=preserve).js b/tests/baselines/reference/jsxRuntimePragma(jsx=preserve).js new file mode 100644 index 0000000000000..6310cf21524b4 --- /dev/null +++ b/tests/baselines/reference/jsxRuntimePragma(jsx=preserve).js @@ -0,0 +1,88 @@ +//// [tests/cases/compiler/jsxRuntimePragma.ts] //// + +//// [one.tsx] +/// +/* @jsxRuntime classic */ +import * as React from "react"; +export const HelloWorld = () =>

Hello world

; +export const frag = <>
; +export const selfClosing = ; +//// [two.tsx] +/// +/* @jsxRuntime automatic */ +export const HelloWorld = () =>

Hello world

; +export const frag = <>
; +export const selfClosing = ; +//// [three.tsx] +/// +/* @jsxRuntime classic */ +/* @jsxRuntime automatic */ +export const HelloWorld = () =>

Hello world

; +export const frag = <>
; +export const selfClosing = ; +//// [four.tsx] +/// +/* @jsxRuntime automatic */ +/* @jsxRuntime classic */ +import * as React from "react"; +export const HelloWorld = () =>

Hello world

; +export const frag = <>
; +export const selfClosing = ; +//// [index.ts] +export * as one from "./one.js"; +export * as two from "./two.js"; +export * as three from "./three.js"; +export * as four from "./four.js"; + +//// [one.jsx] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.selfClosing = exports.frag = exports.HelloWorld = void 0; +/// +/* @jsxRuntime classic */ +var React = require("react"); +var HelloWorld = function () { return

Hello world

; }; +exports.HelloWorld = HelloWorld; +exports.frag = <>
; +exports.selfClosing = ; +//// [two.jsx] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.selfClosing = exports.frag = exports.HelloWorld = void 0; +/// +/* @jsxRuntime automatic */ +var HelloWorld = function () { return

Hello world

; }; +exports.HelloWorld = HelloWorld; +exports.frag = <>
; +exports.selfClosing = ; +//// [three.jsx] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.selfClosing = exports.frag = exports.HelloWorld = void 0; +/// +/* @jsxRuntime classic */ +/* @jsxRuntime automatic */ +var HelloWorld = function () { return

Hello world

; }; +exports.HelloWorld = HelloWorld; +exports.frag = <>
; +exports.selfClosing = ; +//// [four.jsx] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.selfClosing = exports.frag = exports.HelloWorld = void 0; +/// +/* @jsxRuntime automatic */ +/* @jsxRuntime classic */ +var React = require("react"); +var HelloWorld = function () { return

Hello world

; }; +exports.HelloWorld = HelloWorld; +exports.frag = <>
; +exports.selfClosing = ; +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.four = exports.three = exports.two = exports.one = void 0; +exports.one = require("./one.js"); +exports.two = require("./two.js"); +exports.three = require("./three.js"); +exports.four = require("./four.js"); diff --git a/tests/baselines/reference/jsxRuntimePragma(jsx=preserve).symbols b/tests/baselines/reference/jsxRuntimePragma(jsx=preserve).symbols new file mode 100644 index 0000000000000..0060411a1a943 --- /dev/null +++ b/tests/baselines/reference/jsxRuntimePragma(jsx=preserve).symbols @@ -0,0 +1,95 @@ +//// [tests/cases/compiler/jsxRuntimePragma.ts] //// + +=== one.tsx === +/// +/* @jsxRuntime classic */ +import * as React from "react"; +>React : Symbol(React, Decl(one.tsx, 2, 6)) + +export const HelloWorld = () =>

Hello world

; +>HelloWorld : Symbol(HelloWorld, Decl(one.tsx, 3, 12)) +>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) +>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) + +export const frag = <>
; +>frag : Symbol(frag, Decl(one.tsx, 4, 12)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) + +export const selfClosing = ; +>selfClosing : Symbol(selfClosing, Decl(one.tsx, 5, 12)) +>img : Symbol(JSX.IntrinsicElements.img, Decl(react16.d.ts, 2569, 114)) +>src : Symbol(src, Decl(one.tsx, 5, 31)) + +=== two.tsx === +/// +/* @jsxRuntime automatic */ +export const HelloWorld = () =>

Hello world

; +>HelloWorld : Symbol(HelloWorld, Decl(two.tsx, 2, 12)) +>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) +>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) + +export const frag = <>
; +>frag : Symbol(frag, Decl(two.tsx, 3, 12)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) + +export const selfClosing = ; +>selfClosing : Symbol(selfClosing, Decl(two.tsx, 4, 12)) +>img : Symbol(JSX.IntrinsicElements.img, Decl(react16.d.ts, 2569, 114)) +>src : Symbol(src, Decl(two.tsx, 4, 31)) + +=== three.tsx === +/// +/* @jsxRuntime classic */ +/* @jsxRuntime automatic */ +export const HelloWorld = () =>

Hello world

; +>HelloWorld : Symbol(HelloWorld, Decl(three.tsx, 3, 12)) +>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) +>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) + +export const frag = <>
; +>frag : Symbol(frag, Decl(three.tsx, 4, 12)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) + +export const selfClosing = ; +>selfClosing : Symbol(selfClosing, Decl(three.tsx, 5, 12)) +>img : Symbol(JSX.IntrinsicElements.img, Decl(react16.d.ts, 2569, 114)) +>src : Symbol(src, Decl(three.tsx, 5, 31)) + +=== four.tsx === +/// +/* @jsxRuntime automatic */ +/* @jsxRuntime classic */ +import * as React from "react"; +>React : Symbol(React, Decl(four.tsx, 3, 6)) + +export const HelloWorld = () =>

Hello world

; +>HelloWorld : Symbol(HelloWorld, Decl(four.tsx, 4, 12)) +>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) +>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react16.d.ts, 2556, 106)) + +export const frag = <>
; +>frag : Symbol(frag, Decl(four.tsx, 5, 12)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114)) + +export const selfClosing = ; +>selfClosing : Symbol(selfClosing, Decl(four.tsx, 6, 12)) +>img : Symbol(JSX.IntrinsicElements.img, Decl(react16.d.ts, 2569, 114)) +>src : Symbol(src, Decl(four.tsx, 6, 31)) + +=== index.ts === +export * as one from "./one.js"; +>one : Symbol(one, Decl(index.ts, 0, 6)) + +export * as two from "./two.js"; +>two : Symbol(two, Decl(index.ts, 1, 6)) + +export * as three from "./three.js"; +>three : Symbol(three, Decl(index.ts, 2, 6)) + +export * as four from "./four.js"; +>four : Symbol(four, Decl(index.ts, 3, 6)) + diff --git a/tests/baselines/reference/jsxRuntimePragma(jsx=preserve).types b/tests/baselines/reference/jsxRuntimePragma(jsx=preserve).types new file mode 100644 index 0000000000000..87eb419fb5327 --- /dev/null +++ b/tests/baselines/reference/jsxRuntimePragma(jsx=preserve).types @@ -0,0 +1,183 @@ +//// [tests/cases/compiler/jsxRuntimePragma.ts] //// + +=== Performance Stats === +Assignability cache: 2,500 +Type Count: 5,000 +Instantiation count: 50,000 +Symbol count: 50,000 + +=== one.tsx === +/// +/* @jsxRuntime classic */ +import * as React from "react"; +>React : typeof React +> : ^^^^^^^^^^^^ + +export const HelloWorld = () =>

Hello world

; +>HelloWorld : () => JSX.Element +> : ^^^^^^^^^^^^^^^^^ +>() =>

Hello world

: () => JSX.Element +> : ^^^^^^^^^^^^^^^^^ +>

Hello world

: JSX.Element +> : ^^^^^^^^^^^ +>h1 : any +> : ^^^ +>h1 : any +> : ^^^ + +export const frag = <>
; +>frag : JSX.Element +> : ^^^^^^^^^^^ +><>
: JSX.Element +> : ^^^^^^^^^^^ +>
: JSX.Element +> : ^^^^^^^^^^^ +>div : any +> : ^^^ +>div : any +> : ^^^ + +export const selfClosing = ; +>selfClosing : JSX.Element +> : ^^^^^^^^^^^ +> : JSX.Element +> : ^^^^^^^^^^^ +>img : any +> : ^^^ +>src : string +> : ^^^^^^ + +=== two.tsx === +/// +/* @jsxRuntime automatic */ +export const HelloWorld = () =>

Hello world

; +>HelloWorld : () => JSX.Element +> : ^^^^^^^^^^^^^^^^^ +>() =>

Hello world

: () => JSX.Element +> : ^^^^^^^^^^^^^^^^^ +>

Hello world

: JSX.Element +> : ^^^^^^^^^^^ +>h1 : any +> : ^^^ +>h1 : any +> : ^^^ + +export const frag = <>
; +>frag : JSX.Element +> : ^^^^^^^^^^^ +><>
: JSX.Element +> : ^^^^^^^^^^^ +>
: JSX.Element +> : ^^^^^^^^^^^ +>div : any +> : ^^^ +>div : any +> : ^^^ + +export const selfClosing = ; +>selfClosing : JSX.Element +> : ^^^^^^^^^^^ +> : JSX.Element +> : ^^^^^^^^^^^ +>img : any +> : ^^^ +>src : string +> : ^^^^^^ + +=== three.tsx === +/// +/* @jsxRuntime classic */ +/* @jsxRuntime automatic */ +export const HelloWorld = () =>

Hello world

; +>HelloWorld : () => JSX.Element +> : ^^^^^^^^^^^^^^^^^ +>() =>

Hello world

: () => JSX.Element +> : ^^^^^^^^^^^^^^^^^ +>

Hello world

: JSX.Element +> : ^^^^^^^^^^^ +>h1 : any +> : ^^^ +>h1 : any +> : ^^^ + +export const frag = <>
; +>frag : JSX.Element +> : ^^^^^^^^^^^ +><>
: JSX.Element +> : ^^^^^^^^^^^ +>
: JSX.Element +> : ^^^^^^^^^^^ +>div : any +> : ^^^ +>div : any +> : ^^^ + +export const selfClosing = ; +>selfClosing : JSX.Element +> : ^^^^^^^^^^^ +> : JSX.Element +> : ^^^^^^^^^^^ +>img : any +> : ^^^ +>src : string +> : ^^^^^^ + +=== four.tsx === +/// +/* @jsxRuntime automatic */ +/* @jsxRuntime classic */ +import * as React from "react"; +>React : typeof React +> : ^^^^^^^^^^^^ + +export const HelloWorld = () =>

Hello world

; +>HelloWorld : () => JSX.Element +> : ^^^^^^^^^^^^^^^^^ +>() =>

Hello world

: () => JSX.Element +> : ^^^^^^^^^^^^^^^^^ +>

Hello world

: JSX.Element +> : ^^^^^^^^^^^ +>h1 : any +> : ^^^ +>h1 : any +> : ^^^ + +export const frag = <>
; +>frag : JSX.Element +> : ^^^^^^^^^^^ +><>
: JSX.Element +> : ^^^^^^^^^^^ +>
: JSX.Element +> : ^^^^^^^^^^^ +>div : any +> : ^^^ +>div : any +> : ^^^ + +export const selfClosing = ; +>selfClosing : JSX.Element +> : ^^^^^^^^^^^ +> : JSX.Element +> : ^^^^^^^^^^^ +>img : any +> : ^^^ +>src : string +> : ^^^^^^ + +=== index.ts === +export * as one from "./one.js"; +>one : typeof import("one") +> : ^^^^^^^^^^^^^^^^^^^^ + +export * as two from "./two.js"; +>two : typeof import("two") +> : ^^^^^^^^^^^^^^^^^^^^ + +export * as three from "./three.js"; +>three : typeof import("three") +> : ^^^^^^^^^^^^^^^^^^^^^^ + +export * as four from "./four.js"; +>four : typeof import("four") +> : ^^^^^^^^^^^^^^^^^^^^^ + diff --git a/tests/baselines/reference/parseUnaryExpressionNoTypeAssertionInJsx2.errors.txt b/tests/baselines/reference/parseUnaryExpressionNoTypeAssertionInJsx2.errors.txt index b4fb215aaed6f..69e07e52360a5 100644 --- a/tests/baselines/reference/parseUnaryExpressionNoTypeAssertionInJsx2.errors.txt +++ b/tests/baselines/reference/parseUnaryExpressionNoTypeAssertionInJsx2.errors.txt @@ -1,17 +1,14 @@ index.js(2,12): error TS17014: JSX fragment has no corresponding closing tag. -index.js(2,13): error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found. index.js(2,13): error TS17004: Cannot use JSX unless the '--jsx' flag is provided. index.js(3,1): error TS1005: ' x; ~~~ !!! error TS17014: JSX fragment has no corresponding closing tag. ~~ -!!! error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found. - ~~ !!! error TS17004: Cannot use JSX unless the '--jsx' flag is provided. diff --git a/tests/baselines/reference/parseUnaryExpressionNoTypeAssertionInJsx4.errors.txt b/tests/baselines/reference/parseUnaryExpressionNoTypeAssertionInJsx4.errors.txt index 403885082355f..2c200912716c1 100644 --- a/tests/baselines/reference/parseUnaryExpressionNoTypeAssertionInJsx4.errors.txt +++ b/tests/baselines/reference/parseUnaryExpressionNoTypeAssertionInJsx4.errors.txt @@ -1,12 +1,11 @@ index.tsx(3,14): error TS17008: JSX element 'number' has no corresponding closing tag. -index.tsx(4,13): error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found. index.tsx(4,13): error TS17014: JSX fragment has no corresponding closing tag. index.tsx(5,14): error TS1003: Identifier expected. index.tsx(5,18): error TS1382: Unexpected token. Did you mean `{'>'}` or `>`? index.tsx(6,1): error TS1005: ' x; @@ -14,8 +13,6 @@ index.tsx(6,1): error TS1005: ' x; ~~ -!!! error TS2879: Using JSX fragments requires fragment factory 'React' to be in scope, but it could not be found. - ~~ !!! error TS17014: JSX fragment has no corresponding closing tag. const c = + <1234> x; ~~~~ diff --git a/tests/cases/compiler/jsxFragmentFactoryReference.tsx b/tests/cases/compiler/jsxFragmentFactoryReference.tsx new file mode 100644 index 0000000000000..99f2fc118de87 --- /dev/null +++ b/tests/cases/compiler/jsxFragmentFactoryReference.tsx @@ -0,0 +1,14 @@ +// @noTypesAndSymbols: true +// @noEmit: true +// @jsx: preserve, react, react-jsx, react-jsxdev, react-native +// @strict: true +// @skipLibCheck: true +// @target: ES2017 +// @module: ESNext +// @esModuleInterop: true + +export class LoggedOut { + content = () => ( + <> + ) +} diff --git a/tests/cases/compiler/jsxRuntimePragma.ts b/tests/cases/compiler/jsxRuntimePragma.ts index c3d1829b3861d..0a14e9503e79d 100644 --- a/tests/cases/compiler/jsxRuntimePragma.ts +++ b/tests/cases/compiler/jsxRuntimePragma.ts @@ -1,4 +1,4 @@ -// @jsx: react,react-jsx,react-jsxdev +// @jsx: react,react-jsx,react-jsxdev,preserve // @filename: one.tsx /// /* @jsxRuntime classic */ From 6a00bd2422ffa46c13ac8ff81d7b4b1157e60ba7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 01:20:52 -0800 Subject: [PATCH 20/46] Bump the github-actions group with 3 updates (#60713) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- .github/workflows/codeql.yml | 6 +++--- .github/workflows/scorecard.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03bdee7c3c9cc..755827e99b29b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,7 @@ jobs: name: coverage path: coverage - - uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7 + - uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1 with: use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }} disable_search: true @@ -137,7 +137,7 @@ jobs: node-version: 'lts/*' - run: npm ci - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 + - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 with: path: ~/.cache/dprint key: ${{ runner.os }}-dprint-${{ hashFiles('package-lock.json', '.dprint.jsonc') }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 9725306635461..eaf86b3ed4bd6 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -46,7 +46,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 + uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 with: config-file: ./.github/codeql/codeql-configuration.yml # Override language selection by uncommenting this and choosing your languages @@ -56,7 +56,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below). - name: Autobuild - uses: github/codeql-action/autobuild@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 + uses: github/codeql-action/autobuild@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -70,4 +70,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 + uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 5e5ffeb2de92b..0d3ec6648a560 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -55,6 +55,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: 'Upload to code-scanning' - uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 + uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 with: sarif_file: results.sarif From 44e84bb7b0ced9bc703b05e317893f594bfcb920 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Thu, 12 Dec 2024 11:42:25 -0800 Subject: [PATCH 21/46] Do not require import attribute on type-only JSON import (#60749) --- src/compiler/checker.ts | 2 +- .../nodeModulesJson(module=node16).errors.txt | 15 ++++++++++----- .../nodeModulesJson(module=node16).symbols | 14 ++++++++++---- .../nodeModulesJson(module=node16).types | 10 ++++++++++ .../nodeModulesJson(module=nodenext).errors.txt | 11 ++++++++--- .../nodeModulesJson(module=nodenext).symbols | 14 ++++++++++---- .../nodeModulesJson(module=nodenext).types | 10 ++++++++++ tests/cases/conformance/node/nodeModulesJson.ts | 2 ++ 8 files changed, 61 insertions(+), 17 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 690b17c376445..565420738d8ce 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -48122,7 +48122,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } } - if (moduleKind === ModuleKind.NodeNext && isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) { + if (!importClause.isTypeOnly && moduleKind === ModuleKind.NodeNext && isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) { // Import attributes/assertions are not allowed in --module node16, so don't suggest adding one error(node.moduleSpecifier, Diagnostics.Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0, ModuleKind[moduleKind]); } diff --git a/tests/baselines/reference/nodeModulesJson(module=node16).errors.txt b/tests/baselines/reference/nodeModulesJson(module=node16).errors.txt index 989bb7dcf9a58..ec8512329307c 100644 --- a/tests/baselines/reference/nodeModulesJson(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesJson(module=node16).errors.txt @@ -2,10 +2,11 @@ /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', 'nodenext', or 'preserve'. /main.mts(6,52): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -/main.mts(8,10): error TS1544: Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to 'Node16'. -/main.mts(8,41): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -/main.mts(9,42): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -/main.mts(10,9): error TS2339: Property 'version' does not exist on type '{ default: { version: number; }; }'. +/main.mts(9,47): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', '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', 'nodenext', or 'preserve'. +/main.mts(11,42): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +/main.mts(12,9): error TS2339: Property 'version' does not exist on type '{ default: { version: number; }; }'. ==== /node_modules/not.json/package.json (0 errors) ==== @@ -42,7 +43,7 @@ "version": 1 } -==== /main.mts (6 errors) ==== +==== /main.mts (7 errors) ==== import { oops } from "not.json"; // Ok import moreOops from "actually-json"; // Error in nodenext import typed from "actually-json/typed"; // Error in nodenext @@ -54,6 +55,10 @@ ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', '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', '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'. diff --git a/tests/baselines/reference/nodeModulesJson(module=node16).symbols b/tests/baselines/reference/nodeModulesJson(module=node16).symbols index 42c68c640a2e7..52d983d5b9516 100644 --- a/tests/baselines/reference/nodeModulesJson(module=node16).symbols +++ b/tests/baselines/reference/nodeModulesJson(module=node16).symbols @@ -42,18 +42,24 @@ import { default as config1 } from "./config.json" with { type: "json" }; // Ok 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, 7, 8)) +>version : Symbol(version, Decl(main.mts, 9, 8)) import * as config3 from "./config.json" with { type: "json" }; ->config3 : Symbol(config3, Decl(main.mts, 8, 6)) +>config3 : Symbol(config3, Decl(main.mts, 10, 6)) config3.version; // Error ->config3 : Symbol(config3, Decl(main.mts, 8, 6)) +>config3 : Symbol(config3, Decl(main.mts, 10, 6)) config3.default; // Ok >config3.default : Symbol("/config") ->config3 : Symbol(config3, Decl(main.mts, 8, 6)) +>config3 : Symbol(config3, Decl(main.mts, 10, 6)) >default : Symbol("/config") === /loosey.cts === diff --git a/tests/baselines/reference/nodeModulesJson(module=node16).types b/tests/baselines/reference/nodeModulesJson(module=node16).types index 2c41926af320a..37ac9a196dd4e 100644 --- a/tests/baselines/reference/nodeModulesJson(module=node16).types +++ b/tests/baselines/reference/nodeModulesJson(module=node16).types @@ -64,6 +64,16 @@ 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 > : ^^^^^^ diff --git a/tests/baselines/reference/nodeModulesJson(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesJson(module=nodenext).errors.txt index bf355357b0905..04e6a649d3f25 100644 --- a/tests/baselines/reference/nodeModulesJson(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesJson(module=nodenext).errors.txt @@ -3,8 +3,9 @@ /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 'NodeNext'. /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 'NodeNext'. /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 'NodeNext'. -/main.mts(8,10): error TS1544: Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to 'NodeNext'. -/main.mts(10,9): error TS2339: Property 'version' does not exist on type '{ default: { version: number; }; }'. +/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 'NodeNext'. +/main.mts(12,9): error TS2339: Property 'version' does not exist on type '{ default: { version: number; }; }'. ==== /node_modules/not.json/package.json (0 errors) ==== @@ -41,7 +42,7 @@ "version": 1 } -==== /main.mts (5 errors) ==== +==== /main.mts (6 errors) ==== import { oops } from "not.json"; // Ok import moreOops from "actually-json"; // Error in nodenext ~~~~~~~~~~~~~~~ @@ -55,6 +56,10 @@ 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 'NodeNext'. + 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 'NodeNext'. diff --git a/tests/baselines/reference/nodeModulesJson(module=nodenext).symbols b/tests/baselines/reference/nodeModulesJson(module=nodenext).symbols index 42c68c640a2e7..52d983d5b9516 100644 --- a/tests/baselines/reference/nodeModulesJson(module=nodenext).symbols +++ b/tests/baselines/reference/nodeModulesJson(module=nodenext).symbols @@ -42,18 +42,24 @@ import { default as config1 } from "./config.json" with { type: "json" }; // Ok 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, 7, 8)) +>version : Symbol(version, Decl(main.mts, 9, 8)) import * as config3 from "./config.json" with { type: "json" }; ->config3 : Symbol(config3, Decl(main.mts, 8, 6)) +>config3 : Symbol(config3, Decl(main.mts, 10, 6)) config3.version; // Error ->config3 : Symbol(config3, Decl(main.mts, 8, 6)) +>config3 : Symbol(config3, Decl(main.mts, 10, 6)) config3.default; // Ok >config3.default : Symbol("/config") ->config3 : Symbol(config3, Decl(main.mts, 8, 6)) +>config3 : Symbol(config3, Decl(main.mts, 10, 6)) >default : Symbol("/config") === /loosey.cts === diff --git a/tests/baselines/reference/nodeModulesJson(module=nodenext).types b/tests/baselines/reference/nodeModulesJson(module=nodenext).types index 2c41926af320a..37ac9a196dd4e 100644 --- a/tests/baselines/reference/nodeModulesJson(module=nodenext).types +++ b/tests/baselines/reference/nodeModulesJson(module=nodenext).types @@ -64,6 +64,16 @@ 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 > : ^^^^^^ diff --git a/tests/cases/conformance/node/nodeModulesJson.ts b/tests/cases/conformance/node/nodeModulesJson.ts index e231ec9b0aa1d..44469097d0d06 100644 --- a/tests/cases/conformance/node/nodeModulesJson.ts +++ b/tests/cases/conformance/node/nodeModulesJson.ts @@ -44,6 +44,8 @@ import typed from "actually-json/typed"; // Error in nodenext 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 +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 import { version } from "./config.json" with { type: "json" }; // Error, named import import * as config3 from "./config.json" with { type: "json" }; config3.version; // Error From 4a18b5cf8d41975c86cde25a0b2229f81e3b08d2 Mon Sep 17 00:00:00 2001 From: "CSIGS@microsoft.com" Date: Thu, 12 Dec 2024 13:21:18 -0800 Subject: [PATCH 22/46] LEGO: Pull request from lego/hb_5378966c-b857-470a-8675-daebef4a6da1_20241212204530251 to main (#60752) --- .../diagnosticMessages.generated.json.lcl | 18 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 15 +++++++++++++++ .../diagnosticMessages.generated.json.lcl | 18 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 18 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 18 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 18 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 18 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 18 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 15 +++++++++++++++ .../diagnosticMessages.generated.json.lcl | 15 +++++++++++++++ .../diagnosticMessages.generated.json.lcl | 15 +++++++++++++++ .../diagnosticMessages.generated.json.lcl | 18 ++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 18 ++++++++++++++++++ 13 files changed, 222 insertions(+) diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl index 9fc8214143d81..71adee214090b 100644 --- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15360,6 +15360,15 @@ + + + + + + + + + @@ -15387,6 +15396,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl index 29b5b6df78089..b6846c4aaf886 100644 --- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15360,6 +15360,12 @@ + + + + + + @@ -15387,6 +15393,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl index 266ee953659d9..adb2e9db074c2 100644 --- a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15369,6 +15369,15 @@ + + + + + + + + + @@ -15396,6 +15405,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl index ba23d0392aac1..4be73d92563f7 100644 --- a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15354,6 +15354,15 @@ + + + + + + + + + @@ -15381,6 +15390,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl index d7c8533e119d4..18185349b7bd0 100644 --- a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15372,6 +15372,15 @@ + + + + + + + + + @@ -15399,6 +15408,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl index 97df1cdcaca7f..0ad04f3a8f725 100644 --- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15372,6 +15372,15 @@ + + + + + + + + + @@ -15399,6 +15408,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl index a545736da880a..0740a0f3970b9 100644 --- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15360,6 +15360,15 @@ + + + + + + + + + @@ -15387,6 +15396,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl index 4ac9ca5d2d18b..ccd553cb14823 100644 --- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15360,6 +15360,15 @@ + + + + + + + + + @@ -15387,6 +15396,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl index 0112bb4853d22..49eab76d3b49b 100644 --- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15360,6 +15360,12 @@ + + + + + + @@ -15387,6 +15393,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 605b3c8049d88..1a1e4c36f5066 100644 --- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15347,6 +15347,12 @@ + + + + + + @@ -15374,6 +15380,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl index 4b9bb462fe834..697986a726e03 100644 --- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15350,6 +15350,12 @@ + + + + + + @@ -15377,6 +15383,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl index a7e54d070f910..a673e66cb10cc 100644 --- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15359,6 +15359,15 @@ + + + + + + + + + @@ -15386,6 +15395,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl index e6c4b5f4216e0..2253ce7f3a07a 100644 --- a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15353,6 +15353,15 @@ + + + + + + + + + @@ -15380,6 +15389,15 @@ + + + + + + + + + From f69580f82146bebfb2bee8c7b8666af0e04c7e34 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Fri, 13 Dec 2024 10:16:23 -0800 Subject: [PATCH 23/46] Add `--module node18` (#60722) --- src/compiler/checker.ts | 45 +- src/compiler/commandLineParser.ts | 1 + src/compiler/diagnosticMessages.json | 16 +- src/compiler/program.ts | 3 +- src/compiler/transformer.ts | 1 + src/compiler/types.ts | 1 + src/compiler/utilities.ts | 25 +- src/server/protocol.ts | 1 + .../codefixes/fixModuleAndTargetOptions.ts | 6 +- src/services/codefixes/importFixes.ts | 1 + tests/baselines/reference/api/typescript.d.ts | 2 + ...entifiers_module(module=node18).errors.txt | 42 + ...espaceIdentifiers_module(module=node18).js | 104 ++ ...eIdentifiers_module(module=node18).symbols | 82 + ...aceIdentifiers_module(module=node18).types | 151 ++ .../awaitInNonAsyncFunction.errors.txt | 8 +- ...ngDeclarations.1(target=es2015).errors.txt | 60 +- ...UsingDeclarations.1(target=es5).errors.txt | 60 +- ...ngDeclarations.2(target=es2015).errors.txt | 4 +- ...UsingDeclarations.2(target=es5).errors.txt | 4 +- ...ngDeclarations.3(target=es2015).errors.txt | 4 +- ...UsingDeclarations.3(target=es5).errors.txt | 4 +- ...tionsInForAwaitOf.3(target=es5).errors.txt | 4 +- .../Parse empty options of --module.js | 2 +- ...odule to compiler-options with json api.js | 2 +- ...ompiler-options with jsonSourceFile api.js | 2 +- ...hLocalCollisions(module=node18).errors.txt | 12 + ...lpersWithLocalCollisions(module=node18).js | 26 + ...portAssertion1(module=commonjs).errors.txt | 48 +- ...importAssertion1(module=es2015).errors.txt | 56 +- ...portAssertion2(module=commonjs).errors.txt | 24 +- ...importAssertion2(module=es2015).errors.txt | 24 +- ...importAssertion3(module=es2015).errors.txt | 16 +- ...ortAttributes1(module=commonjs).errors.txt | 48 +- ...mportAttributes1(module=es2015).errors.txt | 56 +- ...ortAttributes2(module=commonjs).errors.txt | 24 +- ...mportAttributes2(module=es2015).errors.txt | 24 +- ...mportAttributes3(module=es2015).errors.txt | 16 +- ...portCallExpressionErrorInES2015.errors.txt | 12 +- ...mportCallExpressionGrammarError.errors.txt | 4 +- ...mportCallExpressionNestedES2015.errors.txt | 8 +- ...portCallExpressionNestedES20152.errors.txt | 8 +- ...eta(module=commonjs,target=es5).errors.txt | 52 +- ...(module=commonjs,target=esnext).errors.txt | 52 +- .../reference/importTag14.errors.txt | 4 +- .../importTag15(module=es2015).errors.txt | 8 +- ...deDefaultImports(module=node18).errors.txt | 64 + ...moduleNodeDefaultImports(module=node18).js | 65 + ...eNodeDefaultImports(module=node18).symbols | 116 ++ ...uleNodeDefaultImports(module=node18).types | 210 +++ ...veTopLevelAwait1(target=es2016).errors.txt | 8 +- ...(module=node18,moduleresolution=node16).js | 52 + ...le=node18,moduleresolution=node16).symbols | 15 + ...dule=node18,moduleresolution=node16).types | 22 + ...odule=node18,moduleresolution=nodenext).js | 52 + ...=node18,moduleresolution=nodenext).symbols | 15 + ...le=node18,moduleresolution=nodenext).types | 22 + ...sPackageSelfName(module=node18).errors.txt | 26 + ...deAllowJsPackageSelfName(module=node18).js | 77 + ...owJsPackageSelfName(module=node18).symbols | 26 + ...llowJsPackageSelfName(module=node18).types | 32 + .../nodeModules1(module=node18).errors.txt | 564 +++++++ .../reference/nodeModules1(module=node18).js | 710 ++++++++ .../nodeModules1(module=node18).symbols | 819 ++++++++++ .../nodeModules1(module=node18).types | 1440 +++++++++++++++++ ...eModulesAllowJs1(module=node18).errors.txt | 663 ++++++++ .../nodeModulesAllowJs1(module=node18).js | 698 ++++++++ ...nodeModulesAllowJs1(module=node18).symbols | 819 ++++++++++ .../nodeModulesAllowJs1(module=node18).types | 1440 +++++++++++++++++ ...lesAllowJsCjsFromJs(module=node18).symbols | 17 + ...dulesAllowJsCjsFromJs(module=node18).types | 28 + ...alPackageExports(module=node18).errors.txt | 137 ++ ...onditionalPackageExports(module=node18).js | 215 +++ ...ionalPackageExports(module=node18).symbols | 245 +++ ...itionalPackageExports(module=node18).types | 344 ++++ ...ulesAllowJsDynamicImport(module=node18).js | 44 + ...llowJsDynamicImport(module=node18).symbols | 24 + ...sAllowJsDynamicImport(module=node18).types | 36 + ...ExportAssignment(module=node18).errors.txt | 41 + ...sAllowJsExportAssignment(module=node18).js | 62 + ...wJsExportAssignment(module=node18).symbols | 38 + ...lowJsExportAssignment(module=node18).types | 67 + ...essJsModuleDetectionAuto(module=node18).js | 13 + ...ModuleDetectionAuto(module=node18).symbols | 8 + ...JsModuleDetectionAuto(module=node18).types | 8 + ...edNameCollisions(module=node18).errors.txt | 38 + ...sGeneratedNameCollisions(module=node18).js | 62 + ...ratedNameCollisions(module=node18).symbols | 40 + ...neratedNameCollisions(module=node18).types | 62 + ...ImportAssignment(module=node18).errors.txt | 49 + ...sAllowJsImportAssignment(module=node18).js | 65 + ...wJsImportAssignment(module=node18).symbols | 45 + ...lowJsImportAssignment(module=node18).types | 69 + ...lpersCollisions1(module=node18).errors.txt | 36 + ...ImportHelpersCollisions1(module=node18).js | 52 + ...tHelpersCollisions1(module=node18).symbols | 42 + ...ortHelpersCollisions1(module=node18).types | 70 + ...lpersCollisions2(module=node18).errors.txt | 32 + ...ImportHelpersCollisions2(module=node18).js | 47 + ...tHelpersCollisions2(module=node18).symbols | 24 + ...ortHelpersCollisions2(module=node18).types | 28 + ...lpersCollisions3(module=node18).errors.txt | 31 + ...ImportHelpersCollisions3(module=node18).js | 52 + ...tHelpersCollisions3(module=node18).symbols | 38 + ...ortHelpersCollisions3(module=node18).types | 50 + ...llowJsImportMeta(module=node18).errors.txt | 23 + ...ModulesAllowJsImportMeta(module=node18).js | 38 + ...esAllowJsImportMeta(module=node18).symbols | 26 + ...ulesAllowJsImportMeta(module=node18).types | 38 + ...JsPackageExports(module=node18).errors.txt | 109 ++ ...lesAllowJsPackageExports(module=node18).js | 175 ++ ...lowJsPackageExports(module=node18).symbols | 176 ++ ...AllowJsPackageExports(module=node18).types | 230 +++ ...JsPackageImports(module=node18).errors.txt | 46 + ...lesAllowJsPackageImports(module=node18).js | 106 ++ ...lowJsPackageImports(module=node18).symbols | 62 + ...AllowJsPackageImports(module=node18).types | 80 + ...gePatternExports(module=node18).errors.txt | 78 + ...wJsPackagePatternExports(module=node18).js | 134 ++ ...ckagePatternExports(module=node18).symbols | 122 ++ ...PackagePatternExports(module=node18).types | 158 ++ ...rnExportsExclude(module=node18).errors.txt | 123 ++ ...agePatternExportsExclude(module=node18).js | 137 ++ ...tternExportsExclude(module=node18).symbols | 122 ++ ...PatternExportsExclude(module=node18).types | 158 ++ ...nExportsTrailers(module=node18).errors.txt | 78 + ...gePatternExportsTrailers(module=node18).js | 134 ++ ...ternExportsTrailers(module=node18).symbols | 122 ++ ...atternExportsTrailers(module=node18).types | 158 ++ ...ronousCallErrors(module=node18).errors.txt | 57 + ...wJsSynchronousCallErrors(module=node18).js | 68 + ...nchronousCallErrors(module=node18).symbols | 60 + ...SynchronousCallErrors(module=node18).types | 102 ++ ...wJsTopLevelAwait(module=node18).errors.txt | 28 + ...ulesAllowJsTopLevelAwait(module=node18).js | 42 + ...llowJsTopLevelAwait(module=node18).symbols | 24 + ...sAllowJsTopLevelAwait(module=node18).types | 42 + ...rmatFileAlwaysHasDefault(module=node18).js | 36 + ...ileAlwaysHasDefault(module=node18).symbols | 15 + ...tFileAlwaysHasDefault(module=node18).types | 20 + ...alPackageExports(module=node18).errors.txt | 137 ++ ...onditionalPackageExports(module=node18).js | 215 +++ ...ionalPackageExports(module=node18).symbols | 245 +++ ...itionalPackageExports(module=node18).types | 344 ++++ ...thPackageExports(module=node18).errors.txt | 118 ++ ...onEmitWithPackageExports(module=node18).js | 212 +++ ...tWithPackageExports(module=node18).symbols | 203 +++ ...mitWithPackageExports(module=node18).types | 284 ++++ ...nodeModulesDynamicImport(module=node18).js | 44 + ...odulesDynamicImport(module=node18).symbols | 24 + ...eModulesDynamicImport(module=node18).types | 36 + ...xportAssignments(module=node18).errors.txt | 23 + ...ModulesExportAssignments(module=node18).js | 38 + ...esExportAssignments(module=node18).symbols | 18 + ...ulesExportAssignments(module=node18).types | 26 + ...cifierResolution(module=node18).errors.txt | 33 + ...locksSpecifierResolution(module=node18).js | 30 + ...SpecifierResolution(module=node18).symbols | 27 + ...ksSpecifierResolution(module=node18).types | 39 + ...cksTypesVersions(module=node18).errors.txt | 92 ++ ...portsBlocksTypesVersions(module=node18).js | 70 + ...BlocksTypesVersions(module=node18).symbols | 28 + ...cksTypesVersions(module=node18).trace.json | 1080 +++++++++++++ ...tsBlocksTypesVersions(module=node18).types | 28 + ...sExportsSourceTs(module=node18).errors.txt | 34 + ...deModulesExportsSourceTs(module=node18).js | 44 + ...ulesExportsSourceTs(module=node18).symbols | 31 + ...odulesExportsSourceTs(module=node18).types | 47 + ...rationConditions(module=node18).errors.txt | 37 + ...fierGenerationConditions(module=node18).js | 41 + ...enerationConditions(module=node18).symbols | 27 + ...rGenerationConditions(module=node18).types | 39 + ...erationDirectory(module=node18).errors.txt | 32 + ...ifierGenerationDirectory(module=node18).js | 36 + ...GenerationDirectory(module=node18).symbols | 27 + ...erGenerationDirectory(module=node18).types | 39 + ...enerationPattern(module=node18).errors.txt | 32 + ...ecifierGenerationPattern(module=node18).js | 36 + ...erGenerationPattern(module=node18).symbols | 27 + ...fierGenerationPattern(module=node18).types | 39 + ...esForbidenSyntax(module=node18).errors.txt | 139 ++ ...odeModulesForbidenSyntax(module=node18).js | 172 ++ ...dulesForbidenSyntax(module=node18).symbols | 122 ++ ...ModulesForbidenSyntax(module=node18).types | 266 +++ ...edNameCollisions(module=node18).errors.txt | 38 + ...sGeneratedNameCollisions(module=node18).js | 64 + ...ratedNameCollisions(module=node18).symbols | 40 + ...neratedNameCollisions(module=node18).types | 62 + ...ImportAssertions(module=node16).errors.txt | 8 +- ...ImportAssertions(module=node18).errors.txt | 16 + ...eModulesImportAssertions(module=node18).js | 20 + ...lesImportAssertions(module=node18).symbols | 27 + ...dulesImportAssertions(module=node18).types | 57 + ...ModulesImportAssignments(module=node18).js | 65 + ...esImportAssignments(module=node18).symbols | 45 + ...ulesImportAssignments(module=node18).types | 63 + ...ImportAttributes(module=node16).errors.txt | 8 +- ...ImportAttributes(module=node18).errors.txt | 17 + ...eModulesImportAttributes(module=node18).js | 21 + ...lesImportAttributes(module=node18).symbols | 28 + ...dulesImportAttributes(module=node18).types | 58 + ...DeclarationEmit1(module=node16).errors.txt | 8 +- ...DeclarationEmit1(module=node18).errors.txt | 37 + ...utesModeDeclarationEmit1(module=node18).js | 45 + ...odeDeclarationEmit1(module=node18).symbols | 40 + ...sModeDeclarationEmit1(module=node18).types | 41 + ...DeclarationEmit2(module=node16).errors.txt | 8 +- ...DeclarationEmit2(module=node18).errors.txt | 42 + ...utesModeDeclarationEmit2(module=node18).js | 49 + ...odeDeclarationEmit2(module=node18).symbols | 40 + ...sModeDeclarationEmit2(module=node18).types | 41 + ...rationEmitErrors(module=node16).errors.txt | 12 +- ...rationEmitErrors(module=node18).errors.txt | 43 + ...odeDeclarationEmitErrors(module=node18).js | 39 + ...clarationEmitErrors(module=node18).symbols | 30 + ...DeclarationEmitErrors(module=node18).types | 32 + ...sTypeModeDeclarationEmit(module=node18).js | 36 + ...ModeDeclarationEmit(module=node18).symbols | 28 + ...peModeDeclarationEmit(module=node18).types | 34 + ...rationEmitErrors(module=node18).errors.txt | 308 ++++ ...odeDeclarationEmitErrors(module=node18).js | 153 ++ ...clarationEmitErrors(module=node18).symbols | 130 ++ ...DeclarationEmitErrors(module=node18).types | 293 ++++ ...elpersCollisions(module=node18).errors.txt | 36 + ...sImportHelpersCollisions(module=node18).js | 52 + ...rtHelpersCollisions(module=node18).symbols | 42 + ...portHelpersCollisions(module=node18).types | 70 + ...lpersCollisions2(module=node18).errors.txt | 32 + ...ImportHelpersCollisions2(module=node18).js | 47 + ...tHelpersCollisions2(module=node18).symbols | 24 + ...ortHelpersCollisions2(module=node18).types | 28 + ...lpersCollisions3(module=node18).errors.txt | 27 + ...ImportHelpersCollisions3(module=node18).js | 42 + ...tHelpersCollisions3(module=node18).symbols | 22 + ...ortHelpersCollisions3(module=node18).types | 26 + ...odulesImportMeta(module=node18).errors.txt | 23 + .../nodeModulesImportMeta(module=node18).js | 40 + ...deModulesImportMeta(module=node18).symbols | 26 + ...nodeModulesImportMeta(module=node18).types | 38 + ...DeclarationEmit1(module=node16).errors.txt | 8 +- ...DeclarationEmit1(module=node18).errors.txt | 37 + ...portModeDeclarationEmit1(module=node18).js | 45 + ...odeDeclarationEmit1(module=node18).symbols | 40 + ...tModeDeclarationEmit1(module=node18).types | 41 + ...DeclarationEmit2(module=node16).errors.txt | 8 +- ...DeclarationEmit2(module=node18).errors.txt | 42 + ...portModeDeclarationEmit2(module=node18).js | 49 + ...odeDeclarationEmit2(module=node18).symbols | 40 + ...tModeDeclarationEmit2(module=node18).types | 41 + ...ationEmitErrors1(module=node16).errors.txt | 12 +- ...ationEmitErrors1(module=node18).errors.txt | 43 + ...deDeclarationEmitErrors1(module=node18).js | 39 + ...larationEmitErrors1(module=node18).symbols | 30 + ...eclarationEmitErrors1(module=node18).types | 32 + ...portResolutionIntoExport(module=node18).js | 80 + ...esolutionIntoExport(module=node18).symbols | 26 + ...tResolutionIntoExport(module=node18).types | 32 + ...esolutionNoCycle(module=node18).errors.txt | 33 + ...sImportResolutionNoCycle(module=node18).js | 80 + ...rtResolutionNoCycle(module=node18).symbols | 26 + ...portResolutionNoCycle(module=node18).types | 32 + ...TypeModeDeclarationEmit1(module=node18).js | 36 + ...odeDeclarationEmit1(module=node18).symbols | 28 + ...eModeDeclarationEmit1(module=node18).types | 34 + ...ationEmitErrors1(module=node18).errors.txt | 302 ++++ ...deDeclarationEmitErrors1(module=node18).js | 147 ++ ...larationEmitErrors1(module=node18).symbols | 130 ++ ...eclarationEmitErrors1(module=node18).types | 291 ++++ .../nodeModulesJson(module=node16).errors.txt | 24 +- .../nodeModulesJson(module=node18).errors.txt | 83 + .../nodeModulesJson(module=node18).symbols | 85 + .../nodeModulesJson(module=node18).types | 139 ++ ...esPackageExports(module=node18).errors.txt | 109 ++ ...odeModulesPackageExports(module=node18).js | 175 ++ ...dulesPackageExports(module=node18).symbols | 176 ++ ...ModulesPackageExports(module=node18).types | 230 +++ ...esPackageImports(module=node18).errors.txt | 44 + ...odeModulesPackageImports(module=node18).js | 106 ++ ...dulesPackageImports(module=node18).symbols | 62 + ...esPackageImports(module=node18).trace.json | 992 ++++++++++++ ...ModulesPackageImports(module=node18).types | 80 + ...gePatternExports(module=node18).errors.txt | 78 + ...lesPackagePatternExports(module=node18).js | 134 ++ ...ckagePatternExports(module=node18).symbols | 122 ++ ...PackagePatternExports(module=node18).types | 158 ++ ...rnExportsExclude(module=node18).errors.txt | 177 ++ ...agePatternExportsExclude(module=node18).js | 197 +++ ...tternExportsExclude(module=node18).symbols | 236 +++ ...PatternExportsExclude(module=node18).types | 308 ++++ ...nExportsTrailers(module=node18).errors.txt | 78 + ...gePatternExportsTrailers(module=node18).js | 134 ++ ...ternExportsTrailers(module=node18).symbols | 122 ++ ...nExportsTrailers(module=node18).trace.json | 1055 ++++++++++++ ...atternExportsTrailers(module=node18).types | 158 ++ ...esolveJsonModule(module=node16).errors.txt | 16 +- ...ModulesResolveJsonModule(module=node18).js | 130 ++ ...esResolveJsonModule(module=node18).symbols | 91 ++ ...ulesResolveJsonModule(module=node18).types | 152 ++ ...ronousCallErrors(module=node18).errors.txt | 45 + ...lesSynchronousCallErrors(module=node18).js | 59 + ...nchronousCallErrors(module=node18).symbols | 60 + ...SynchronousCallErrors(module=node18).types | 102 ++ ...lesTopLevelAwait(module=node18).errors.txt | 28 + ...nodeModulesTopLevelAwait(module=node18).js | 44 + ...odulesTopLevelAwait(module=node18).symbols | 24 + ...eModulesTopLevelAwait(module=node18).types | 42 + ...enceModeDeclarationEmit1(module=node18).js | 35 + ...odeDeclarationEmit1(module=node18).symbols | 16 + ...eModeDeclarationEmit1(module=node18).types | 14 + ...enceModeDeclarationEmit2(module=node18).js | 39 + ...odeDeclarationEmit2(module=node18).symbols | 16 + ...eModeDeclarationEmit2(module=node18).types | 14 + ...enceModeDeclarationEmit3(module=node18).js | 39 + ...odeDeclarationEmit3(module=node18).symbols | 16 + ...eModeDeclarationEmit3(module=node18).types | 14 + ...enceModeDeclarationEmit4(module=node18).js | 35 + ...odeDeclarationEmit4(module=node18).symbols | 16 + ...eModeDeclarationEmit4(module=node18).types | 14 + ...enceModeDeclarationEmit5(module=node18).js | 38 + ...odeDeclarationEmit5(module=node18).symbols | 26 + ...eModeDeclarationEmit5(module=node18).types | 23 + ...enceModeDeclarationEmit6(module=node18).js | 53 + ...odeDeclarationEmit6(module=node18).symbols | 27 + ...eModeDeclarationEmit6(module=node18).types | 36 + ...enceModeDeclarationEmit7(module=node18).js | 139 ++ ...odeDeclarationEmit7(module=node18).symbols | 53 + ...eModeDeclarationEmit7(module=node18).types | 68 + ...nceModeOverride1(module=node18).errors.txt | 29 + ...shReferenceModeOverride1(module=node18).js | 33 + ...erenceModeOverride1(module=node18).symbols | 17 + ...eferenceModeOverride1(module=node18).types | 23 + ...nceModeOverride2(module=node18).errors.txt | 34 + ...shReferenceModeOverride2(module=node18).js | 37 + ...erenceModeOverride2(module=node18).symbols | 17 + ...eferenceModeOverride2(module=node18).types | 23 + ...nceModeOverride3(module=node18).errors.txt | 34 + ...shReferenceModeOverride3(module=node18).js | 37 + ...erenceModeOverride3(module=node18).symbols | 17 + ...eferenceModeOverride3(module=node18).types | 23 + ...nceModeOverride4(module=node18).errors.txt | 29 + ...shReferenceModeOverride4(module=node18).js | 33 + ...erenceModeOverride4(module=node18).symbols | 17 + ...eferenceModeOverride4(module=node18).types | 23 + ...shReferenceModeOverride5(module=node18).js | 39 + ...erenceModeOverride5(module=node18).symbols | 30 + ...eferenceModeOverride5(module=node18).types | 36 + ...verrideModeError(module=node18).errors.txt | 32 + ...nceModeOverrideModeError(module=node18).js | 33 + ...deOverrideModeError(module=node18).symbols | 17 + ...ModeOverrideModeError(module=node18).types | 23 + ...pesVersionPackageExports(module=node18).js | 108 ++ ...rsionPackageExports(module=node18).symbols | 59 + ...VersionPackageExports(module=node18).types | 89 + ...ePackageSelfName(module=node18).errors.txt | 24 + .../nodePackageSelfName(module=node18).js | 77 + ...nodePackageSelfName(module=node18).symbols | 26 + .../nodePackageSelfName(module=node18).types | 32 + ...geSelfNameScoped(module=node18).errors.txt | 24 + ...odePackageSelfNameScoped(module=node18).js | 77 + ...ckageSelfNameScoped(module=node18).symbols | 26 + ...PackageSelfNameScoped(module=node18).types | 32 + .../parser.forAwait.es2018.errors.txt | 8 +- ....1(module=es2022,target=es2015).errors.txt | 12 +- ....1(module=esnext,target=es2015).errors.txt | 12 +- ....1(module=system,target=es2015).errors.txt | 12 +- ...ons module-kind is out-of-range.errors.txt | 4 +- ...ler-options module-kind is out-of-range.js | 2 + ...nd is out-of-range.oldTranspile.errors.txt | 4 +- ...odule-kind is out-of-range.oldTranspile.js | 2 + ...s target-script is out-of-range.errors.txt | 4 +- ...r-options target-script is out-of-range.js | 2 + ...pt is out-of-range.oldTranspile.errors.txt | 4 +- ...get-script is out-of-range.oldTranspile.js | 2 + ...thMissingExports(module=node18).errors.txt | 17 + ...erenceWithMissingExports(module=node18).js | 20 + ...eWithMissingExports(module=node18).symbols | 15 + ...nceWithMissingExports(module=node18).types | 20 + ...does-not-add-color-when-NO_COLOR-is-set.js | 2 +- .../reference/tsc/commandLine/help-all.js | 2 +- .../reference/tsc/commandLine/help.js | 2 +- ...-when-host-can't-provide-terminal-width.js | 2 +- ...tatus.DiagnosticsPresent_OutputsSkipped.js | 2 +- .../compiler/moduleNodeDefaultImports.ts | 2 +- .../compiler/moduleResolutionWithModule.ts | 2 +- ...leSlashTypesReferenceWithMissingExports.ts | 2 +- .../allowJs/nodeAllowJsPackageSelfName.ts | 2 +- .../node/allowJs/nodeModulesAllowJs1.ts | 2 +- .../allowJs/nodeModulesAllowJsCjsFromJs.ts | 2 +- ...ModulesAllowJsConditionalPackageExports.ts | 2 +- .../nodeModulesAllowJsDynamicImport.ts | 2 +- .../nodeModulesAllowJsExportAssignment.ts | 2 +- ...sAllowJsExportlessJsModuleDetectionAuto.ts | 2 +- ...deModulesAllowJsGeneratedNameCollisions.ts | 2 +- .../nodeModulesAllowJsImportAssignment.ts | 2 +- ...eModulesAllowJsImportHelpersCollisions1.ts | 2 +- ...eModulesAllowJsImportHelpersCollisions2.ts | 2 +- ...eModulesAllowJsImportHelpersCollisions3.ts | 2 +- .../allowJs/nodeModulesAllowJsImportMeta.ts | 2 +- .../nodeModulesAllowJsPackageExports.ts | 2 +- .../nodeModulesAllowJsPackageImports.ts | 2 +- ...nodeModulesAllowJsPackagePatternExports.ts | 2 +- ...ulesAllowJsPackagePatternExportsExclude.ts | 2 +- ...lesAllowJsPackagePatternExportsTrailers.ts | 2 +- ...nodeModulesAllowJsSynchronousCallErrors.ts | 2 +- .../nodeModulesAllowJsTopLevelAwait.ts | 2 +- tests/cases/conformance/node/nodeModules1.ts | 2 +- ...odeModulesCjsFormatFileAlwaysHasDefault.ts | 2 +- .../nodeModulesConditionalPackageExports.ts | 2 +- ...odulesDeclarationEmitWithPackageExports.ts | 2 +- .../node/nodeModulesDynamicImport.ts | 2 +- .../node/nodeModulesExportAssignments.ts | 2 +- ...ModulesExportsBlocksSpecifierResolution.ts | 2 +- .../nodeModulesExportsBlocksTypesVersions.ts | 2 +- .../node/nodeModulesExportsSourceTs.ts | 2 +- ...lesExportsSpecifierGenerationConditions.ts | 2 +- ...ulesExportsSpecifierGenerationDirectory.ts | 2 +- ...odulesExportsSpecifierGenerationPattern.ts | 2 +- .../node/nodeModulesForbidenSyntax.ts | 2 +- .../nodeModulesGeneratedNameCollisions.ts | 2 +- .../node/nodeModulesImportAssertions.ts | 2 +- .../node/nodeModulesImportAssignments.ts | 2 +- .../node/nodeModulesImportAttributes.ts | 2 +- ...lesImportAttributesModeDeclarationEmit1.ts | 2 +- ...lesImportAttributesModeDeclarationEmit2.ts | 2 +- ...portAttributesModeDeclarationEmitErrors.ts | 2 +- ...ImportAttributesTypeModeDeclarationEmit.ts | 2 +- ...AttributesTypeModeDeclarationEmitErrors.ts | 2 +- .../nodeModulesImportHelpersCollisions.ts | 2 +- .../nodeModulesImportHelpersCollisions2.ts | 2 +- .../nodeModulesImportHelpersCollisions3.ts | 2 +- .../conformance/node/nodeModulesImportMeta.ts | 2 +- .../nodeModulesImportModeDeclarationEmit1.ts | 2 +- .../nodeModulesImportModeDeclarationEmit2.ts | 2 +- ...ModulesImportModeDeclarationEmitErrors1.ts | 2 +- .../nodeModulesImportResolutionIntoExport.ts | 2 +- .../nodeModulesImportResolutionNoCycle.ts | 2 +- ...deModulesImportTypeModeDeclarationEmit1.ts | 2 +- ...lesImportTypeModeDeclarationEmitErrors1.ts | 2 +- .../cases/conformance/node/nodeModulesJson.ts | 2 +- .../node/nodeModulesPackageExports.ts | 2 +- .../node/nodeModulesPackageImports.ts | 2 +- .../node/nodeModulesPackagePatternExports.ts | 2 +- ...nodeModulesPackagePatternExportsExclude.ts | 2 +- ...odeModulesPackagePatternExportsTrailers.ts | 2 +- .../node/nodeModulesResolveJsonModule.ts | 2 +- .../node/nodeModulesSynchronousCallErrors.ts | 2 +- .../node/nodeModulesTopLevelAwait.ts | 2 +- ...ripleSlashReferenceModeDeclarationEmit1.ts | 2 +- ...ripleSlashReferenceModeDeclarationEmit2.ts | 2 +- ...ripleSlashReferenceModeDeclarationEmit3.ts | 2 +- ...ripleSlashReferenceModeDeclarationEmit4.ts | 2 +- ...ripleSlashReferenceModeDeclarationEmit5.ts | 2 +- ...ripleSlashReferenceModeDeclarationEmit6.ts | 2 +- ...ripleSlashReferenceModeDeclarationEmit7.ts | 2 +- ...odulesTripleSlashReferenceModeOverride1.ts | 2 +- ...odulesTripleSlashReferenceModeOverride2.ts | 2 +- ...odulesTripleSlashReferenceModeOverride3.ts | 2 +- ...odulesTripleSlashReferenceModeOverride4.ts | 2 +- ...odulesTripleSlashReferenceModeOverride5.ts | 2 +- ...ipleSlashReferenceModeOverrideModeError.ts | 2 +- .../nodeModulesTypesVersionPackageExports.ts | 2 +- .../conformance/node/nodePackageSelfName.ts | 2 +- .../node/nodePackageSelfNameScoped.ts | 2 +- 463 files changed, 31423 insertions(+), 529 deletions(-) create mode 100644 tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node18).errors.txt create mode 100644 tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node18).js create mode 100644 tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node18).symbols create mode 100644 tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node18).types create mode 100644 tests/baselines/reference/emitHelpersWithLocalCollisions(module=node18).errors.txt create mode 100644 tests/baselines/reference/emitHelpersWithLocalCollisions(module=node18).js create mode 100644 tests/baselines/reference/moduleNodeDefaultImports(module=node18).errors.txt create mode 100644 tests/baselines/reference/moduleNodeDefaultImports(module=node18).js create mode 100644 tests/baselines/reference/moduleNodeDefaultImports(module=node18).symbols create mode 100644 tests/baselines/reference/moduleNodeDefaultImports(module=node18).types create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node18,moduleresolution=node16).js create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node18,moduleresolution=node16).symbols create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node18,moduleresolution=node16).types create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node18,moduleresolution=nodenext).js create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node18,moduleresolution=nodenext).symbols create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node18,moduleresolution=nodenext).types create mode 100644 tests/baselines/reference/nodeAllowJsPackageSelfName(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeAllowJsPackageSelfName(module=node18).js create mode 100644 tests/baselines/reference/nodeAllowJsPackageSelfName(module=node18).symbols create mode 100644 tests/baselines/reference/nodeAllowJsPackageSelfName(module=node18).types create mode 100644 tests/baselines/reference/nodeModules1(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModules1(module=node18).js create mode 100644 tests/baselines/reference/nodeModules1(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModules1(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJs1(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJs1(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJs1(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJs1(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesConditionalPackageExports(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesConditionalPackageExports(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesConditionalPackageExports(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesConditionalPackageExports(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesDynamicImport(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesDynamicImport(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesDynamicImport(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesExportAssignments(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesExportAssignments(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesExportAssignments(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesExportAssignments(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node18).trace.json create mode 100644 tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesExportsSourceTs(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesExportsSourceTs(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesExportsSourceTs(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesExportsSourceTs(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesForbidenSyntax(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesForbidenSyntax(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesForbidenSyntax(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesForbidenSyntax(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportAssertions(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportAssertions(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportAssertions(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportAssertions(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportAssignments(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportAssignments(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportAssignments(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportAttributes(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportAttributes(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportAttributes(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportAttributes(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportMeta(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportMeta(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportMeta(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportMeta(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesJson(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesJson(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesJson(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesPackageExports(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesPackageExports(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesPackageExports(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesPackageExports(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesPackageImports(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesPackageImports(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesPackageImports(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesPackageImports(module=node18).trace.json create mode 100644 tests/baselines/reference/nodeModulesPackageImports(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExports(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExports(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExports(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExports(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node18).trace.json create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesResolveJsonModule(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesResolveJsonModule(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesResolveJsonModule(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesTopLevelAwait(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesTopLevelAwait(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesTopLevelAwait(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesTopLevelAwait(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node18).types create mode 100644 tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node18).js create mode 100644 tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node18).symbols create mode 100644 tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node18).types create mode 100644 tests/baselines/reference/nodePackageSelfName(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodePackageSelfName(module=node18).js create mode 100644 tests/baselines/reference/nodePackageSelfName(module=node18).symbols create mode 100644 tests/baselines/reference/nodePackageSelfName(module=node18).types create mode 100644 tests/baselines/reference/nodePackageSelfNameScoped(module=node18).errors.txt create mode 100644 tests/baselines/reference/nodePackageSelfNameScoped(module=node18).js create mode 100644 tests/baselines/reference/nodePackageSelfNameScoped(module=node18).symbols create mode 100644 tests/baselines/reference/nodePackageSelfNameScoped(module=node18).types create mode 100644 tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node18).errors.txt create mode 100644 tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node18).js create mode 100644 tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node18).symbols create mode 100644 tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node18).types diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 565420738d8ce..04facba3196e7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -882,6 +882,7 @@ import { ModuleKind, ModuleResolutionKind, ModuleSpecifierResolutionHost, + moduleSupportsImportAttributes, Mutable, MutableNodeArray, NamedDeclaration, @@ -37631,13 +37632,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } function checkImportMetaProperty(node: MetaProperty) { - if (moduleKind === ModuleKind.Node16 || moduleKind === ModuleKind.NodeNext) { + if (ModuleKind.Node16 <= moduleKind && moduleKind <= ModuleKind.NodeNext) { if (getSourceFileOfNode(node).impliedNodeFormat !== ModuleKind.ESNext) { error(node, Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output); } } 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_or_nodenext); + error(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext); } const file = getSourceFileOfNode(node); Debug.assert(!!(file.flags & NodeFlags.PossiblyContainsImportMeta), "Containing file is missing import meta node flag."); @@ -39212,6 +39213,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } switch (moduleKind) { case ModuleKind.Node16: + case ModuleKind.Node18: case ModuleKind.NodeNext: if (sourceFile.impliedNodeFormat === ModuleKind.CommonJS) { span ??= getSpanOfTokenAtPosition(sourceFile, node.pos); @@ -39232,8 +39234,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_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_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_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; diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, message)); hasError = true; break; @@ -48064,16 +48066,22 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return; // Other grammar checks do not apply to type-only imports with resolution mode assertions } - const mode = (moduleKind === ModuleKind.NodeNext) && declaration.moduleSpecifier && getEmitSyntaxForModuleSpecifierExpression(declaration.moduleSpecifier); - if (mode !== ModuleKind.ESNext && moduleKind !== ModuleKind.ESNext && moduleKind !== ModuleKind.Preserve) { - const message = isImportAttributes - ? moduleKind === ModuleKind.NodeNext + if (!moduleSupportsImportAttributes(moduleKind)) { + 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, + ); + } + + if (declaration.moduleSpecifier && getEmitSyntaxForModuleSpecifierExpression(declaration.moduleSpecifier) === ModuleKind.CommonJS) { + return grammarErrorOnNode( + node, + isImportAttributes ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls - : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve - : moduleKind === ModuleKind.NodeNext - ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls - : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve; - return grammarErrorOnNode(node, message); + : Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls, + ); } const isTypeOnly = isJSDocImportTag(declaration) || (isImportDeclaration(declaration) ? declaration.importClause?.isTypeOnly : declaration.isTypeOnly); @@ -48122,7 +48130,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } } - if (!importClause.isTypeOnly && moduleKind === ModuleKind.NodeNext && isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) { + if (!importClause.isTypeOnly && ModuleKind.Node18 <= moduleKind && moduleKind <= ModuleKind.NodeNext && isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) { // Import attributes/assertions are not allowed in --module node16, so don't suggest adding one error(node.moduleSpecifier, Diagnostics.Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0, ModuleKind[moduleKind]); } @@ -52062,6 +52070,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } switch (moduleKind) { case ModuleKind.Node16: + case ModuleKind.Node18: case ModuleKind.NodeNext: if (sourceFile.impliedNodeFormat === ModuleKind.CommonJS) { diagnostics.add( @@ -52080,7 +52089,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_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_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher), ); break; } @@ -52882,7 +52891,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } 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_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_or_nodenext); } if (node.typeArguments) { @@ -52890,13 +52899,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } const nodeArguments = node.arguments; - if (moduleKind !== ModuleKind.ESNext && moduleKind !== ModuleKind.NodeNext && moduleKind !== ModuleKind.Node16 && moduleKind !== ModuleKind.Preserve) { + if (!(ModuleKind.Node16 <= moduleKind && moduleKind <= ModuleKind.NodeNext) && moduleKind !== ModuleKind.ESNext && moduleKind !== ModuleKind.Preserve) { // We are allowed trailing comma after proposal-import-assertions. checkGrammarForDisallowedTrailingComma(nodeArguments); 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_nodenext_or_preserve); + return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_nodenext_or_preserve); } } diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index cbd8bfcbcebe6..ff95389e60974 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -600,6 +600,7 @@ export const moduleOptionDeclaration: CommandLineOptionOfCustomType = { es2022: ModuleKind.ES2022, esnext: ModuleKind.ESNext, node16: ModuleKind.Node16, + node18: ModuleKind.Node18, nodenext: ModuleKind.NodeNext, preserve: ModuleKind.Preserve, })), diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 0b2951d8dee2d..d757b34d5c384 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1028,11 +1028,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', or 'nodenext'.": { + "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'.": { "category": "Error", "code": 1323 }, - "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'nodenext', or 'preserve'.": { + "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'.": { "category": "Error", "code": 1324 }, @@ -1100,7 +1100,7 @@ "category": "Error", "code": 1341 }, - "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.": { + "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'.": { "category": "Error", "code": 1343 }, @@ -1220,7 +1220,7 @@ "category": "Message", "code": 1377 }, - "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', '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', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher.": { "category": "Error", "code": 1378 }, @@ -1424,7 +1424,7 @@ "category": "Error", "code": 1431 }, - "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', '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', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher.": { "category": "Error", "code": 1432 }, @@ -3788,7 +3788,7 @@ "category": "Error", "code": 2820 }, - "Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'.": { + "Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'.": { "category": "Error", "code": 2821 }, @@ -3796,7 +3796,7 @@ "category": "Error", "code": 2822 }, - "Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'.": { + "Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'.": { "category": "Error", "code": 2823 }, @@ -3876,7 +3876,7 @@ "category": "Error", "code": 2853 }, - "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', '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', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher.": { "category": "Error", "code": 2854 }, diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 45d8539f581e3..fbb0145507ce0 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -4539,7 +4539,8 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg !(ModuleResolutionKind.Node16 <= moduleResolution && moduleResolution <= ModuleResolutionKind.NodeNext) ) { const moduleKindName = ModuleKind[moduleKind]; - createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1, moduleKindName, moduleKindName); + const moduleResolutionName = ModuleResolutionKind[moduleKindName as any] ? moduleKindName : "Node16"; + createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1, moduleResolutionName, moduleKindName); } else if ( ModuleResolutionKind[moduleResolution] && diff --git a/src/compiler/transformer.ts b/src/compiler/transformer.ts index 0d499f3a08298..8c19f33600649 100644 --- a/src/compiler/transformer.ts +++ b/src/compiler/transformer.ts @@ -86,6 +86,7 @@ function getModuleTransformer(moduleKind: ModuleKind): TransformerFactory { - return compilerOptions.moduleDetection || - (_computedOptions.module.computeValue(compilerOptions) === ModuleKind.Node16 || - _computedOptions.module.computeValue(compilerOptions) === ModuleKind.NodeNext ? ModuleDetectionKind.Force : ModuleDetectionKind.Auto); + if (compilerOptions.moduleDetection !== undefined) { + return compilerOptions.moduleDetection; + } + const moduleKind = _computedOptions.module.computeValue(compilerOptions); + return ModuleKind.Node16 <= moduleKind && moduleKind <= ModuleKind.NodeNext + ? ModuleDetectionKind.Force + : ModuleDetectionKind.Auto; }, }, isolatedModules: { @@ -9000,6 +9006,7 @@ const _computedOptions = createComputedCompilerOptions({ } switch (_computedOptions.module.computeValue(compilerOptions)) { case ModuleKind.Node16: + case ModuleKind.Node18: case ModuleKind.NodeNext: case ModuleKind.Preserve: return true; @@ -9229,6 +9236,16 @@ export function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResol || moduleResolution === ModuleResolutionKind.Bundler; } +/** + * @internal + * The same set of options also support import assertions. + */ +export function moduleSupportsImportAttributes(moduleKind: ModuleKind): boolean { + return ModuleKind.Node18 <= moduleKind && moduleKind <= ModuleKind.NodeNext + || moduleKind === ModuleKind.Preserve + || moduleKind === ModuleKind.ESNext; +} + /** @internal */ export type StrictOptionName = | "noImplicitAny" diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 232b224786e43..4683a1f300662 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -3254,6 +3254,7 @@ export const enum ModuleKind { ES2022 = "es2022", ESNext = "esnext", Node16 = "node16", + Node18 = "node18", NodeNext = "nodenext", Preserve = "preserve", } diff --git a/src/services/codefixes/fixModuleAndTargetOptions.ts b/src/services/codefixes/fixModuleAndTargetOptions.ts index 8f24304624a05..130797d5dafcb 100644 --- a/src/services/codefixes/fixModuleAndTargetOptions.ts +++ b/src/services/codefixes/fixModuleAndTargetOptions.ts @@ -19,9 +19,9 @@ import { registerCodeFix({ errorCodes: [ - Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code, - Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code, - Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code, + 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.code, + 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.code, + 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.code, ], getCodeActions: function getCodeActionsToFixModuleAndTarget(context) { const compilerOptions = context.program.getCompilerOptions(); diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index a1537c8bde5b7..e2b83f0c5fe8b 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -1558,6 +1558,7 @@ function getUmdImportKind(importingFile: SourceFile | FutureSourceFile, program: // Fall back to the `import * as ns` style import. return ImportKind.Namespace; case ModuleKind.Node16: + case ModuleKind.Node18: case ModuleKind.NodeNext: return getImpliedNodeFormatForEmit(importingFile, program) === ModuleKind.ESNext ? ImportKind.Namespace : ImportKind.CommonJS; default: diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 11a12e97d4b2e..4b4404634fdaa 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2516,6 +2516,7 @@ declare namespace ts { ES2022 = "es2022", ESNext = "esnext", Node16 = "node16", + Node18 = "node18", NodeNext = "nodenext", Preserve = "preserve", } @@ -7131,6 +7132,7 @@ declare namespace ts { ES2022 = 7, ESNext = 99, Node16 = 100, + Node18 = 101, NodeNext = 199, Preserve = 200, } diff --git a/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node18).errors.txt b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node18).errors.txt new file mode 100644 index 0000000000000..cc359bceb4904 --- /dev/null +++ b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node18).errors.txt @@ -0,0 +1,42 @@ +arbitraryModuleNamespaceIdentifiers_module.ts(20,7): error TS2322: Type '"expect error about someType"' is not assignable to type '"someType"'. +arbitraryModuleNamespaceIdentifiers_module.ts(24,7): error TS2322: Type '"expect error about someType"' is not assignable to type '"someType"'. +arbitraryModuleNamespaceIdentifiers_module.ts(29,7): error TS2322: Type '"expect error about otherType"' is not assignable to type '"otherType"'. + + +==== arbitraryModuleNamespaceIdentifiers_module.ts (3 errors) ==== + 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"; + ~~~~~~~~~~ +!!! 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=node18).js b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node18).js new file mode 100644 index 0000000000000..311a983aea48a --- /dev/null +++ b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node18).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=node18).symbols b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node18).symbols new file mode 100644 index 0000000000000..a792b7d3f5280 --- /dev/null +++ b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node18).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=node18).types b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node18).types new file mode 100644 index 0000000000000..4574f9754d0b4 --- /dev/null +++ b/tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_module(module=node18).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 03d2b46a32010..4251652ef5f45 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', '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', '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', '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 (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', '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', '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', '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', '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 0ff7a8868b0a8..a6f82cf69ebdf 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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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 (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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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 0ff7a8868b0a8..a6f82cf69ebdf 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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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 (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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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', '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 b04ba9319bdd8..4eccfeffa6114 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', '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', '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', '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', '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 b04ba9319bdd8..4eccfeffa6114 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', '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', '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', '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', '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 812d27fbe1adb..905017a52154a 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', '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', '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', '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', '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 812d27fbe1adb..905017a52154a 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', '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', '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', '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', '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 72a09855d0899..8a3ba085e5d13 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', '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', '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', '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', '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/config/commandLineParsing/parseCommandLine/Parse empty options of --module.js b/tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse empty options of --module.js index 1b39c0ab91dd9..a17a607373765 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', 'nodenext', 'preserve'. +error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', '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 13680f74379e6..1bb683ffbb17b 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', 'nodenext', 'preserve'. +error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', '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 e687f319a7b13..bcf6c6562370a 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', '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', 'nodenext', 'preserve'. 3 "module": "",    ~~ diff --git a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node18).errors.txt b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node18).errors.txt new file mode 100644 index 0000000000000..7dfd532d52b18 --- /dev/null +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node18).errors.txt @@ -0,0 +1,12 @@ +error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node18'. + + +!!! error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node18'. +==== 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=node18).js b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node18).js new file mode 100644 index 0000000000000..47204b7a76f30 --- /dev/null +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node18).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/importAssertion1(module=commonjs).errors.txt b/tests/baselines/reference/importAssertion1(module=commonjs).errors.txt index 60c1ebb002d2b..f68327654fdf1 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', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -1.ts(3,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', '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', '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', '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', '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', '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', 'nodenext', or 'preserve'. +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'. 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', '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', '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', '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(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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', '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 90dc6fb333c80..12ad1bcdf3f19 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', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -1.ts(3,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', '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', 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', 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', 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', 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', 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', 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', 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', 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', or 'nodenext'. +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'. ==== 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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 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'. 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', 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'. 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', 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'. 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', 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'. 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', 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'. 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', 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'. 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', 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'. 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', 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'. 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', 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'. \ 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 beba23ce610d7..a83609d1f2b89 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', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -1.ts(3,21): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -1.ts(4,27): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +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'. ==== 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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. export * from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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 beba23ce610d7..a83609d1f2b89 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', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -1.ts(3,21): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -1.ts(4,27): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +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'. ==== 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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. export * from './0' assert { type: "json" } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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 dfd16488102fc..5b353cb0b4be4 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', 'nodenext', or 'preserve'. -1.ts(2,30): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(1,31): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(2,33): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +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'. ==== 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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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 8a9be458977f4..78849639e48e7 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', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -1.ts(3,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', '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', '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', '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', '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', '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', 'nodenext', or 'preserve'. +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'. 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', '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', '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', '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(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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', '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 960f52554339b..31ef819879c67 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', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -1.ts(3,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', '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', 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', 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', 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', 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', 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', 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', 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', 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', or 'nodenext'. +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'. ==== 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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 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'. 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', 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'. 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', 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'. 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', 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'. 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', 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'. 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', 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'. 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', 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'. 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', 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'. 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', 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'. \ 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 144a6f2779301..fea6b67dc1ec4 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', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -1.ts(3,21): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -1.ts(4,27): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +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'. ==== 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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. export * from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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 144a6f2779301..fea6b67dc1ec4 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', 'nodenext', or 'preserve'. -1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -1.ts(3,21): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -1.ts(4,27): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +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'. ==== 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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. export * from './0' with { type: "json" } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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 23d166416e0d0..8e0a253a65778 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', 'nodenext', or 'preserve'. -1.ts(2,30): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(1,31): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -2.ts(2,33): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +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'. ==== 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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionErrorInES2015.errors.txt b/tests/baselines/reference/importCallExpressionErrorInES2015.errors.txt index e0d7de71867c0..fd15d2d1dbd06 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', 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', 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', 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', 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'. ==== 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', 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'. 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', 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'. 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', 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'. } \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionGrammarError.errors.txt b/tests/baselines/reference/importCallExpressionGrammarError.errors.txt index d8424c5423e0f..c055c26a5f610 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', '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', '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', 'nodenext', or 'preserve'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', '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 458e709578df5..8e2c1556da376 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', 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', 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', 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'. ==== 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', 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', 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'. } \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionNestedES20152.errors.txt b/tests/baselines/reference/importCallExpressionNestedES20152.errors.txt index 458e709578df5..8e2c1556da376 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', 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', 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', 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'. ==== 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', 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', 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'. } \ 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 4be6e8a4823e8..360e04abf29ab 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', 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', 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', 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', 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', 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', 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', 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(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', 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', 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', 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', 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', 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(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', 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', 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', 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(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', 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', 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', 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', 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', 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(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', 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', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', 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', 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 4be6e8a4823e8..360e04abf29ab 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', 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', 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', 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', 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', 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', 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', 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(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', 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', 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', 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', 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', 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(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', 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', 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', 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(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', 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', 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', 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', 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', 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(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', 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', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', 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', 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', 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 20360234a4bfb..9969d70670899 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', 'nodenext', or 'preserve'. +/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,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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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 e3dba21b47669..45e47c28ad649 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', 'nodenext', or 'preserve'. -1.js(2,33): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +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'. ==== 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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. /** @param {I} a */ function f(a) {} diff --git a/tests/baselines/reference/moduleNodeDefaultImports(module=node18).errors.txt b/tests/baselines/reference/moduleNodeDefaultImports(module=node18).errors.txt new file mode 100644 index 0000000000000..2fd1d68ba8d00 --- /dev/null +++ b/tests/baselines/reference/moduleNodeDefaultImports(module=node18).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=node18).js b/tests/baselines/reference/moduleNodeDefaultImports(module=node18).js new file mode 100644 index 0000000000000..1d6e31ec0afb2 --- /dev/null +++ b/tests/baselines/reference/moduleNodeDefaultImports(module=node18).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=node18).symbols b/tests/baselines/reference/moduleNodeDefaultImports(module=node18).symbols new file mode 100644 index 0000000000000..8c292112c561f --- /dev/null +++ b/tests/baselines/reference/moduleNodeDefaultImports(module=node18).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=node18).types b/tests/baselines/reference/moduleNodeDefaultImports(module=node18).types new file mode 100644 index 0000000000000..84b8ccc87d275 --- /dev/null +++ b/tests/baselines/reference/moduleNodeDefaultImports(module=node18).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 2e1dbfa53b9c9..8aa6718972b94 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', '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', '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', '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 (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', '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', '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', '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', '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=node18,moduleresolution=node16).js b/tests/baselines/reference/moduleResolutionWithModule(module=node18,moduleresolution=node16).js new file mode 100644 index 0000000000000..2d0c7b4607ea5 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node18,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=node18,moduleresolution=node16).symbols b/tests/baselines/reference/moduleResolutionWithModule(module=node18,moduleresolution=node16).symbols new file mode 100644 index 0000000000000..7233a43c05fff --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node18,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=node18,moduleresolution=node16).types b/tests/baselines/reference/moduleResolutionWithModule(module=node18,moduleresolution=node16).types new file mode 100644 index 0000000000000..b65e67d7fe713 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node18,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=node18,moduleresolution=nodenext).js b/tests/baselines/reference/moduleResolutionWithModule(module=node18,moduleresolution=nodenext).js new file mode 100644 index 0000000000000..2d0c7b4607ea5 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node18,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=node18,moduleresolution=nodenext).symbols b/tests/baselines/reference/moduleResolutionWithModule(module=node18,moduleresolution=nodenext).symbols new file mode 100644 index 0000000000000..7233a43c05fff --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node18,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=node18,moduleresolution=nodenext).types b/tests/baselines/reference/moduleResolutionWithModule(module=node18,moduleresolution=nodenext).types new file mode 100644 index 0000000000000..b65e67d7fe713 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node18,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/nodeAllowJsPackageSelfName(module=node18).errors.txt b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node18).errors.txt new file mode 100644 index 0000000000000..fe6d0aa7e42be --- /dev/null +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node18).errors.txt @@ -0,0 +1,26 @@ +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.cjs(2,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package")' call instead. + + +!!! 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 (1 errors) ==== + // esm format file + import * as self from "package"; + ~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package")' call instead. + 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=node18).js b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node18).js new file mode 100644 index 0000000000000..1498e98d79602 --- /dev/null +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node18).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=node18).symbols b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node18).symbols new file mode 100644 index 0000000000000..5d67f58f34b98 --- /dev/null +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node18).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=node18).types b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node18).types new file mode 100644 index 0000000000000..f8e06c7c53e1c --- /dev/null +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModules1(module=node18).errors.txt new file mode 100644 index 0000000000000..acd3f749846d5 --- /dev/null +++ b/tests/baselines/reference/nodeModules1(module=node18).errors.txt @@ -0,0 +1,564 @@ +index.cts(2,21): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./index.js")' call instead. +index.cts(3,21): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./index.mjs")' call instead. +index.cts(6,21): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder/index.mjs")' call instead. +index.cts(9,21): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/index.mjs")' call instead. +index.cts(11,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/index.js")' call instead. +index.cts(12,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/index.mjs")' call instead. +index.cts(15,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./")' call instead. +index.cts(16,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./index")' call instead. +index.cts(23,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another")' call instead. +index.cts(24,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/")' call instead. +index.cts(25,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/index")' call instead. +index.cts(51,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.cts(52,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.cts(59,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.cts(60,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.cts(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +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(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.mts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.mts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.mts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.mts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +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(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.ts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.ts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.ts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.ts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +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 (27 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 TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m25 = require("./index"); + ~~~~~~~~~ +!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m33 = require("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m34 = require("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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 (27 errors) ==== + // ESM-format imports below should issue errors + import * as m1 from "./index.js"; + ~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./index.js")' call instead. + import * as m2 from "./index.mjs"; + ~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./index.mjs")' call instead. + import * as m3 from "./index.cjs"; + import * as m4 from "./subfolder/index.js"; + import * as m5 from "./subfolder/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder/index.mjs")' call instead. + import * as m6 from "./subfolder/index.cjs"; + import * as m7 from "./subfolder2/index.js"; + import * as m8 from "./subfolder2/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/index.mjs")' call instead. + import * as m9 from "./subfolder2/index.cjs"; + import * as m10 from "./subfolder2/another/index.js"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/index.js")' call instead. + import * as m11 from "./subfolder2/another/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/index.mjs")' call instead. + 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 "./"; + ~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./")' call instead. + import * as m14 from "./index"; + ~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./index")' call instead. + 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"; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another")' call instead. + import * as m22 from "./subfolder2/another/"; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/")' call instead. + import * as m23 from "./subfolder2/another/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/index")' call instead. + 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 TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m25 = require("./index"); + ~~~~~~~~~ +!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m33 = require("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m34 = require("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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 (27 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 TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m25 = require("./index"); + ~~~~~~~~~ +!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m33 = require("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m34 = require("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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=node18).js b/tests/baselines/reference/nodeModules1(module=node18).js new file mode 100644 index 0000000000000..bfebc4d12e830 --- /dev/null +++ b/tests/baselines/reference/nodeModules1(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModules1(module=node18).symbols new file mode 100644 index 0000000000000..cf80f6db97d80 --- /dev/null +++ b/tests/baselines/reference/nodeModules1(module=node18).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=node18).types b/tests/baselines/reference/nodeModules1(module=node18).types new file mode 100644 index 0000000000000..49631af15a8e8 --- /dev/null +++ b/tests/baselines/reference/nodeModules1(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJs1(module=node18).errors.txt new file mode 100644 index 0000000000000..13ade2052e398 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node18).errors.txt @@ -0,0 +1,663 @@ +index.cjs(2,21): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./index.js")' call instead. +index.cjs(3,21): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./index.mjs")' call instead. +index.cjs(6,21): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder/index.mjs")' call instead. +index.cjs(9,21): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/index.mjs")' call instead. +index.cjs(11,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/index.js")' call instead. +index.cjs(12,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/index.mjs")' call instead. +index.cjs(15,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./")' call instead. +index.cjs(16,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./index")' call instead. +index.cjs(23,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another")' call instead. +index.cjs(24,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/")' call instead. +index.cjs(25,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/index")' call instead. +index.cjs(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.cjs(51,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.cjs(52,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.cjs(52,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +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(59,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.cjs(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.cjs(60,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.cjs(61,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.cjs(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +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(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.js(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +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(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.js(59,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.js(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +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(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.mjs(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.mjs(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +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(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.mjs(59,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.mjs(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.mjs(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.mjs(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +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 (38 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. + ~~~~ +!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m25 = require("./index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~ +!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m33 = require("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m34 = require("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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 (38 errors) ==== + // ESM-format imports below should issue errors + import * as m1 from "./index.js"; + ~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./index.js")' call instead. + import * as m2 from "./index.mjs"; + ~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./index.mjs")' call instead. + import * as m3 from "./index.cjs"; + import * as m4 from "./subfolder/index.js"; + import * as m5 from "./subfolder/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder/index.mjs")' call instead. + import * as m6 from "./subfolder/index.cjs"; + import * as m7 from "./subfolder2/index.js"; + import * as m8 from "./subfolder2/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/index.mjs")' call instead. + import * as m9 from "./subfolder2/index.cjs"; + import * as m10 from "./subfolder2/another/index.js"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/index.js")' call instead. + import * as m11 from "./subfolder2/another/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/index.mjs")' call instead. + 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 "./"; + ~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./")' call instead. + import * as m14 from "./index"; + ~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./index")' call instead. + 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"; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another")' call instead. + import * as m22 from "./subfolder2/another/"; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/")' call instead. + import * as m23 from "./subfolder2/another/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./subfolder2/another/index")' call instead. + 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. + ~~~~ +!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m25 = require("./index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~ +!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m33 = require("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m34 = require("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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 (38 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. + ~~~~ +!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m25 = require("./index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~ +!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m33 = require("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + import m34 = require("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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=node18).js b/tests/baselines/reference/nodeModulesAllowJs1(module=node18).js new file mode 100644 index 0000000000000..4a63449d26383 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJs1(module=node18).symbols new file mode 100644 index 0000000000000..1d24c14a43ea7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJs1(module=node18).types new file mode 100644 index 0000000000000..672e1a9c81b16 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node18).symbols new file mode 100644 index 0000000000000..b855f772f99f4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node18).types new file mode 100644 index 0000000000000..ec9c59e5c8a9b --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node18).errors.txt new file mode 100644 index 0000000000000..af5e14950e1c9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node18).errors.txt @@ -0,0 +1,137 @@ +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.cjs(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package/mjs")' call instead. +index.cjs(4,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package")' call instead. +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 (2 errors) ==== + // cjs format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + ~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package/mjs")' call instead. + import * as type from "package"; + ~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package")' call instead. + 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=node18).js b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node18).js new file mode 100644 index 0000000000000..89094051db9df --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node18).symbols new file mode 100644 index 0000000000000..6ac785d10279f --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node18).types new file mode 100644 index 0000000000000..bfa4914e21fe9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node18).js new file mode 100644 index 0000000000000..ac43e11733d77 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node18).symbols new file mode 100644 index 0000000000000..eabf1117f687d --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node18).types new file mode 100644 index 0000000000000..8689b18a720f7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node18).errors.txt new file mode 100644 index 0000000000000..15bd70e4c2e9d --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node18).js new file mode 100644 index 0000000000000..92ecb7eacddd7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node18).symbols new file mode 100644 index 0000000000000..0e6aa57c8289b --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node18).types new file mode 100644 index 0000000000000..b860b335a2df8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node18).js new file mode 100644 index 0000000000000..e3ca6368e77fb --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node18).symbols new file mode 100644 index 0000000000000..38a5ad1bc4e01 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node18).types new file mode 100644 index 0000000000000..38a5ad1bc4e01 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportlessJsModuleDetectionAuto(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node18).errors.txt new file mode 100644 index 0000000000000..e54f9b0f94ca4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node18).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 Node18. +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 Node18. + 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=node18).js b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node18).js new file mode 100644 index 0000000000000..30926a25ccde1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node18).symbols new file mode 100644 index 0000000000000..f68efe37918e7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node18).types new file mode 100644 index 0000000000000..fd07e237a77db --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node18).errors.txt new file mode 100644 index 0000000000000..476c47f703e37 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node18).js new file mode 100644 index 0000000000000..ee161c309e871 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node18).symbols new file mode 100644 index 0000000000000..6ceddec39de76 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node18).types new file mode 100644 index 0000000000000..daea59c9155d4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node18).errors.txt new file mode 100644 index 0000000000000..17c99081b2e70 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node18).js new file mode 100644 index 0000000000000..a30d220227f20 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node18).symbols new file mode 100644 index 0000000000000..223fb64bb63dd --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node18).types new file mode 100644 index 0000000000000..b9184a9515937 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node18).errors.txt new file mode 100644 index 0000000000000..78bd927d81fe8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node18).js new file mode 100644 index 0000000000000..1960ba0103e95 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node18).symbols new file mode 100644 index 0000000000000..f8442eecea2a9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node18).types new file mode 100644 index 0000000000000..f27b3f021b897 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node18).errors.txt new file mode 100644 index 0000000000000..f1e751aeb0f1f --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node18).js new file mode 100644 index 0000000000000..8fefc3d2d6b56 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node18).symbols new file mode 100644 index 0000000000000..ac8f12eb28526 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node18).types new file mode 100644 index 0000000000000..f610358647cd1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node18).errors.txt new file mode 100644 index 0000000000000..28110ed339d18 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node18).js new file mode 100644 index 0000000000000..7e6d01b7daf2a --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node18).symbols new file mode 100644 index 0000000000000..b5fd6d2a740db --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node18).types new file mode 100644 index 0000000000000..c4fb0b6d2595f --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node18).errors.txt new file mode 100644 index 0000000000000..f5736b5998181 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node18).errors.txt @@ -0,0 +1,109 @@ +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.cjs(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package/mjs")' call instead. +index.cjs(4,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package")' call instead. +index.cjs(9,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. +node_modules/inner/index.d.cts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +node_modules/inner/index.d.ts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. + + +!!! 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 (3 errors) ==== + // cjs format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + ~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package/mjs")' call instead. + import * as type from "package"; + ~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package")' call instead. + cjs; + mjs; + type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. + import * as typei from "inner"; + cjsi; + mjsi; + typei; +==== node_modules/inner/index.d.ts (2 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. + 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 (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. + 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=node18).js b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node18).js new file mode 100644 index 0000000000000..208b7a1a36fde --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node18).symbols new file mode 100644 index 0000000000000..9fe0e570a7061 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node18).types new file mode 100644 index 0000000000000..4a54afca62898 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node18).errors.txt new file mode 100644 index 0000000000000..e845dc72f0284 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node18).errors.txt @@ -0,0 +1,46 @@ +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.cjs(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("#mjs")' call instead. +index.cjs(4,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("#type")' call instead. + + +!!! 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 (2 errors) ==== + // esm format file + import * as cjs from "#cjs"; + import * as mjs from "#mjs"; + ~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("#mjs")' call instead. + import * as type from "#type"; + ~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("#type")' call instead. + 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=node18).js b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node18).js new file mode 100644 index 0000000000000..510e6b7128c79 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node18).symbols new file mode 100644 index 0000000000000..356904544fb5d --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node18).types new file mode 100644 index 0000000000000..4557791be394f --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node18).errors.txt new file mode 100644 index 0000000000000..37254a32db001 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node18).errors.txt @@ -0,0 +1,78 @@ +index.cjs(3,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. +node_modules/inner/index.d.cts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +node_modules/inner/index.d.ts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. + + +==== 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 (1 errors) ==== + // cjs format file + import * as cjsi from "inner/cjs/index"; + import * as mjsi from "inner/mjs/index"; + ~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. + import * as typei from "inner/js/index"; + cjsi; + mjsi; + typei; +==== node_modules/inner/index.d.ts (2 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"; + ~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. + 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 (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index"; + import * as mjs from "inner/mjs/index"; + ~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. + 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=node18).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node18).js new file mode 100644 index 0000000000000..79669dc7d4da8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node18).symbols new file mode 100644 index 0000000000000..d6dea7356d738 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node18).types new file mode 100644 index 0000000000000..ab36a515a18bd --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node18).errors.txt new file mode 100644 index 0000000000000..44e51033d1cc7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node18).js new file mode 100644 index 0000000000000..3ba5fbbce0406 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node18).symbols new file mode 100644 index 0000000000000..53db76dc4d204 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node18).types new file mode 100644 index 0000000000000..6e33ef99da8fd --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsExclude(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node18).errors.txt new file mode 100644 index 0000000000000..dbaadfd82f599 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node18).errors.txt @@ -0,0 +1,78 @@ +index.cjs(3,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index.mjs")' call instead. +node_modules/inner/index.d.cts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index.mjs")' call instead. +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +node_modules/inner/index.d.ts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index.mjs")' call instead. + + +==== 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 (1 errors) ==== + // cjs format file + import * as cjsi from "inner/cjs/index.cjs"; + import * as mjsi from "inner/mjs/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index.mjs")' call instead. + import * as typei from "inner/js/index.js"; + cjsi; + mjsi; + typei; +==== node_modules/inner/index.d.ts (2 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"; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index.mjs")' call instead. + 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 (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index.cjs"; + import * as mjs from "inner/mjs/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index.mjs")' call instead. + 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=node18).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node18).js new file mode 100644 index 0000000000000..b23d73a88c0e9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node18).symbols new file mode 100644 index 0000000000000..5dd3851cacbbc --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node18).types new file mode 100644 index 0000000000000..8aec22f2cab84 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node18).errors.txt new file mode 100644 index 0000000000000..a4ba6ab81a73f --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node18).errors.txt @@ -0,0 +1,57 @@ +index.js(3,1): error TS8002: 'import ... =' can only be used in TypeScript files. +index.js(3,22): error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +index.js(5,1): error TS8002: 'import ... =' can only be used in TypeScript files. +subfolder/index.js(2,17): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("../index.js")' call instead. + To convert this file to an ECMAScript module, change its file extension to '.mjs' or create a local package.json file with `{ "type": "module" }`. +subfolder/index.js(3,1): error TS8002: 'import ... =' can only be used in TypeScript files. +subfolder/index.js(3,22): error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +subfolder/index.js(5,1): error TS8002: 'import ... =' can only be used in TypeScript files. + + +==== subfolder/index.js (4 errors) ==== + // cjs format file + import {h} from "../index.js"; + ~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("../index.js")' call instead. +!!! error TS1479: To convert this file to an ECMAScript module, change its file extension to '.mjs' or create a local package.json file with `{ "type": "module" }`. + import mod = require("../index.js"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~ +!!! error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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 (3 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. + ~~~~~~~~~~~~ +!!! error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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=node18).js b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node18).js new file mode 100644 index 0000000000000..bb91ae6ef3a60 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node18).symbols new file mode 100644 index 0000000000000..4c498167184c4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node18).types new file mode 100644 index 0000000000000..e10d1bf1c8370 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node18).errors.txt new file mode 100644 index 0000000000000..78c93edaa0624 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node18).js new file mode 100644 index 0000000000000..354fe725f0960 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node18).symbols new file mode 100644 index 0000000000000..7eb982a9c7609 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node18).types new file mode 100644 index 0000000000000..f3dc5e0e62a34 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node18).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/nodeModulesCjsFormatFileAlwaysHasDefault(module=node18).js b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node18).js new file mode 100644 index 0000000000000..f0c9198a51305 --- /dev/null +++ b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node18).symbols new file mode 100644 index 0000000000000..44ba4c0a68a46 --- /dev/null +++ b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node18).types new file mode 100644 index 0000000000000..1ae92add000d0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node18).errors.txt new file mode 100644 index 0000000000000..41703e1cf0cc1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node18).errors.txt @@ -0,0 +1,137 @@ +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.cts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package/mjs")' call instead. +index.cts(4,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package")' call instead. +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 (2 errors) ==== + // cjs format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + ~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package/mjs")' call instead. + import * as type from "package"; + ~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package")' call instead. + 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=node18).js b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node18).js new file mode 100644 index 0000000000000..8bf4f316a59ff --- /dev/null +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node18).symbols new file mode 100644 index 0000000000000..07c60903e55eb --- /dev/null +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node18).types new file mode 100644 index 0000000000000..a7cb6f45bf8e8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node18).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/nodeModulesDeclarationEmitWithPackageExports(module=node18).errors.txt b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node18).errors.txt new file mode 100644 index 0000000000000..f2737ac29f32f --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node18).errors.txt @@ -0,0 +1,118 @@ +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.cts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package/mjs")' call instead. +index.cts(4,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package")' call instead. +index.cts(9,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. +node_modules/inner/index.d.cts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. +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(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. +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 (3 errors) ==== + // cjs format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + ~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package/mjs")' call instead. + import * as type from "package"; + ~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package")' call instead. + export const a = cjs; + export const b = mjs; + export const c = type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. + import * as typei from "inner"; + export const d = cjsi; + export const e = mjsi; + export const f = typei; +==== node_modules/inner/index.d.ts (2 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. + 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 (2 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. + 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=node18).js b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node18).js new file mode 100644 index 0000000000000..58d736d2641fe --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node18).symbols new file mode 100644 index 0000000000000..93d7af061919a --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node18).types new file mode 100644 index 0000000000000..9921b0e1f5183 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesDynamicImport(module=node18).js new file mode 100644 index 0000000000000..378a054d25109 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDynamicImport(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesDynamicImport(module=node18).symbols new file mode 100644 index 0000000000000..ba5c96124df46 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDynamicImport(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesDynamicImport(module=node18).types new file mode 100644 index 0000000000000..18249dadabb9c --- /dev/null +++ b/tests/baselines/reference/nodeModulesDynamicImport(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesExportAssignments(module=node18).errors.txt new file mode 100644 index 0000000000000..edb49c7a61f05 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportAssignments(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesExportAssignments(module=node18).js new file mode 100644 index 0000000000000..2d09438ae7cd8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportAssignments(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesExportAssignments(module=node18).symbols new file mode 100644 index 0000000000000..97363f05b7a86 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportAssignments(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesExportAssignments(module=node18).types new file mode 100644 index 0000000000000..bb44573eb15c7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportAssignments(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node18).errors.txt new file mode 100644 index 0000000000000..7e86097227b3b --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node18).js new file mode 100644 index 0000000000000..da6fe0fc80095 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node18).symbols new file mode 100644 index 0000000000000..91fce59692fb1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node18).types new file mode 100644 index 0000000000000..dc944e2b96ae6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node18).errors.txt new file mode 100644 index 0000000000000..a0ed330173ed8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node18).js new file mode 100644 index 0000000000000..396ca2dfc4bcc --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node18).symbols new file mode 100644 index 0000000000000..9dc062fedd9a6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node18).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=node18).trace.json b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node18).trace.json new file mode 100644 index 0000000000000..b75c764ff9c7c --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node18).trace.json @@ -0,0 +1,1080 @@ +[ + "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.", + "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.", + "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.", + "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.", + "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.", + "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.", + "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.", + "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.", + "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.", + "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.", + "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.", + "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.", + "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.", + "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.", + "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.", + "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.", + "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.", + "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.", + "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-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-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=node18).types b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node18).types new file mode 100644 index 0000000000000..9dc062fedd9a6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node18).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/nodeModulesExportsSourceTs(module=node18).errors.txt b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node18).errors.txt new file mode 100644 index 0000000000000..358a0e61437a1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node18).js new file mode 100644 index 0000000000000..b6f1adda8d33c --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node18).symbols new file mode 100644 index 0000000000000..182723309687c --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node18).types new file mode 100644 index 0000000000000..880b84aad2d77 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSourceTs(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node18).errors.txt new file mode 100644 index 0000000000000..08ce05322d3bc --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node18).js new file mode 100644 index 0000000000000..5db58ae2f7bfa --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node18).symbols new file mode 100644 index 0000000000000..d429eab9b497f --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node18).types new file mode 100644 index 0000000000000..d62dfd1155d03 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node18).errors.txt new file mode 100644 index 0000000000000..f7015dbf604c1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node18).js new file mode 100644 index 0000000000000..c0d6b006b33cf --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node18).symbols new file mode 100644 index 0000000000000..6fd6d1a29cedd --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node18).types new file mode 100644 index 0000000000000..034994f0ff8bb --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node18).errors.txt new file mode 100644 index 0000000000000..002881ca1c0e7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node18).js new file mode 100644 index 0000000000000..dcdd62bed698d --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node18).symbols new file mode 100644 index 0000000000000..7429733b3c4f6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node18).types new file mode 100644 index 0000000000000..78367ad6e9714 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node18).errors.txt new file mode 100644 index 0000000000000..e338028b93522 --- /dev/null +++ b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node18).js new file mode 100644 index 0000000000000..4cca6af5a58d7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node18).symbols new file mode 100644 index 0000000000000..6283085cda132 --- /dev/null +++ b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node18).types new file mode 100644 index 0000000000000..ff52c1dedd1b3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node18).errors.txt new file mode 100644 index 0000000000000..fe89fc2f3863b --- /dev/null +++ b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node18).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 Node18. +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 Node18. + 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=node18).js b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node18).js new file mode 100644 index 0000000000000..3b196cd32c98b --- /dev/null +++ b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node18).symbols new file mode 100644 index 0000000000000..a30d4a614f899 --- /dev/null +++ b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node18).types new file mode 100644 index 0000000000000..c1875847654cd --- /dev/null +++ b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node18).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 13610391f6d16..87c7929eb2580 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', 'nodenext', or 'preserve'. -otherc.cts(1,35): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +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 errors) ==== import json from "./package.json" assert { type: "json" }; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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=node18).errors.txt b/tests/baselines/reference/nodeModulesImportAssertions(module=node18).errors.txt new file mode 100644 index 0000000000000..b1d54f8e2145b --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=node18).errors.txt @@ -0,0 +1,16 @@ +otherc.cts(1,35): error TS2836: Import assertions are not allowed on statements that compile to CommonJS 'require' calls. + + +==== index.ts (0 errors) ==== + import json from "./package.json" assert { type: "json" }; +==== otherc.cts (1 errors) ==== + import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2836: Import assertions are not allowed on statements that compile to CommonJS 'require' calls. + 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=node18).js b/tests/baselines/reference/nodeModulesImportAssertions(module=node18).js new file mode 100644 index 0000000000000..091166d523cd1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportAssertions(module=node18).symbols new file mode 100644 index 0000000000000..881cb771218da --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportAssertions(module=node18).types new file mode 100644 index 0000000000000..9780c35bba0cc --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesImportAssignments(module=node18).js new file mode 100644 index 0000000000000..c73ff1177a58e --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssignments(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportAssignments(module=node18).symbols new file mode 100644 index 0000000000000..0833a1e78f70d --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssignments(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportAssignments(module=node18).types new file mode 100644 index 0000000000000..f73668aaa7a8f --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssignments(module=node18).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 c06636ec80aca..5d2fe738900b5 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', 'nodenext', or 'preserve'. -otherc.cts(1,35): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +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 errors) ==== import json from "./package.json" with { type: "json" }; ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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=node18).errors.txt b/tests/baselines/reference/nodeModulesImportAttributes(module=node18).errors.txt new file mode 100644 index 0000000000000..8f85517984cb6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesImportAttributes(module=node18).js new file mode 100644 index 0000000000000..fb3984fd32c68 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportAttributes(module=node18).symbols new file mode 100644 index 0000000000000..6666db3e5b459 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportAttributes(module=node18).types new file mode 100644 index 0000000000000..6f07805d83b53 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=node18).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 5986330507739..dc92388a5f008 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', 'nodenext', or 'preserve'. +/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,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', '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 (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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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=node18).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node18).errors.txt new file mode 100644 index 0000000000000..bf4698ad28e95 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node18).js new file mode 100644 index 0000000000000..7175dbf9479d7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node18).symbols new file mode 100644 index 0000000000000..b2c93c67d55e4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node18).types new file mode 100644 index 0000000000000..107dc1327d766 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node18).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 23d74c2152e6c..1bd8e26f0ac51 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', 'nodenext', or 'preserve'. -/index.ts(7,49): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +/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 (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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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=node18).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node18).errors.txt new file mode 100644 index 0000000000000..5c93150f88f13 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node18).js new file mode 100644 index 0000000000000..afe399f85b0ad --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node18).symbols new file mode 100644 index 0000000000000..d76777ff60b36 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node18).types new file mode 100644 index 0000000000000..79bd80a1c7f46 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node18).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 f488863314397..4bd1844e4824d 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', 'nodenext', or 'preserve'. +/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,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', 'nodenext', or 'preserve'. -/index.ts(6,76): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +/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 (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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. export interface LocalInterface extends RequireInterface, ImportInterface {} diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node18).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node18).errors.txt new file mode 100644 index 0000000000000..c45ca1322b3a8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node18).js new file mode 100644 index 0000000000000..988072b042c93 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node18).symbols new file mode 100644 index 0000000000000..33a5f17944412 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node18).types new file mode 100644 index 0000000000000..d432212769fe8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node18).js new file mode 100644 index 0000000000000..44948d9ed5250 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node18).symbols new file mode 100644 index 0000000000000..1f0e1652f5505 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node18).types new file mode 100644 index 0000000000000..1c9297e238011 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node18).errors.txt new file mode 100644 index 0000000000000..2d2f2c5b8ffbb --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node18).errors.txt @@ -0,0 +1,308 @@ +/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 TS2559: Type '{ "resolution-mode": string; }[]' has no properties in common with type 'ImportCallOptions'. +/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 TS2559: Type '{ "resolution-mode": string; }[]' has no properties in common with 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: '{' 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=node18).js b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node18).js new file mode 100644 index 0000000000000..c64b30d4e5bba --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node18).symbols new file mode 100644 index 0000000000000..8a23a85dd4673 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node18).types new file mode 100644 index 0000000000000..c1e5b7e23e6a1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node18).errors.txt new file mode 100644 index 0000000000000..05c2a81067dde --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node18).js new file mode 100644 index 0000000000000..4712d65a0999e --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node18).symbols new file mode 100644 index 0000000000000..100e1481edf0d --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node18).types new file mode 100644 index 0000000000000..6290a2888be05 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node18).errors.txt new file mode 100644 index 0000000000000..176b3d13fe10e --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node18).js new file mode 100644 index 0000000000000..c058d00e216e0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node18).symbols new file mode 100644 index 0000000000000..e41469a2edb5c --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node18).types new file mode 100644 index 0000000000000..84f5d49b9c0c3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node18).errors.txt new file mode 100644 index 0000000000000..a5f7cf4be1399 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node18).js new file mode 100644 index 0000000000000..381f1b8ba964b --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node18).symbols new file mode 100644 index 0000000000000..db6b4d5b50a13 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node18).types new file mode 100644 index 0000000000000..fe3a6a4729b0b --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesImportMeta(module=node18).errors.txt new file mode 100644 index 0000000000000..dc4849ff5093c --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportMeta(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesImportMeta(module=node18).js new file mode 100644 index 0000000000000..aa962a90bd346 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportMeta(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportMeta(module=node18).symbols new file mode 100644 index 0000000000000..dd1b136815bf7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportMeta(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportMeta(module=node18).types new file mode 100644 index 0000000000000..b64e4b920275f --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportMeta(module=node18).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 7ab6639b5d644..550ef21197815 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', 'nodenext', or 'preserve'. +/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,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', '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 (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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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=node18).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node18).errors.txt new file mode 100644 index 0000000000000..e77140972a1ce --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node18).errors.txt @@ -0,0 +1,37 @@ +/index.ts(6,50): error TS2836: Import assertions 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 TS2836: Import assertions are not allowed on statements that compile to CommonJS 'require' calls. + + +==== /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 TS2836: Import assertions are not allowed on statements that compile to CommonJS 'require' calls. + import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2836: Import assertions are not allowed on statements that compile to CommonJS 'require' calls. + 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=node18).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node18).js new file mode 100644 index 0000000000000..1b8bc65976edc --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node18).symbols new file mode 100644 index 0000000000000..97a76656c4050 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node18).types new file mode 100644 index 0000000000000..27ce52d60a048 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node18).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 06d7b09c3ecbf..1604272f9e21a 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', 'nodenext', or 'preserve'. -/index.ts(7,49): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +/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 (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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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=node18).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node18).errors.txt new file mode 100644 index 0000000000000..47c2ad040c0db --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node18).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" 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 TS1454: `resolution-mode` can only be set for type-only imports. + import {type ImportInterface as Imp} from "pkg" assert { "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" 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=node18).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node18).js new file mode 100644 index 0000000000000..fad19d466a6ac --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node18).symbols new file mode 100644 index 0000000000000..8d280aee6ffa1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node18).types new file mode 100644 index 0000000000000..60e006fe4390a --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node18).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 b84ec4d29a319..1bf72bb46af00 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', 'nodenext', or 'preserve'. +/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,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', 'nodenext', or 'preserve'. -/index.ts(6,76): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +/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 (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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'. export interface LocalInterface extends RequireInterface, ImportInterface {} diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node18).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node18).errors.txt new file mode 100644 index 0000000000000..e1be07261876a --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node18).errors.txt @@ -0,0 +1,43 @@ +/index.ts(2,45): error TS2836: Import assertions are not allowed on statements that compile to CommonJS 'require' calls. +/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 TS2836: Import assertions are not allowed on statements that compile to CommonJS 'require' calls. +/index.ts(6,76): error TS2836: Import assertions are not allowed on statements that compile to CommonJS 'require' calls. + + +==== /index.ts (5 errors) ==== + // incorrect mode + import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2836: Import assertions 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" assert { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2836: Import assertions 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" assert { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2836: Import assertions 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/nodeModulesImportModeDeclarationEmitErrors1(module=node18).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node18).js new file mode 100644 index 0000000000000..3b2af2656d08b --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node18).symbols new file mode 100644 index 0000000000000..b209c65c177c1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node18).types new file mode 100644 index 0000000000000..b9bc7c1552479 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node18).js new file mode 100644 index 0000000000000..a60b20a63d224 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node18).symbols new file mode 100644 index 0000000000000..81f53360e0ce2 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node18).types new file mode 100644 index 0000000000000..594635bc9aee3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node18).errors.txt new file mode 100644 index 0000000000000..01d8a2fd08354 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node18).js new file mode 100644 index 0000000000000..fa6401e1a49a4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node18).symbols new file mode 100644 index 0000000000000..06c86181b6d0d --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node18).types new file mode 100644 index 0000000000000..d00dcba79df38 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node18).js new file mode 100644 index 0000000000000..6c0a3531fac79 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node18).symbols new file mode 100644 index 0000000000000..7558565243724 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node18).types new file mode 100644 index 0000000000000..87c7913723785 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node18).errors.txt new file mode 100644 index 0000000000000..5172f49a5c8cd --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node18).errors.txt @@ -0,0 +1,302 @@ +/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 TS2559: Type '{ "resolution-mode": string; }[]' has no properties in common with type 'ImportCallOptions'. +/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 TS2559: Type '{ "resolution-mode": string; }[]' has no properties in common with 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: '{' 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=node18).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node18).js new file mode 100644 index 0000000000000..813770edf9748 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node18).symbols new file mode 100644 index 0000000000000..ea0f4216cd5c7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node18).types new file mode 100644 index 0000000000000..a38ebca6a3f1d --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node18).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 ec8512329307c..8977f188ced9e 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', 'nodenext', or 'preserve'. +/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(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', 'nodenext', or 'preserve'. -/main.mts(6,52): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -/main.mts(9,47): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +/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(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', 'nodenext', or 'preserve'. -/main.mts(11,42): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +/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(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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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=node18).errors.txt b/tests/baselines/reference/nodeModulesJson(module=node18).errors.txt new file mode 100644 index 0000000000000..4ba7849c2d719 --- /dev/null +++ b/tests/baselines/reference/nodeModulesJson(module=node18).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 'Node18'. +/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 'Node18'. +/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 'Node18'. +/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 'Node18'. +/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 'Node18'. + 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 'Node18'. + + 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 'Node18'. + 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 'Node18'. + 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=node18).symbols b/tests/baselines/reference/nodeModulesJson(module=node18).symbols new file mode 100644 index 0000000000000..52d983d5b9516 --- /dev/null +++ b/tests/baselines/reference/nodeModulesJson(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesJson(module=node18).types new file mode 100644 index 0000000000000..37ac9a196dd4e --- /dev/null +++ b/tests/baselines/reference/nodeModulesJson(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesPackageExports(module=node18).errors.txt new file mode 100644 index 0000000000000..1c28214a47363 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageExports(module=node18).errors.txt @@ -0,0 +1,109 @@ +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.cts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package/mjs")' call instead. +index.cts(4,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package")' call instead. +index.cts(9,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. +node_modules/inner/index.d.cts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +node_modules/inner/index.d.ts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. + + +!!! 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 (3 errors) ==== + // cjs format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + ~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package/mjs")' call instead. + import * as type from "package"; + ~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package")' call instead. + cjs; + mjs; + type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. + import * as typei from "inner"; + cjsi; + mjsi; + typei; +==== node_modules/inner/index.d.ts (2 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. + 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 (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs")' call instead. + 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=node18).js b/tests/baselines/reference/nodeModulesPackageExports(module=node18).js new file mode 100644 index 0000000000000..7d1a5738c7346 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageExports(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesPackageExports(module=node18).symbols new file mode 100644 index 0000000000000..9e1ccdd9c0683 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageExports(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesPackageExports(module=node18).types new file mode 100644 index 0000000000000..536830b78cd02 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageExports(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesPackageImports(module=node18).errors.txt new file mode 100644 index 0000000000000..1599e814addf0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node18).errors.txt @@ -0,0 +1,44 @@ +index.cts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("#mjs")' call instead. +index.cts(4,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("#type")' call instead. + + +==== index.ts (0 errors) ==== + // esm format file + import * as cjs from "#cjs"; + import * as mjs from "#mjs"; + import * as type from "#type"; + cjs; + mjs; + type; +==== index.mts (0 errors) ==== + // esm format file + import * as cjs from "#cjs"; + import * as mjs from "#mjs"; + import * as type from "#type"; + cjs; + mjs; + type; +==== index.cts (2 errors) ==== + // esm format file + import * as cjs from "#cjs"; + import * as mjs from "#mjs"; + ~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("#mjs")' call instead. + import * as type from "#type"; + ~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("#type")' call instead. + 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/nodeModulesPackageImports(module=node18).js b/tests/baselines/reference/nodeModulesPackageImports(module=node18).js new file mode 100644 index 0000000000000..c25d1005e93d5 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesPackageImports(module=node18).symbols new file mode 100644 index 0000000000000..2004395af751e --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node18).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=node18).trace.json b/tests/baselines/reference/nodeModulesPackageImports(module=node18).trace.json new file mode 100644 index 0000000000000..1fc306a0c6b64 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node18).trace.json @@ -0,0 +1,992 @@ +[ + "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-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-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=node18).types b/tests/baselines/reference/nodeModulesPackageImports(module=node18).types new file mode 100644 index 0000000000000..7cddffea56c0b --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node18).errors.txt new file mode 100644 index 0000000000000..624ebe117783b --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node18).errors.txt @@ -0,0 +1,78 @@ +index.cts(3,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. +node_modules/inner/index.d.cts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +node_modules/inner/index.d.ts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. + + +==== 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 (1 errors) ==== + // cjs format file + import * as cjsi from "inner/cjs/index"; + import * as mjsi from "inner/mjs/index"; + ~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. + import * as typei from "inner/js/index"; + cjsi; + mjsi; + typei; +==== node_modules/inner/index.d.ts (2 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"; + ~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. + 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 (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index"; + import * as mjs from "inner/mjs/index"; + ~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. + 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=node18).js b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node18).js new file mode 100644 index 0000000000000..f710ad1fe43f2 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node18).symbols new file mode 100644 index 0000000000000..40ff4714e8e00 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node18).types new file mode 100644 index 0000000000000..8de436002a1fa --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node18).errors.txt new file mode 100644 index 0000000000000..fd89603b91a5c --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node18).errors.txt @@ -0,0 +1,177 @@ +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.cts(9,24): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. +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.cts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +node_modules/inner/index.d.ts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. + + +==== 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 (4 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"; + ~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. + 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 (2 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"; + ~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. + 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 (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index"; + import * as mjs from "inner/mjs/index"; + ~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index")' call instead. + 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=node18).js b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node18).js new file mode 100644 index 0000000000000..5fe735dbc37b1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node18).symbols new file mode 100644 index 0000000000000..fd0ed5715baab --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node18).types new file mode 100644 index 0000000000000..b94e493366d49 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsExclude(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node18).errors.txt new file mode 100644 index 0000000000000..0ec3660afe010 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node18).errors.txt @@ -0,0 +1,78 @@ +index.cts(3,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index.mjs")' call instead. +node_modules/inner/index.d.cts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index.mjs")' call instead. +node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +node_modules/inner/index.d.ts(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index.mjs")' call instead. + + +==== 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 (1 errors) ==== + // cjs format file + import * as cjsi from "inner/cjs/index.cjs"; + import * as mjsi from "inner/mjs/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index.mjs")' call instead. + import * as typei from "inner/js/index.js"; + cjsi; + mjsi; + typei; +==== node_modules/inner/index.d.ts (2 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"; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index.mjs")' call instead. + 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 (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index.cjs"; + import * as mjs from "inner/mjs/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("inner/mjs/index.mjs")' call instead. + 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=node18).js b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node18).js new file mode 100644 index 0000000000000..18a9e37f040a1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node18).symbols new file mode 100644 index 0000000000000..99d90e029a57c --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node18).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=node18).trace.json b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node18).trace.json new file mode 100644 index 0000000000000..4d02f9365e312 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node18).trace.json @@ -0,0 +1,1055 @@ +[ + "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.", + "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.", + "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.", + "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.", + "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.", + "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.", + "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-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-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=node18).types b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node18).types new file mode 100644 index 0000000000000..c11fe2feb146f --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node18).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/nodeModulesResolveJsonModule(module=node16).errors.txt b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).errors.txt index 28215efa84cbd..25a8b3a5e995e 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', 'nodenext', or 'preserve'. -index.mts(3,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -index.ts(1,34): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. -index.ts(3,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. +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.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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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', 'nodenext', or 'preserve'. +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', '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=node18).js b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node18).js new file mode 100644 index 0000000000000..09afe3776dcb2 --- /dev/null +++ b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node18).symbols new file mode 100644 index 0000000000000..e38476567ace3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node18).types new file mode 100644 index 0000000000000..aa041b8d125eb --- /dev/null +++ b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node18).errors.txt new file mode 100644 index 0000000000000..44537a76c954c --- /dev/null +++ b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node18).errors.txt @@ -0,0 +1,45 @@ +index.ts(3,22): error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. +subfolder/index.ts(2,17): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("../index.js")' call instead. + To convert this file to an ECMAScript module, change its file extension to '.mts' or create a local package.json file with `{ "type": "module" }`. +subfolder/index.ts(3,22): error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + + +==== subfolder/index.ts (2 errors) ==== + // cjs format file + import {h} from "../index.js"; + ~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("../index.js")' call instead. +!!! error TS1479: To convert this file to an ECMAScript module, change its file extension to '.mts' or create a local package.json file with `{ "type": "module" }`. + import mod = require("../index.js"); + ~~~~~~~~~~~~~ +!!! error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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 (1 errors) ==== + // esm format file + import {h as _h} from "./index.js"; + import mod = require("./index.js"); + ~~~~~~~~~~~~ +!!! error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead. + 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 (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/nodeModulesSynchronousCallErrors(module=node18).js b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node18).js new file mode 100644 index 0000000000000..f317196b7b330 --- /dev/null +++ b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node18).symbols new file mode 100644 index 0000000000000..c6feab94f0b7b --- /dev/null +++ b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node18).types new file mode 100644 index 0000000000000..508587cdb1aa9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node18).errors.txt new file mode 100644 index 0000000000000..0fd2e5390cdaf --- /dev/null +++ b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node18).js new file mode 100644 index 0000000000000..8d33777f0c4e7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node18).symbols new file mode 100644 index 0000000000000..c031a3a84d991 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node18).types new file mode 100644 index 0000000000000..993c334814568 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node18).js new file mode 100644 index 0000000000000..fe56029e4550f --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node18).symbols new file mode 100644 index 0000000000000..e9ef3b7f0b67f --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node18).types new file mode 100644 index 0000000000000..12d57f77e6462 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node18).js new file mode 100644 index 0000000000000..86c97ee2d0bdf --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node18).symbols new file mode 100644 index 0000000000000..dfccc41309458 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node18).types new file mode 100644 index 0000000000000..fddc105efb549 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node18).js new file mode 100644 index 0000000000000..a8890a9178cb4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node18).symbols new file mode 100644 index 0000000000000..bfbd450d9dbd0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node18).types new file mode 100644 index 0000000000000..f56da1e5c1cb5 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node18).js new file mode 100644 index 0000000000000..db90df830c912 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node18).symbols new file mode 100644 index 0000000000000..e719de58b3b23 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node18).types new file mode 100644 index 0000000000000..4335bc3ab76a4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node18).js new file mode 100644 index 0000000000000..c493d944dd946 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node18).symbols new file mode 100644 index 0000000000000..3508b838ed8fb --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node18).types new file mode 100644 index 0000000000000..1b71bbe867818 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node18).js new file mode 100644 index 0000000000000..a4f6401e19790 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node18).symbols new file mode 100644 index 0000000000000..5b4a63b24e6f4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node18).types new file mode 100644 index 0000000000000..79de08e8be8c3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node18).js new file mode 100644 index 0000000000000..e6134a89881bc --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node18).symbols new file mode 100644 index 0000000000000..26fb30363849d --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node18).types new file mode 100644 index 0000000000000..478e6741c1467 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node18).errors.txt new file mode 100644 index 0000000000000..c9a6ac79317f9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node18).js new file mode 100644 index 0000000000000..df6436da900a7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node18).symbols new file mode 100644 index 0000000000000..0959d385ada08 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node18).types new file mode 100644 index 0000000000000..a9b87eb30959c --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node18).errors.txt new file mode 100644 index 0000000000000..13991aa13538a --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node18).js new file mode 100644 index 0000000000000..aee176689b2d9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node18).symbols new file mode 100644 index 0000000000000..0f65d258dc7cf --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node18).types new file mode 100644 index 0000000000000..438257a3bb9c3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node18).errors.txt new file mode 100644 index 0000000000000..477d247984d39 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node18).js new file mode 100644 index 0000000000000..c6806f897de91 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node18).symbols new file mode 100644 index 0000000000000..1c8df0a238567 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node18).types new file mode 100644 index 0000000000000..a655521043fd9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node18).errors.txt new file mode 100644 index 0000000000000..3d7f07f2775e1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node18).js new file mode 100644 index 0000000000000..74346916b2641 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node18).symbols new file mode 100644 index 0000000000000..9f7867c7dbd5a --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node18).types new file mode 100644 index 0000000000000..45343b1ac3c7d --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node18).js new file mode 100644 index 0000000000000..0c37dc00e4deb --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node18).symbols new file mode 100644 index 0000000000000..1e0a2417e63a0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node18).types new file mode 100644 index 0000000000000..bb5a09e68df2d --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node18).errors.txt new file mode 100644 index 0000000000000..68be0baf51514 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node18).js new file mode 100644 index 0000000000000..09540ae8aba4a --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node18).symbols new file mode 100644 index 0000000000000..8a1dd89345abe --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node18).types new file mode 100644 index 0000000000000..fc34db9ecd52d --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node18).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=node18).js b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node18).js new file mode 100644 index 0000000000000..fe34ab0566b01 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node18).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=node18).symbols b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node18).symbols new file mode 100644 index 0000000000000..8ec3cb25a7915 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node18).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=node18).types b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node18).types new file mode 100644 index 0000000000000..c4e2d97b2afba --- /dev/null +++ b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodePackageSelfName(module=node18).errors.txt new file mode 100644 index 0000000000000..0c45f9b8f43a1 --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfName(module=node18).errors.txt @@ -0,0 +1,24 @@ +index.cts(2,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package")' call instead. + + +==== index.ts (0 errors) ==== + // esm format file + import * as self from "package"; + self; +==== index.mts (0 errors) ==== + // esm format file + import * as self from "package"; + self; +==== index.cts (1 errors) ==== + // esm format file + import * as self from "package"; + ~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package")' call instead. + 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/nodePackageSelfName(module=node18).js b/tests/baselines/reference/nodePackageSelfName(module=node18).js new file mode 100644 index 0000000000000..dc65d690cf617 --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfName(module=node18).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=node18).symbols b/tests/baselines/reference/nodePackageSelfName(module=node18).symbols new file mode 100644 index 0000000000000..88b7e3612047e --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfName(module=node18).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=node18).types b/tests/baselines/reference/nodePackageSelfName(module=node18).types new file mode 100644 index 0000000000000..058acb1f54fdf --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfName(module=node18).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=node18).errors.txt b/tests/baselines/reference/nodePackageSelfNameScoped(module=node18).errors.txt new file mode 100644 index 0000000000000..2c0b58848c59a --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfNameScoped(module=node18).errors.txt @@ -0,0 +1,24 @@ +index.cts(2,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@scope/package")' call instead. + + +==== index.ts (0 errors) ==== + // esm format file + import * as self from "@scope/package"; + self; +==== index.mts (0 errors) ==== + // esm format file + import * as self from "@scope/package"; + self; +==== index.cts (1 errors) ==== + // cjs format file + import * as self from "@scope/package"; + ~~~~~~~~~~~~~~~~ +!!! error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@scope/package")' call instead. + self; +==== package.json (0 errors) ==== + { + "name": "@scope/package", + "private": true, + "type": "module", + "exports": "./index.js" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=node18).js b/tests/baselines/reference/nodePackageSelfNameScoped(module=node18).js new file mode 100644 index 0000000000000..f9d633df6fc03 --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfNameScoped(module=node18).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=node18).symbols b/tests/baselines/reference/nodePackageSelfNameScoped(module=node18).symbols new file mode 100644 index 0000000000000..3b63ba35050a0 --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfNameScoped(module=node18).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=node18).types b/tests/baselines/reference/nodePackageSelfNameScoped(module=node18).types new file mode 100644 index 0000000000000..e197ff58db4b0 --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfNameScoped(module=node18).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/parser.forAwait.es2018.errors.txt b/tests/baselines/reference/parser.forAwait.es2018.errors.txt index 93133c27df9ec..5ac9587cdb8c5 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', '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', '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', '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', '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', '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', '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', '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', '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/topLevelAwait.1(module=es2022,target=es2015).errors.txt b/tests/baselines/reference/topLevelAwait.1(module=es2022,target=es2015).errors.txt index 2c3e91ab9f077..deff8ae8b66fc 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', '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', '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', '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', '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 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', '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', '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', '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', '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', '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', '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 2c3e91ab9f077..deff8ae8b66fc 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', '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', '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', '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', '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 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', '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', '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', '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', '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', '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', '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 2c3e91ab9f077..deff8ae8b66fc 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', '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', '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', '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', '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 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', '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', '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', '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', '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', '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', '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 cb831b29062be..db2b266576521 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', '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', 'nodenext', 'preserve'. +!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', '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.js b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.js index c7570e811922c..61215bc876f57 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.js +++ b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.js @@ -1 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); //# sourceMappingURL=file.js.map \ 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 cb831b29062be..db2b266576521 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', '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', 'nodenext', 'preserve'. +!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', '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.js b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.oldTranspile.js index c7570e811922c..61215bc876f57 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.oldTranspile.js +++ b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.oldTranspile.js @@ -1 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); //# sourceMappingURL=file.js.map \ 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 cb831b29062be..db2b266576521 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', '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', 'nodenext', 'preserve'. +!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', '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.js b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.js index c7570e811922c..61215bc876f57 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.js +++ b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.js @@ -1 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); //# sourceMappingURL=file.js.map \ 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 cb831b29062be..db2b266576521 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', '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', 'nodenext', 'preserve'. +!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'node18', '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.js b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.oldTranspile.js index c7570e811922c..61215bc876f57 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.oldTranspile.js +++ b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.oldTranspile.js @@ -1 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); //# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node18).errors.txt b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node18).errors.txt new file mode 100644 index 0000000000000..9062d29947423 --- /dev/null +++ b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node18).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=node18).js b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node18).js new file mode 100644 index 0000000000000..7c518b3b9d9cc --- /dev/null +++ b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node18).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=node18).symbols b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node18).symbols new file mode 100644 index 0000000000000..a98af671f5982 --- /dev/null +++ b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node18).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=node18).types b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node18).types new file mode 100644 index 0000000000000..fb8b260b07e8b --- /dev/null +++ b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node18).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/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 18074462bfebd..1d8a51da65d81 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, nodenext, preserve +one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, node18, 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 7f2aced1096ea..a758fb9b2102a 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, nodenext, preserve +one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, node18, nodenext, preserve default: undefined --moduleResolution diff --git a/tests/baselines/reference/tsc/commandLine/help.js b/tests/baselines/reference/tsc/commandLine/help.js index 7832007b209a2..63bb49ab2d7dd 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, nodenext, preserve +one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, node18, 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 3c47dc1ebc6d3..f872bbc376d6e 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, nodenext, preserve +one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, node18, 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 3c47dc1ebc6d3..f872bbc376d6e 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, nodenext, preserve +one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, node18, nodenext, preserve default: undefined --lib diff --git a/tests/cases/compiler/moduleNodeDefaultImports.ts b/tests/cases/compiler/moduleNodeDefaultImports.ts index 906de682bd610..a784dcddb6824 100644 --- a/tests/cases/compiler/moduleNodeDefaultImports.ts +++ b/tests/cases/compiler/moduleNodeDefaultImports.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 74601d43da250..df96cce680e38 100644 --- a/tests/cases/compiler/moduleResolutionWithModule.ts +++ b/tests/cases/compiler/moduleResolutionWithModule.ts @@ -1,5 +1,5 @@ // @moduleResolution: node16,nodenext -// @module: commonjs,node16,nodenext +// @module: commonjs,node16,node18,nodenext // @filename: node_modules/pkg/package.json { "name": "pkg", diff --git a/tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts b/tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts index fe80146389c63..70e1754726f8a 100644 --- a/tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts +++ b/tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts @@ -1,4 +1,4 @@ -// @module: commonjs,node16,nodenext +// @module: commonjs,node16,node18,nodenext // @filename: node_modules/pkg/index.d.ts interface GlobalThing { a: number } // @filename: node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts b/tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts index bf4718d847a54..4e3788f8338d9 100644 --- a/tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts +++ b/tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 f790752053fc2..d5834ca8d7da6 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 74143dcefaa66..665c180e48b74 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 f6f62444a6162..4624489191369 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsConditionalPackageExports.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsConditionalPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 5da3c3e542526..a004f5d596027 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 0457ce4cb6237..9d180b21ff55d 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportAssignment.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportAssignment.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 24037e466bafa..825ec48c1fdc0 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportlessJsModuleDetectionAuto.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportlessJsModuleDetectionAuto.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 7cb94da8f6026..7109501c97ad9 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsGeneratedNameCollisions.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsGeneratedNameCollisions.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 2688b07fb9996..bff55957be3bf 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportAssignment.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportAssignment.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 26874896143b7..ddc1c7aee61b1 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions1.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions1.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 af20a16ba76fa..352dec8d0d056 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions2.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions2.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 c634df34ee75e..c333e89ae2b69 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions3.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions3.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 43fdf016c4361..6052da8ae6090 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportMeta.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportMeta.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 23de392ed7ead..b0cafc753aa38 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageExports.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 84d0f650abcb9..f7d1e1fbfeb36 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageImports.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageImports.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 eab5792b8fbac..8579530d1959d 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 f402a08f65144..c6906f952d101 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsExclude.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsExclude.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 b8ea4f9cbd89e..9fd48761935cb 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 78025e25074e7..28880b0bb1513 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 e18c50fef7a64..85e9dbd027549 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsTopLevelAwait.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsTopLevelAwait.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/nodeModules1.ts b/tests/cases/conformance/node/nodeModules1.ts index 32c83b4525bcd..9f5c7c34cf347 100644 --- a/tests/cases/conformance/node/nodeModules1.ts +++ b/tests/cases/conformance/node/nodeModules1.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts b/tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts index 31051b3a18be0..a3383412a6325 100644 --- a/tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts +++ b/tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 a0240cdef4ecf..1ccd7940cd011 100644 --- a/tests/cases/conformance/node/nodeModulesConditionalPackageExports.ts +++ b/tests/cases/conformance/node/nodeModulesConditionalPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,nodenext // @declaration: true // @outDir: out // @filename: index.ts diff --git a/tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts b/tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts index 9b4eb3ec9f8c6..b27afe6264f1b 100644 --- a/tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts +++ b/tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 0864b42bbaf37..adb95b880d1d1 100644 --- a/tests/cases/conformance/node/nodeModulesDynamicImport.ts +++ b/tests/cases/conformance/node/nodeModulesDynamicImport.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 efc867fa1c659..89edf8fd865de 100644 --- a/tests/cases/conformance/node/nodeModulesExportAssignments.ts +++ b/tests/cases/conformance/node/nodeModulesExportAssignments.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 ee6587b5ea073..0872690b12d92 100644 --- a/tests/cases/conformance/node/nodeModulesExportsBlocksSpecifierResolution.ts +++ b/tests/cases/conformance/node/nodeModulesExportsBlocksSpecifierResolution.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 2eedbe682cdd5..ffbf85544cb97 100644 --- a/tests/cases/conformance/node/nodeModulesExportsBlocksTypesVersions.ts +++ b/tests/cases/conformance/node/nodeModulesExportsBlocksTypesVersions.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,nodenext // @traceResolution: true // @noImplicitAny: true diff --git a/tests/cases/conformance/node/nodeModulesExportsSourceTs.ts b/tests/cases/conformance/node/nodeModulesExportsSourceTs.ts index 5ca23c1526a0e..085f46664d32a 100644 --- a/tests/cases/conformance/node/nodeModulesExportsSourceTs.ts +++ b/tests/cases/conformance/node/nodeModulesExportsSourceTs.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 92c686f1c2303..cbf71e6946549 100644 --- a/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationConditions.ts +++ b/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationConditions.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 684cb5588fc74..48fde3a47d4a4 100644 --- a/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationDirectory.ts +++ b/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationDirectory.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 a325a2dfe6c63..2c38bb643dcf6 100644 --- a/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationPattern.ts +++ b/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationPattern.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 ca9ff3cf41311..11c31e1911514 100644 --- a/tests/cases/conformance/node/nodeModulesForbidenSyntax.ts +++ b/tests/cases/conformance/node/nodeModulesForbidenSyntax.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 6f6fa8acb0763..280cbf6a1034c 100644 --- a/tests/cases/conformance/node/nodeModulesGeneratedNameCollisions.ts +++ b/tests/cases/conformance/node/nodeModulesGeneratedNameCollisions.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 ae941bd003b3f..6a07e4b6fa791 100644 --- a/tests/cases/conformance/node/nodeModulesImportAssertions.ts +++ b/tests/cases/conformance/node/nodeModulesImportAssertions.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 cce29eb0d7583..c1a7755672624 100644 --- a/tests/cases/conformance/node/nodeModulesImportAssignments.ts +++ b/tests/cases/conformance/node/nodeModulesImportAssignments.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 9e2a3271c0218..df1d41da30f6a 100644 --- a/tests/cases/conformance/node/nodeModulesImportAttributes.ts +++ b/tests/cases/conformance/node/nodeModulesImportAttributes.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 181853d1fa02d..c96ff4ec18e1f 100644 --- a/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts +++ b/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 b8cc7f112fda3..2303ab5b990c2 100644 --- a/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts +++ b/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 2aee1dfac573a..7b0936775e3bd 100644 --- a/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts +++ b/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 45bf0f409e569..ad94d514c6004 100644 --- a/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts +++ b/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 e5c7c1420f314..62d901221c95b 100644 --- a/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts +++ b/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 0a4698a95fba3..4ddca84f106fc 100644 --- a/tests/cases/conformance/node/nodeModulesImportHelpersCollisions.ts +++ b/tests/cases/conformance/node/nodeModulesImportHelpersCollisions.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 58e65723cbc1b..6c962f5f17db8 100644 --- a/tests/cases/conformance/node/nodeModulesImportHelpersCollisions2.ts +++ b/tests/cases/conformance/node/nodeModulesImportHelpersCollisions2.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 7fb02dad355e5..574a04790c4b6 100644 --- a/tests/cases/conformance/node/nodeModulesImportHelpersCollisions3.ts +++ b/tests/cases/conformance/node/nodeModulesImportHelpersCollisions3.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,nodenext // @target: es5 // @declaration: true // @importHelpers: true diff --git a/tests/cases/conformance/node/nodeModulesImportMeta.ts b/tests/cases/conformance/node/nodeModulesImportMeta.ts index cc8bdcce9da1e..e7f1e79c2f21d 100644 --- a/tests/cases/conformance/node/nodeModulesImportMeta.ts +++ b/tests/cases/conformance/node/nodeModulesImportMeta.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 c1c0c57cf9d64..81a81cc0bcd4e 100644 --- a/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit1.ts +++ b/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 06a9b226b2192..2fbee45ab1d7a 100644 --- a/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit2.ts +++ b/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit2.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 01907185636c6..4d4331be3ddc3 100644 --- a/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmitErrors1.ts +++ b/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmitErrors1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 58a8adbf9b0a2..f55158f2f827c 100644 --- a/tests/cases/conformance/node/nodeModulesImportResolutionIntoExport.ts +++ b/tests/cases/conformance/node/nodeModulesImportResolutionIntoExport.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 b3a4139a00c9e..6381ae8ccdb42 100644 --- a/tests/cases/conformance/node/nodeModulesImportResolutionNoCycle.ts +++ b/tests/cases/conformance/node/nodeModulesImportResolutionNoCycle.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 c6ca4e2f13f97..b79826e7400ed 100644 --- a/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmit1.ts +++ b/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmit1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 d118bc6da2931..e8266d8eb1e0b 100644 --- a/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmitErrors1.ts +++ b/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmitErrors1.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 44469097d0d06..a3b8c44d38f09 100644 --- a/tests/cases/conformance/node/nodeModulesJson.ts +++ b/tests/cases/conformance/node/nodeModulesJson.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,nodenext // @resolveJsonModule: true // @noEmit: true diff --git a/tests/cases/conformance/node/nodeModulesPackageExports.ts b/tests/cases/conformance/node/nodeModulesPackageExports.ts index 6433e49270feb..32f28261195a5 100644 --- a/tests/cases/conformance/node/nodeModulesPackageExports.ts +++ b/tests/cases/conformance/node/nodeModulesPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 e4ff6bba86428..4e0e34587aa35 100644 --- a/tests/cases/conformance/node/nodeModulesPackageImports.ts +++ b/tests/cases/conformance/node/nodeModulesPackageImports.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 4a4af53809a92..66cc8dcb5076a 100644 --- a/tests/cases/conformance/node/nodeModulesPackagePatternExports.ts +++ b/tests/cases/conformance/node/nodeModulesPackagePatternExports.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 a12b1dab20dc0..0704894872974 100644 --- a/tests/cases/conformance/node/nodeModulesPackagePatternExportsExclude.ts +++ b/tests/cases/conformance/node/nodeModulesPackagePatternExportsExclude.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 59fe617e4c312..e367cc8e25d96 100644 --- a/tests/cases/conformance/node/nodeModulesPackagePatternExportsTrailers.ts +++ b/tests/cases/conformance/node/nodeModulesPackagePatternExportsTrailers.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 c9d8204623642..566b36a8be0a6 100644 --- a/tests/cases/conformance/node/nodeModulesResolveJsonModule.ts +++ b/tests/cases/conformance/node/nodeModulesResolveJsonModule.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,nodenext // @resolveJsonModule: true // @outDir: ./out // @declaration: true diff --git a/tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts b/tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts index 203760b4e5d1a..5894ec9fa5993 100644 --- a/tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts +++ b/tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 0e532ced3bac6..1e408948ca25d 100644 --- a/tests/cases/conformance/node/nodeModulesTopLevelAwait.ts +++ b/tests/cases/conformance/node/nodeModulesTopLevelAwait.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 023aeb10babd6..720b542cdf57c 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit1.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 3760a6b3796bc..26fb155089585 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit2.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit2.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 6e86a567a469d..e495af61693e2 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit3.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit3.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 02e104118c14c..206b8ac8971b2 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit4.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit4.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 c2aa67228d4a6..146966b663e8f 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit5.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit5.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 91cba073a931a..a7bfaee6077cc 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit6.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit6.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 c48ad0128f162..9021d10b2cf46 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit7.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit7.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 c488964766d47..06176bf7496e0 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride1.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 79eeba94abf00..638148fccaf2e 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride2.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride2.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 74a9d2fffe59a..07c712e255ada 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 26bc3c8f393c8..d7b0d88c26dab 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride4.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride4.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 2174f95923752..993f10822bd21 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride5.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride5.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 84828c5dabb8e..87a671e2e11ae 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverrideModeError.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverrideModeError.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node16,nodenext +// @module: node16,node18,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 1cdaef53f2462..f562c69ba0681 100644 --- a/tests/cases/conformance/node/nodeModulesTypesVersionPackageExports.ts +++ b/tests/cases/conformance/node/nodeModulesTypesVersionPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 ec9dd150591ea..344f1eef2dc2f 100644 --- a/tests/cases/conformance/node/nodePackageSelfName.ts +++ b/tests/cases/conformance/node/nodePackageSelfName.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,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 9e9eef3849610..4a9e534e2ef31 100644 --- a/tests/cases/conformance/node/nodePackageSelfNameScoped.ts +++ b/tests/cases/conformance/node/nodePackageSelfNameScoped.ts @@ -1,4 +1,4 @@ -// @module: node16,nodenext +// @module: node16,node18,nodenext // @declaration: true // @filename: index.ts // esm format file From ed1f2ccfa86f1439ed87d2a93a700cc2eb1c93ee Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Mon, 16 Dec 2024 14:57:13 -0800 Subject: [PATCH 24/46] Point TypeScript-Twoslash-Repro-Action back to main branch (#60779) --- .github/workflows/twoslash-repros.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/twoslash-repros.yaml b/.github/workflows/twoslash-repros.yaml index 08a9e42e3dd14..2a50aadcf14b5 100644 --- a/.github/workflows/twoslash-repros.yaml +++ b/.github/workflows/twoslash-repros.yaml @@ -58,7 +58,7 @@ jobs: - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 'lts/*' - - uses: microsoft/TypeScript-Twoslash-Repro-Action@8680b5b290d48a7badbc7ba65971d526c61b86b8 # master + - uses: microsoft/TypeScript-Twoslash-Repro-Action@master with: github-token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} issue: ${{ github.event.inputs.issue }} From ac2cfccd64d5f4a860b7c24335679da9c04bf525 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Mon, 16 Dec 2024 14:57:33 -0800 Subject: [PATCH 25/46] Use macos-latest in CI (#60780) --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 755827e99b29b..bf4169e329aff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: os: - ubuntu-latest - windows-latest - - macos-14 + - macos-latest node-version: - '22' - '20' @@ -43,7 +43,7 @@ jobs: exclude: # No Node 14 on ARM macOS - node-version: '14' - os: macos-14 + os: macos-latest runs-on: ${{ matrix.os }} name: Test Node ${{ matrix.node-version }} on ${{ matrix.os }}${{ (!matrix.bundle && ' with --no-bundle') || '' }} From 7be4b2c6977c9d81006ac1fe080321247d025371 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 17 Dec 2024 12:56:20 -0800 Subject: [PATCH 26/46] Harden `sanitizeLog` against incorrect matches on TypeScript versions. (#60794) Co-authored-by: Andrew Branch --- src/harness/tsserverLogger.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/harness/tsserverLogger.ts b/src/harness/tsserverLogger.ts index 1ac20125b8df0..5eceaff711711 100644 --- a/src/harness/tsserverLogger.ts +++ b/src/harness/tsserverLogger.ts @@ -111,7 +111,7 @@ export function sanitizeLog(s: string): string { s = s.replace(/Elapsed::?\s*\d+(?:\.\d+)?ms/g, "Elapsed:: *ms"); s = s.replace(/"updateGraphDurationMs":\s*\d+(?:\.\d+)?/g, `"updateGraphDurationMs": *`); s = s.replace(/"createAutoImportProviderProgramDurationMs":\s*\d+(?:\.\d+)?/g, `"createAutoImportProviderProgramDurationMs": *`); - s = replaceAll(s, ts.version, "FakeVersion"); + s = s.replace(new RegExp(`\\b${ts.regExpEscape(ts.version)}\\b`, "g"), "FakeVersion"); s = s.replace(/getCompletionData: Get current token: \d+(?:\.\d+)?/g, `getCompletionData: Get current token: *`); s = s.replace(/getCompletionData: Is inside comment: \d+(?:\.\d+)?/g, `getCompletionData: Is inside comment: *`); s = s.replace(/getCompletionData: Get previous token: \d+(?:\.\d+)?/g, `getCompletionData: Get previous token: *`); @@ -130,7 +130,8 @@ export function sanitizeLog(s: string): string { s = s.replace(/"semanticDiag":\s*\d+(?:.\d+)?/g, `"semanticDiag": *`); s = s.replace(/"suggestionDiag":\s*\d+(?:.\d+)?/g, `"suggestionDiag": *`); s = s.replace(/"regionSemanticDiag":\s*\d+(?:.\d+)?/g, `"regionSemanticDiag": *`); - s = replaceAll(s, `@ts${ts.versionMajorMinor}`, `@tsFakeMajor.Minor`); + s = s.replace(new RegExp(`\\b@ts${ts.regExpEscape(ts.versionMajorMinor)}\\b`, "g"), `@tsFakeMajor.Minor`); + s = sanitizeHarnessLSException(s); return s; } From e1db57d83c97b2046ebd47dfcf9bc6b892f4207e Mon Sep 17 00:00:00 2001 From: "CSIGS@microsoft.com" Date: Tue, 17 Dec 2024 13:27:17 -0800 Subject: [PATCH 27/46] LEGO: Pull request from lego/hb_5378966c-b857-470a-8675-daebef4a6da1_20241217202808030 to main (#60797) --- .../diagnosticMessages/diagnosticMessages.generated.json.lcl | 3 +++ .../diagnosticMessages/diagnosticMessages.generated.json.lcl | 3 +++ .../diagnosticMessages/diagnosticMessages.generated.json.lcl | 3 +++ .../diagnosticMessages/diagnosticMessages.generated.json.lcl | 3 +++ 4 files changed, 12 insertions(+) diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl index b6846c4aaf886..692ffb1f4d55c 100644 --- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15363,6 +15363,9 @@ + + + diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl index 49eab76d3b49b..01dc6066a97aa 100644 --- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15363,6 +15363,9 @@ + + + diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 1a1e4c36f5066..1e97161836c92 100644 --- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15350,6 +15350,9 @@ + + + diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl index 697986a726e03..cc93b6cf76364 100644 --- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -15353,6 +15353,9 @@ + + + From c8af21b4fb6cf5b08cedab6beb69b7c89767cc09 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 17 Dec 2024 17:45:48 -0800 Subject: [PATCH 28/46] Add tests for `getNormalizedAbsolutePath`. (#60802) --- src/testRunner/unittests/paths.ts | 104 ++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/src/testRunner/unittests/paths.ts b/src/testRunner/unittests/paths.ts index 56a49f57f392a..e76bdc7cd26de 100644 --- a/src/testRunner/unittests/paths.ts +++ b/src/testRunner/unittests/paths.ts @@ -269,6 +269,110 @@ describe("unittests:: core paths", () => { assert.strictEqual(ts.resolvePath("a", "b", "/c"), "/c"); assert.strictEqual(ts.resolvePath("a", "b", "../c"), "a/c"); }); + it("getNormalizedAbsolutePath", () => { + assert.strictEqual(ts.getNormalizedAbsolutePath("/", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/.", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/./", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/../", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a", ""), "/a"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/", ""), "/a"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/.", ""), "/a"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/foo.", ""), "/a/foo."); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/./", ""), "/a"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/./b", ""), "/a/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/./b/", ""), "/a/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/..", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/../", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/../", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/../b", ""), "/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/../b/", ""), "/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/..", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/..", "/"), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/..", "b/"), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/..", "/b"), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/.", "b"), "/a"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/.", "."), "/a"); + + // Tests as above, but with backslashes. + assert.strictEqual(ts.getNormalizedAbsolutePath("\\", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\.", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\.\\", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\..\\", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\.\\", ""), "/a"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\.\\b", ""), "/a/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\.\\b\\", ""), "/a/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\..", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\..\\", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\..\\", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\..\\b", ""), "/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\..\\b\\", ""), "/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\..", ""), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\..", "\\"), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\..", "b\\"), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\..", "\\b"), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\.", "b"), "/a"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\.", "."), "/a"); + + // Relative paths on an empty currentDirectory. + assert.strictEqual(ts.getNormalizedAbsolutePath("", ""), ""); + assert.strictEqual(ts.getNormalizedAbsolutePath(".", ""), ""); + assert.strictEqual(ts.getNormalizedAbsolutePath("./", ""), ""); + // Strangely, these do not normalize to the empty string. + assert.strictEqual(ts.getNormalizedAbsolutePath("..", ""), ".."); + assert.strictEqual(ts.getNormalizedAbsolutePath("../", ""), ".."); + + // Interaction between relative paths and currentDirectory. + assert.strictEqual(ts.getNormalizedAbsolutePath("", "/home"), "/home"); + assert.strictEqual(ts.getNormalizedAbsolutePath(".", "/home"), "/home"); + assert.strictEqual(ts.getNormalizedAbsolutePath("./", "/home"), "/home"); + assert.strictEqual(ts.getNormalizedAbsolutePath("..", "/home"), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("../", "/home"), "/"); + assert.strictEqual(ts.getNormalizedAbsolutePath("a", "b"), "b/a"); + assert.strictEqual(ts.getNormalizedAbsolutePath("a", "b/c"), "b/c/a"); + + // Base names starting or ending with a dot do not affect normalization. + assert.strictEqual(ts.getNormalizedAbsolutePath(".a", ""), ".a"); + assert.strictEqual(ts.getNormalizedAbsolutePath("..a", ""), "..a"); + assert.strictEqual(ts.getNormalizedAbsolutePath("a.", ""), "a."); + assert.strictEqual(ts.getNormalizedAbsolutePath("a..", ""), "a.."); + + assert.strictEqual(ts.getNormalizedAbsolutePath("/base/./.a", ""), "/base/.a"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/base/../.a", ""), "/.a"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/base/./..a", ""), "/base/..a"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/base/../..a", ""), "/..a"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/base/./..a/b", ""), "/base/..a/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/base/../..a/b", ""), "/..a/b"); + + assert.strictEqual(ts.getNormalizedAbsolutePath("/base/./a.", ""), "/base/a."); + assert.strictEqual(ts.getNormalizedAbsolutePath("/base/../a.", ""), "/a."); + assert.strictEqual(ts.getNormalizedAbsolutePath("/base/./a..", ""), "/base/a.."); + assert.strictEqual(ts.getNormalizedAbsolutePath("/base/../a..", ""), "/a.."); + assert.strictEqual(ts.getNormalizedAbsolutePath("/base/./a../b", ""), "/base/a../b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/base/../a../b", ""), "/a../b"); + + // Consecutive intermediate slashes are normalized to a single slash. + assert.strictEqual(ts.getNormalizedAbsolutePath("a//b", ""), "a/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("a///b", ""), "a/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("a/b//c", ""), "a/b/c"); + assert.strictEqual(ts.getNormalizedAbsolutePath("/a/b//c", ""), "/a/b/c"); + assert.strictEqual(ts.getNormalizedAbsolutePath("//a/b//c", ""), "//a/b/c"); + + // Backslashes are converted to slashes, + // and then consecutive intermediate slashes are normalized to a single slash + assert.strictEqual(ts.getNormalizedAbsolutePath("a\\\\b", ""), "a/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("a\\\\\\b", ""), "a/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("a\\b\\\\c", ""), "a/b/c"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\b\\\\c", ""), "/a/b/c"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\\\a\\b\\\\c", ""), "//a/b/c"); + + // The same occurs for mixed slashes. + assert.strictEqual(ts.getNormalizedAbsolutePath("a/\\b", ""), "a/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("a\\/b", ""), "a/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("a\\/\\b", ""), "a/b"); + assert.strictEqual(ts.getNormalizedAbsolutePath("a\\b//c", ""), "a/b/c"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\a\\b\\\\c", ""), "/a/b/c"); + assert.strictEqual(ts.getNormalizedAbsolutePath("\\\\a\\b\\\\c", ""), "//a/b/c"); + }); it("getPathRelativeTo", () => { assert.strictEqual(ts.getRelativePathFromDirectory("/", "/", /*ignoreCase*/ false), ""); assert.strictEqual(ts.getRelativePathFromDirectory("/a", "/a", /*ignoreCase*/ false), ""); From 52717acf8722ad153b3ee49cd59b7c95b0f4ee04 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:28:58 -0800 Subject: [PATCH 29/46] Update dependencies (#60781) --- .dprint.jsonc | 4 +- package-lock.json | 1928 ++++++++++++++++++++++++--------------------- package.json | 40 +- 3 files changed, 1055 insertions(+), 917 deletions(-) diff --git a/.dprint.jsonc b/.dprint.jsonc index 11eeed6f88b59..80387c67b0d79 100644 --- a/.dprint.jsonc +++ b/.dprint.jsonc @@ -53,8 +53,8 @@ // Note: if adding new languages, make sure settings.template.json is updated too. // Also, if updating typescript, update the one in package.json. "plugins": [ - "https://plugins.dprint.dev/typescript-0.93.0.wasm", - "https://plugins.dprint.dev/json-0.19.3.wasm", + "https://plugins.dprint.dev/typescript-0.93.3.wasm", + "https://plugins.dprint.dev/json-0.19.4.wasm", "https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm" ] } diff --git a/package-lock.json b/package-lock.json index b089dc3b035a7..40e69852eb561 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,48 +14,48 @@ }, "devDependencies": { "@dprint/formatter": "^0.4.1", - "@dprint/typescript": "0.93.0", + "@dprint/typescript": "0.93.3", "@esfx/canceltoken": "^1.0.0", - "@eslint/js": "^9.11.1", + "@eslint/js": "^9.17.0", "@octokit/rest": "^21.0.2", "@types/chai": "^4.3.20", - "@types/diff": "^5.2.2", + "@types/diff": "^5.2.3", "@types/minimist": "^1.2.5", - "@types/mocha": "^10.0.8", + "@types/mocha": "^10.0.10", "@types/ms": "^0.7.34", "@types/node": "latest", "@types/source-map-support": "^0.5.10", "@types/which": "^3.0.4", - "@typescript-eslint/rule-tester": "^8.8.0", - "@typescript-eslint/type-utils": "^8.8.0", - "@typescript-eslint/utils": "^8.8.0", + "@typescript-eslint/rule-tester": "^8.18.1", + "@typescript-eslint/type-utils": "^8.18.1", + "@typescript-eslint/utils": "^8.18.1", "azure-devops-node-api": "^14.1.0", - "c8": "^10.1.2", + "c8": "^10.1.3", "chai": "^4.5.0", "chalk": "^4.1.2", "chokidar": "^3.6.0", "diff": "^5.2.0", - "dprint": "^0.47.2", + "dprint": "^0.47.6", "esbuild": "^0.24.0", - "eslint": "^9.11.1", + "eslint": "^9.17.0", "eslint-formatter-autolinkable-stylish": "^1.4.0", - "eslint-plugin-regexp": "^2.6.0", - "fast-xml-parser": "^4.5.0", + "eslint-plugin-regexp": "^2.7.0", + "fast-xml-parser": "^4.5.1", "glob": "^10.4.5", - "globals": "^15.9.0", + "globals": "^15.13.0", "hereby": "^1.10.0", "jsonc-parser": "^3.3.1", - "knip": "^5.30.6", + "knip": "^5.41.0", "minimist": "^1.2.8", - "mocha": "^10.7.3", + "mocha": "^10.8.2", "mocha-fivemat-progress-reporter": "^0.1.0", - "monocart-coverage-reports": "^2.11.0", + "monocart-coverage-reports": "^2.11.4", "ms": "^2.1.3", - "playwright": "^1.47.2", + "playwright": "^1.49.1", "source-map-support": "^0.5.21", - "tslib": "^2.7.0", - "typescript": "^5.6.2", - "typescript-eslint": "^8.8.0", + "tslib": "^2.8.1", + "typescript": "^5.7.2", + "typescript-eslint": "^8.18.1", "which": "^3.0.1" }, "engines": { @@ -63,15 +63,18 @@ } }, "node_modules/@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-1.0.1.tgz", + "integrity": "sha512-W+a0/JpU28AqH4IKtwUPcEUnUyXMDLALcn5/JLczGGT9fHE2sIby/xP/oQnx3nxkForzgzPy201RAKcB4xPAFQ==", + "dev": true, + "engines": { + "node": ">=18" + } }, "node_modules/@dprint/darwin-arm64": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/darwin-arm64/-/darwin-arm64-0.47.2.tgz", - "integrity": "sha512-mVPFBJsXxGDKHHCAY8wbqOyS4028g1bN15H9tivCnPAjwaZhkUimZHXWejXADjhGn+Xm2SlakugY9PY/68pH3Q==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/darwin-arm64/-/darwin-arm64-0.47.6.tgz", + "integrity": "sha512-DrtKVOH7Ue6QYsqsUfUwBlTkSZNF2j35xqyI6KimUT1ulgUPocLG53JC/Aej9KuSCPmt4M3J40xxPKRgIM4jPA==", "cpu": [ "arm64" ], @@ -82,9 +85,9 @@ ] }, "node_modules/@dprint/darwin-x64": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/darwin-x64/-/darwin-x64-0.47.2.tgz", - "integrity": "sha512-T7wzlc+rBV+6BRRiBjoqoy5Hj4TR2Nv2p2s9+ycyPGs10Kj/JXOWD8dnEHeBgUr2r4qe/ZdcxmsFQ5Hf2n0WuA==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/darwin-x64/-/darwin-x64-0.47.6.tgz", + "integrity": "sha512-p16a4lMbAo4RngbNTAmtREnIRI/cOcZFy5wHPIzbCDnnHI+4UyHiAypTrpF8U8EYx1tw3hgih2MyAuupa9Gfag==", "cpu": [ "x64" ], @@ -101,9 +104,9 @@ "dev": true }, "node_modules/@dprint/linux-arm64-glibc": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/linux-arm64-glibc/-/linux-arm64-glibc-0.47.2.tgz", - "integrity": "sha512-B0m1vT5LdVtrNOVdkqpLPrSxuCD+l5bTIgRzPaDoIB1ChWQkler9IlX8C+RStpujjPj6SYvwo5vTzjQSvRdQkA==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/linux-arm64-glibc/-/linux-arm64-glibc-0.47.6.tgz", + "integrity": "sha512-WHphnk0oXpNzwJ9cjbddOL+hEZkXTvHxcA2pM1h1kWCBa5m+4qh0fg8YCktckMfHx1qdQuZYWRoT4l7yQbzWYA==", "cpu": [ "arm64" ], @@ -114,9 +117,9 @@ ] }, "node_modules/@dprint/linux-arm64-musl": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/linux-arm64-musl/-/linux-arm64-musl-0.47.2.tgz", - "integrity": "sha512-zID6wZZqpg2/Q2Us+ERQkbhLwlW3p3xaeEr00MPf49bpydmEjMiPuSjWPkNv+slQSIyIsVovOxF4lbNZjsdtvw==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/linux-arm64-musl/-/linux-arm64-musl-0.47.6.tgz", + "integrity": "sha512-/2cSPudajg8J0U69ldNZkJx5QiKZNh+ohNVM9leWZ8v6GXN6sJDHX3T6hzS3ohIb03YOCiLOrJZDy9j3+fSgdQ==", "cpu": [ "arm64" ], @@ -126,10 +129,23 @@ "linux" ] }, + "node_modules/@dprint/linux-riscv64-glibc": { + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/linux-riscv64-glibc/-/linux-riscv64-glibc-0.47.6.tgz", + "integrity": "sha512-RMHJ3Zuzpls426upHlAveVwlGMi8oBLzhiCauyC/yWQl3CkGTAYdyhEpGnux0+RxacysfIL2bd8ourx4K0Sx3w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@dprint/linux-x64-glibc": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/linux-x64-glibc/-/linux-x64-glibc-0.47.2.tgz", - "integrity": "sha512-rB3WXMdINnRd33DItIp7mObS7dzHW90ZzeJSsoKJLPp+Z7wXjjb27UUowfqVI4baa/1pd7sdbX54DPohMtfu/A==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/linux-x64-glibc/-/linux-x64-glibc-0.47.6.tgz", + "integrity": "sha512-4zbVsx/a8lHkRyAjfW0PNlN5IMwOJfFapgXNYJowWNO7X3j3m1jYJWovjmdZls+d6pDeOHoanMWtq95wd7zTeQ==", "cpu": [ "x64" ], @@ -140,9 +156,9 @@ ] }, "node_modules/@dprint/linux-x64-musl": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/linux-x64-musl/-/linux-x64-musl-0.47.2.tgz", - "integrity": "sha512-E0+TNbzYdTXJ/jCVjUctVxkda/faw++aDQLfyWGcmdMJnbM7NZz+W4fUpDXzMPsjy+zTWxXcPK7/q2DZz2gnbg==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/linux-x64-musl/-/linux-x64-musl-0.47.6.tgz", + "integrity": "sha512-0C13t4OVzomgQjvUyD5IrRyjLDhGuOtqMo00uJlwn3QHucfgOBqkjyQ5fq7T6+grBse0m14/EWblvSbYkZpyDw==", "cpu": [ "x64" ], @@ -153,15 +169,15 @@ ] }, "node_modules/@dprint/typescript": { - "version": "0.93.0", - "resolved": "https://registry.npmjs.org/@dprint/typescript/-/typescript-0.93.0.tgz", - "integrity": "sha512-FxzxkheBbQnp7dHZJzkn4RwkP3keG/mvz0jyAGzEQ3P7Wl+ELSA8O2aZ6UJGmErOtP7lA8PbIbwMSu6VSBLSXw==", + "version": "0.93.3", + "resolved": "https://registry.npmjs.org/@dprint/typescript/-/typescript-0.93.3.tgz", + "integrity": "sha512-P/AAHYDyUG+5hih8knuk3s9n2wrCD1LSh0YsLlJMx6+v0Wsjf0PpcVRn+xDvHCtwPUctB5WBkZT2U8mu6Cm7RQ==", "dev": true }, "node_modules/@dprint/win32-arm64": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/win32-arm64/-/win32-arm64-0.47.2.tgz", - "integrity": "sha512-K1EieTCFjfOCmyIhw9zFSduE6qVCNHEveupqZEfbSkVGw5T9MJQ1I9+n7MDb3RIDYEUk0enJ58/w82q8oDKCyA==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/win32-arm64/-/win32-arm64-0.47.6.tgz", + "integrity": "sha512-UOkeFMBdGIuGNwfkrJdVM9eNiRMdbZRRGVy0Cdo2AXn/FCDVqZ74KJkvYVcoUE27GCytHi4Sp1s4at7659WCOw==", "cpu": [ "arm64" ], @@ -172,9 +188,9 @@ ] }, "node_modules/@dprint/win32-x64": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/win32-x64/-/win32-x64-0.47.2.tgz", - "integrity": "sha512-LhizWr8VrhHvq4ump8HwOERyFmdLiE8C6A42QSntGXzKdaa2nEOq20x/o56ZIiDcesiV+1TmosMKimPcOZHa+Q==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/win32-x64/-/win32-x64-0.47.6.tgz", + "integrity": "sha512-i9xwXR8V8Jk/wU1gsYKx15eb0ypBRbRZFkHsnHfC0ZBimcfEOibGnGcfv+UCUcumXtnV46TnBqaJW7H70J1J+A==", "cpu": [ "x64" ], @@ -595,36 +611,39 @@ "dev": true }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "node_modules/@eslint-community/regexpp": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", - "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/config-array": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", - "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.1.tgz", + "integrity": "sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==", "dev": true, "dependencies": { - "@eslint/object-schema": "^2.1.4", + "@eslint/object-schema": "^2.1.5", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -655,18 +674,21 @@ } }, "node_modules/@eslint/core": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.6.0.tgz", - "integrity": "sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.1.tgz", + "integrity": "sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q==", "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.15" + }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/eslintrc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -721,27 +743,27 @@ } }, "node_modules/@eslint/js": { - "version": "9.11.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.11.1.tgz", - "integrity": "sha512-/qu+TWz8WwPWc7/HcIJKi+c+MOm46GdVaSlTTQcaqaL53+GsoA6MxWp5PtTx48qbSP7ylM1Kn7nhvkugfJvRSA==", + "version": "9.17.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.17.0.tgz", + "integrity": "sha512-Sxc4hqcs1kTu0iID3kcZDW3JHq2a77HO9P8CP6YEA/FpH3Ll8UXE2r/86Rz9YJLKme39S9vU5OWNjC6Xl0Cr3w==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/object-schema": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", - "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.5.tgz", + "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.0.tgz", - "integrity": "sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.4.tgz", + "integrity": "sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==", "dev": true, "dependencies": { "levn": "^0.4.1" @@ -750,6 +772,41 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -764,9 +821,9 @@ } }, "node_modules/@humanwhocodes/retry": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", - "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", "dev": true, "engines": { "node": ">=18.18" @@ -793,33 +850,6 @@ "node": ">=12" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", @@ -950,12 +980,12 @@ "dev": true }, "node_modules/@octokit/plugin-paginate-rest": { - "version": "11.3.5", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.3.5.tgz", - "integrity": "sha512-cgwIRtKrpwhLoBi0CUNuY83DPGRMaWVjqVI/bGKsLJ4PzyWZNaEmhHroI2xlrVXkk6nFv0IsZpOp+ZWSWUS2AQ==", + "version": "11.3.6", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.3.6.tgz", + "integrity": "sha512-zcvqqf/+TicbTCa/Z+3w4eBJcAxCFymtc0UAIsR3dEVoNilWld4oXdscQ3laXamTszUZdusw97K8+DrbFiOwjw==", "dev": true, "dependencies": { - "@octokit/types": "^13.6.0" + "@octokit/types": "^13.6.2" }, "engines": { "node": ">= 18" @@ -977,12 +1007,12 @@ } }, "node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "13.2.5", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-13.2.5.tgz", - "integrity": "sha512-c4pRWi7OUSFM4E6frfUs+qsAf052aOWt1x2qFQ6llQcd1J0HqQ/0Egfs2lm33IixXeXXhZ+GmC9tf92qbOs25Q==", + "version": "13.2.6", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-13.2.6.tgz", + "integrity": "sha512-wMsdyHMjSfKjGINkdGKki06VEkgdEldIGstIEyGX0wbYHGByOwN/KiM+hAAlUwAtPkP3gvXtVQA9L3ITdV2tVw==", "dev": true, "dependencies": { - "@octokit/types": "^13.6.0" + "@octokit/types": "^13.6.1" }, "engines": { "node": ">= 18" @@ -1034,9 +1064,9 @@ } }, "node_modules/@octokit/types": { - "version": "13.6.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.6.0.tgz", - "integrity": "sha512-CrooV/vKCXqwLa+osmHLIMUb87brpgUqlqkPGc6iE2wCkUvTrHiXFMhAKoDDaAAYJrtKtrFTgSQTg5nObBEaew==", + "version": "13.6.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.6.2.tgz", + "integrity": "sha512-WpbZfZUcZU77DrSW4wbsSgTPfKcp286q3ItaIgvSbBpZJlu6mnYXAkjZz6LVZPXkEvLIM8McanyZejKTYUHipA==", "dev": true, "dependencies": { "@octokit/openapi-types": "^22.2.0" @@ -1076,9 +1106,9 @@ "dev": true }, "node_modules/@types/diff": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/@types/diff/-/diff-5.2.2.tgz", - "integrity": "sha512-qVqLpd49rmJA2nZzLVsmfS/aiiBpfVE95dHhPVwG0NmSBAt+riPxnj53wq2oBq5m4Q2RF1IWFEUpnZTgrQZfEQ==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/diff/-/diff-5.2.3.tgz", + "integrity": "sha512-K0Oqlrq3kQMaO2RhfrNQX5trmt+XLyom88zS0u84nnIcLvFnRUMRRHmrGny5GSM+kNO9IZLARsdQHDzkhAgmrQ==", "dev": true }, "node_modules/@types/estree": { @@ -1106,9 +1136,9 @@ "dev": true }, "node_modules/@types/mocha": { - "version": "10.0.8", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.8.tgz", - "integrity": "sha512-HfMcUmy9hTMJh66VNcmeC9iVErIZJli2bszuXc6julh5YGuRb/W5OnkHjwLNYdFlMis0sY3If5SEAp+PktdJjw==", + "version": "10.0.10", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", "dev": true }, "node_modules/@types/ms": { @@ -1118,12 +1148,12 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.7.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz", - "integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==", + "version": "22.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz", + "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", "dev": true, "dependencies": { - "undici-types": "~6.19.2" + "undici-types": "~6.20.0" } }, "node_modules/@types/source-map-support": { @@ -1142,16 +1172,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.8.0.tgz", - "integrity": "sha512-wORFWjU30B2WJ/aXBfOm1LX9v9nyt9D3jsSOxC3cCaTQGCW5k4jNpmjFv3U7p/7s4yvdjHzwtv2Sd2dOyhjS0A==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.1.tgz", + "integrity": "sha512-Ncvsq5CT3Gvh+uJG0Lwlho6suwDfUXH0HztslDf5I+F2wAFAZMRwYLEorumpKLzmO2suAXZ/td1tBg4NZIi9CQ==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.8.0", - "@typescript-eslint/type-utils": "8.8.0", - "@typescript-eslint/utils": "8.8.0", - "@typescript-eslint/visitor-keys": "8.8.0", + "@typescript-eslint/scope-manager": "8.18.1", + "@typescript-eslint/type-utils": "8.18.1", + "@typescript-eslint/utils": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1166,24 +1196,20 @@ }, "peerDependencies": { "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.8.0.tgz", - "integrity": "sha512-uEFUsgR+tl8GmzmLjRqz+VrDv4eoaMqMXW7ruXfgThaAShO9JTciKpEsB+TvnfFfbg5IpujgMXVV36gOJRLtZg==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.1.tgz", + "integrity": "sha512-rBnTWHCdbYM2lh7hjyXqxk70wvon3p2FyaniZuey5TrcGBpfhVp0OxOa6gxr9Q9YhZFKyfbEnxc24ZnVbbUkCA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.8.0", - "@typescript-eslint/types": "8.8.0", - "@typescript-eslint/typescript-estree": "8.8.0", - "@typescript-eslint/visitor-keys": "8.8.0", + "@typescript-eslint/scope-manager": "8.18.1", + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/typescript-estree": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1", "debug": "^4.3.4" }, "engines": { @@ -1194,22 +1220,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/rule-tester": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-8.8.0.tgz", - "integrity": "sha512-Mz41m89RzbOQfdsQ5lYV7gYghL4yumlULV/VBsKSkhZwYckKfNYD/MgkBBMHCTwtFpcPQKUhxHF5q6feyXAKfQ==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-8.18.1.tgz", + "integrity": "sha512-Ri73SSfOfd+aESELU2k0ikpIahTSY1VVsGiFWarDy54HSuMMZc/2JCST0dfpRep3egAvcI5/lcQvRHmSyzcA4g==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.8.0", - "@typescript-eslint/utils": "8.8.0", + "@typescript-eslint/typescript-estree": "8.18.1", + "@typescript-eslint/utils": "8.18.1", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", @@ -1227,13 +1249,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.0.tgz", - "integrity": "sha512-EL8eaGC6gx3jDd8GwEFEV091210U97J0jeEHrAYvIYosmEGet4wJ+g0SYmLu+oRiAwbSA5AVrt6DxLHfdd+bUg==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.1.tgz", + "integrity": "sha512-HxfHo2b090M5s2+/9Z3gkBhI6xBH8OJCFjH9MhQ+nnoZqxU3wNxkLT+VWXWSFWc3UF3Z+CfPAyqdCTdoXtDPCQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.8.0", - "@typescript-eslint/visitor-keys": "8.8.0" + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1244,13 +1266,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.8.0.tgz", - "integrity": "sha512-IKwJSS7bCqyCeG4NVGxnOP6lLT9Okc3Zj8hLO96bpMkJab+10HIfJbMouLrlpyOr3yrQ1cA413YPFiGd1mW9/Q==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.1.tgz", + "integrity": "sha512-jAhTdK/Qx2NJPNOTxXpMwlOiSymtR2j283TtPqXkKBdH8OAMmhiUfP0kJjc/qSE51Xrq02Gj9NY7MwK+UxVwHQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.8.0", - "@typescript-eslint/utils": "8.8.0", + "@typescript-eslint/typescript-estree": "8.18.1", + "@typescript-eslint/utils": "8.18.1", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1261,16 +1283,15 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/types": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.0.tgz", - "integrity": "sha512-QJwc50hRCgBd/k12sTykOJbESe1RrzmX6COk8Y525C9l7oweZ+1lw9JiU56im7Amm8swlz00DRIlxMYLizr2Vw==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.1.tgz", + "integrity": "sha512-7uoAUsCj66qdNQNpH2G8MyTFlgerum8ubf21s3TSM3XmKXuIn+H2Sifh/ES2nPOPiYSRJWAk0fDkW0APBWcpfw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1281,13 +1302,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.0.tgz", - "integrity": "sha512-ZaMJwc/0ckLz5DaAZ+pNLmHv8AMVGtfWxZe/x2JVEkD5LnmhWiQMMcYT7IY7gkdJuzJ9P14fRy28lUrlDSWYdw==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.1.tgz", + "integrity": "sha512-z8U21WI5txzl2XYOW7i9hJhxoKKNG1kcU4RzyNvKrdZDmbjkmLBo8bgeiOJmA06kizLI76/CCBAAGlTlEeUfyg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.8.0", - "@typescript-eslint/visitor-keys": "8.8.0", + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1302,22 +1323,20 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/utils": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.8.0.tgz", - "integrity": "sha512-QE2MgfOTem00qrlPgyByaCHay9yb1+9BjnMFnSFkUKQfu7adBXDTnCAivURnuPPAG/qiB+kzKkZKmKfaMT0zVg==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.1.tgz", + "integrity": "sha512-8vikiIj2ebrC4WRdcAdDcmnu9Q/MXXwg+STf40BVfT8exDqBCUPdypvzcUPxEqRGKg9ALagZ0UWcYCtn+4W2iQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.8.0", - "@typescript-eslint/types": "8.8.0", - "@typescript-eslint/typescript-estree": "8.8.0" + "@typescript-eslint/scope-manager": "8.18.1", + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/typescript-estree": "8.18.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1327,17 +1346,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.0.tgz", - "integrity": "sha512-8mq51Lx6Hpmd7HnA2fcHQo3YgfX1qbccxQOgZcb4tvasu//zXRaA1j5ZRFeCw/VRAdFi4mRM9DnZw0Nu0Q2d1g==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.1.tgz", + "integrity": "sha512-Vj0WLm5/ZsD013YeUKn+K0y8p1M0jPpxOkKdbD1wB0ns53a5piVY02zjf072TblEweAbcYiFiPoSMF3kp+VhhQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.8.0", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.18.1", + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1347,10 +1367,22 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1562,12 +1594,12 @@ "dev": true }, "node_modules/c8": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.2.tgz", - "integrity": "sha512-Qr6rj76eSshu5CgRYvktW0uM0CFY0yi4Fd5D0duDXO6sYinyopmftUiJVuzBQxQcwQLor7JWDVRP+dUfCmzgJw==", + "version": "10.1.3", + "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.3.tgz", + "integrity": "sha512-LvcyrOAaOnrrlMpW22n690PUvxiq4Uf9WMhQwNJ9vgagkL/ph1+D4uvjvDA5XCbykrc0sx+ay6pVi9YZ1GnhyA==", "dev": true, "dependencies": { - "@bcoe/v8-coverage": "^0.2.3", + "@bcoe/v8-coverage": "^1.0.1", "@istanbuljs/schema": "^0.1.3", "find-up": "^5.0.0", "foreground-child": "^3.1.1", @@ -1594,17 +1626,27 @@ } } }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", "dev": true, "dependencies": { - "es-define-property": "^1.0.0", "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "dev": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -1747,6 +1789,18 @@ "node": ">=8" } }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/cliui/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -1915,9 +1969,9 @@ "dev": true }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "dependencies": { "path-key": "^3.1.0", @@ -1944,9 +1998,9 @@ } }, "node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "dependencies": { "ms": "^2.1.3" @@ -2012,23 +2066,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/des.js": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", @@ -2049,23 +2086,38 @@ } }, "node_modules/dprint": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/dprint/-/dprint-0.47.2.tgz", - "integrity": "sha512-geUcVIIrmLaY+YtuOl4gD7J/QCjsXZa5gUqre9sO6cgH0X/Fa9heBN3l/AWVII6rKPw45ATuCSDWz1pyO+HkPQ==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/dprint/-/dprint-0.47.6.tgz", + "integrity": "sha512-vCQC+IMHVZbISA5pxEj+yshQbozmQoVFA4lzcLlqJ8rzIAH8U+1DKvesN/2Uv3Bqz6rMW6W4WY7pYJQljmiZ8w==", "dev": true, "hasInstallScript": true, "bin": { "dprint": "bin.js" }, "optionalDependencies": { - "@dprint/darwin-arm64": "0.47.2", - "@dprint/darwin-x64": "0.47.2", - "@dprint/linux-arm64-glibc": "0.47.2", - "@dprint/linux-arm64-musl": "0.47.2", - "@dprint/linux-x64-glibc": "0.47.2", - "@dprint/linux-x64-musl": "0.47.2", - "@dprint/win32-arm64": "0.47.2", - "@dprint/win32-x64": "0.47.2" + "@dprint/darwin-arm64": "0.47.6", + "@dprint/darwin-x64": "0.47.6", + "@dprint/linux-arm64-glibc": "0.47.6", + "@dprint/linux-arm64-musl": "0.47.6", + "@dprint/linux-riscv64-glibc": "0.47.6", + "@dprint/linux-x64-glibc": "0.47.6", + "@dprint/linux-x64-musl": "0.47.6", + "@dprint/win32-arm64": "0.47.6", + "@dprint/win32-x64": "0.47.6" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/eastasianwidth": { @@ -2112,13 +2164,10 @@ } }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4" - }, "engines": { "node": ">= 0.4" } @@ -2132,6 +2181,18 @@ "node": ">= 0.4" } }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/esbuild": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", @@ -2193,31 +2254,31 @@ } }, "node_modules/eslint": { - "version": "9.11.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.11.1.tgz", - "integrity": "sha512-MobhYKIoAO1s1e4VUrgx1l1Sk2JBR/Gqjjgw8+mfgoLE2xwsHur4gdfTxyTgShrhvdVFTaJSgMiQBl1jv/AWxg==", + "version": "9.17.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.17.0.tgz", + "integrity": "sha512-evtlNcpJg+cZLcnVKwsai8fExnqjGPicK7gnUtlNuzu+Fv9bI0aLpND5T44VLQtoMEnI57LoXO9XAkIXwohKrA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.11.0", - "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.6.0", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.11.1", - "@eslint/plugin-kit": "^0.2.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.9.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.17.0", + "@eslint/plugin-kit": "^0.2.3", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.3.0", - "@nodelib/fs.walk": "^1.2.8", + "@humanwhocodes/retry": "^0.4.1", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.0.2", - "eslint-visitor-keys": "^4.0.0", - "espree": "^10.1.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -2227,14 +2288,11 @@ "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" @@ -2268,13 +2326,13 @@ } }, "node_modules/eslint-plugin-regexp": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-2.6.0.tgz", - "integrity": "sha512-FCL851+kislsTEQEMioAlpDuK5+E5vs0hi1bF8cFlPlHcEjeRhuAzEsGikXRreE+0j4WhW2uO54MqTjXtYOi3A==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-2.7.0.tgz", + "integrity": "sha512-U8oZI77SBtH8U3ulZ05iu0qEzIizyEDXd+BWHvyVxTOjGwcDcvy/kEpgFG4DYca2ByRLiVPFZ2GeH7j1pdvZTA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.9.1", + "@eslint-community/regexpp": "^4.11.0", "comment-parser": "^1.4.0", "jsdoc-type-pratt-parser": "^4.0.0", "refa": "^0.12.1", @@ -2289,9 +2347,9 @@ } }, "node_modules/eslint-scope": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.1.0.tgz", - "integrity": "sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", @@ -2327,9 +2385,9 @@ } }, "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2363,14 +2421,14 @@ } }, "node_modules/espree": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", - "integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, "dependencies": { - "acorn": "^8.12.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.1.0" + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2380,9 +2438,9 @@ } }, "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2468,9 +2526,9 @@ "dev": true }, "node_modules/fast-xml-parser": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.0.tgz", - "integrity": "sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.1.tgz", + "integrity": "sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w==", "dev": true, "funding": [ { @@ -2570,9 +2628,9 @@ } }, "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", "dev": true }, "node_modules/foreground-child": { @@ -2639,16 +2697,21 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", + "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", "dev": true, "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "dunder-proto": "^1.0.0", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -2690,9 +2753,9 @@ } }, "node_modules/globals": { - "version": "15.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.9.0.tgz", - "integrity": "sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==", + "version": "15.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.13.0.tgz", + "integrity": "sha512-49TewVEz0UxZjr1WYYsWpPrhyC/B/pA8Bq0fUmet2n+eR7yn0IvNzNaoBwnK6mdkzcN+se7Ez9zUgULTz2QH4g==", "dev": true, "engines": { "node": ">=18" @@ -2702,12 +2765,12 @@ } }, "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2734,34 +2797,10 @@ "node": ">=8" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, "engines": { "node": ">= 0.4" @@ -2936,15 +2975,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -3024,12 +3054,12 @@ } }, "node_modules/jiti": { - "version": "1.21.6", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.6.tgz", - "integrity": "sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.2.tgz", + "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==", "dev": true, "bin": { - "jiti": "bin/jiti.js" + "jiti": "lib/jiti-cli.mjs" } }, "node_modules/js-md4": { @@ -3093,9 +3123,9 @@ } }, "node_modules/knip": { - "version": "5.30.6", - "resolved": "https://registry.npmjs.org/knip/-/knip-5.30.6.tgz", - "integrity": "sha512-YkcnRVl0N99xZ7eaXE7KlH/4cPTCn6BGuk9KxINEdCMFN3yita2vGBizApy97ZOHgghy8tb589gQ3xvLMFIO4w==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/knip/-/knip-5.41.0.tgz", + "integrity": "sha512-W8omBs+jhC/P/A3kC0xdEGrhYVmsmWafUVz0wzQjYfoaK0YNEBPPLptUeqwQl6ihYVqzb/X0zs50gY9Akw1Bww==", "dev": true, "funding": [ { @@ -3117,13 +3147,13 @@ "easy-table": "1.2.0", "enhanced-resolve": "^5.17.1", "fast-glob": "^3.3.2", - "jiti": "^1.21.6", + "jiti": "^2.4.0", "js-yaml": "^4.1.0", "minimist": "^1.2.8", - "picocolors": "^1.0.0", + "picocolors": "^1.1.0", "picomatch": "^4.0.1", "pretty-ms": "^9.0.0", - "smol-toml": "^1.3.0", + "smol-toml": "^1.3.1", "strip-json-comments": "5.0.1", "summary": "2.1.0", "zod": "^3.22.4", @@ -3166,9 +3196,9 @@ } }, "node_modules/knip/node_modules/pretty-ms": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.1.0.tgz", - "integrity": "sha512-o1piW0n3tgKIKCwk2vpM/vOV13zjJzvP37Ioze54YlTHE06m4tjEbzg9WsKkvTuyYln2DHjo5pY4qrZGI0otpw==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.2.0.tgz", + "integrity": "sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==", "dev": true, "dependencies": { "parse-ms": "^4.0.0" @@ -3278,6 +3308,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/math-intrinsics": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.0.0.tgz", + "integrity": "sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -3340,9 +3379,9 @@ } }, "node_modules/mocha": { - "version": "10.7.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz", - "integrity": "sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==", + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", "dev": true, "dependencies": { "ansi-colors": "^4.1.3", @@ -3443,6 +3482,18 @@ "node": ">=8" } }, + "node_modules/mocha/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/mocha/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -3503,12 +3554,12 @@ } }, "node_modules/monocart-coverage-reports": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.11.0.tgz", - "integrity": "sha512-FueI32k3gheTVSv20MzpCyC6NynQOkq6e+81My8An+FiLCDQoqPt4Rzt3GOeWs6+i4FTKvsJAOf7IZu1a0KzPw==", + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.11.4.tgz", + "integrity": "sha512-hFhfhIzD7Yv1fNJgnUVvrEpnwqB44KwSGbghOM9C8AMIVon5ZLRlspbWz+uwW04Yhgvo5WmtPEmX+mnET2VcGA==", "dev": true, "dependencies": { - "acorn": "^8.12.1", + "acorn": "^8.14.0", "acorn-loose": "^8.4.0", "acorn-walk": "^8.3.4", "commander": "^12.1.0", @@ -3562,9 +3613,9 @@ } }, "node_modules/object-inspect": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", - "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", "dev": true, "engines": { "node": ">= 0.4" @@ -3718,9 +3769,9 @@ } }, "node_modules/picocolors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true }, "node_modules/picomatch": { @@ -3736,12 +3787,12 @@ } }, "node_modules/playwright": { - "version": "1.47.2", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.2.tgz", - "integrity": "sha512-nx1cLMmQWqmA3UsnjaaokyoUpdVaaDhJhMoxX2qj3McpjnsqFHs516QAKYhqHAgOP+oCFTEOCOAaD1RgD/RQfA==", + "version": "1.49.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.1.tgz", + "integrity": "sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==", "dev": true, "dependencies": { - "playwright-core": "1.47.2" + "playwright-core": "1.49.1" }, "bin": { "playwright": "cli.js" @@ -3754,9 +3805,9 @@ } }, "node_modules/playwright-core": { - "version": "1.47.2", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.2.tgz", - "integrity": "sha512-3JvMfF+9LJfe16l7AbSmU555PaTl2tPyQsVInqm3id16pdDfvZ8TTZ/pyzmkbDrZTQefyzU7AIHlZqQnxpqHVQ==", + "version": "1.49.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.1.tgz", + "integrity": "sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -3828,9 +3879,9 @@ } }, "node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.1.tgz", + "integrity": "sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg==", "dev": true, "dependencies": { "side-channel": "^1.0.6" @@ -4023,23 +4074,6 @@ "randombytes": "^2.1.0" } }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -4062,15 +4096,16 @@ } }, "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "dev": true, "dependencies": { - "call-bind": "^1.0.7", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -4079,37 +4114,90 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, "engines": { - "node": ">=14" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/smol-toml": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.3.0.tgz", - "integrity": "sha512-tWpi2TsODPScmi48b/OQZGi2lgUmBCHy6SZrhi/FdnnHiU1GwebbCfuQuxsC3nHaLwtYeJGPrDZDIeodDOc4pA==", + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", "dev": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, "engines": { - "node": ">= 18" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/cyyynthia" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "dev": true, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/smol-toml": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.3.1.tgz", + "integrity": "sha512-tEYNll18pPKHroYSmLLrksq233j021G0giwW7P3D24jC54pQ5W5BXMsQ/Mvw1OJCmEYDgY+lrzT+3nNUtoNfXQ==", + "dev": true, + "engines": { + "node": ">= 18" + }, + "funding": { + "url": "https://github.com/sponsors/cyyynthia" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" } }, "node_modules/source-map-support": { @@ -4160,19 +4248,19 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "engines": { - "node": ">=12" + "dependencies": { + "ansi-regex": "^5.0.1" }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "engines": { + "node": ">=8" } }, - "node_modules/string-width/node_modules/strip-ansi": { + "node_modules/strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", @@ -4187,7 +4275,8 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/strip-ansi": { + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", @@ -4199,17 +4288,16 @@ "node": ">=8" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/strip-ansi/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/strip-json-comments": { @@ -4286,12 +4374,6 @@ "node": ">=18" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -4305,9 +4387,9 @@ } }, "node_modules/ts-api-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", - "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", "dev": true, "engines": { "node": ">=16" @@ -4317,9 +4399,9 @@ } }, "node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "dev": true }, "node_modules/tunnel": { @@ -4369,9 +4451,9 @@ } }, "node_modules/typescript": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", - "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -4382,14 +4464,14 @@ } }, "node_modules/typescript-eslint": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.8.0.tgz", - "integrity": "sha512-BjIT/VwJ8+0rVO01ZQ2ZVnjE1svFBiRczcpr1t1Yxt7sT25VSbPfrJtDsQ8uQTy2pilX5nI9gwxhUyLULNentw==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.18.1.tgz", + "integrity": "sha512-Mlaw6yxuaDEPQvb/2Qwu3/TfgeBHy9iTJ3mTwe7OvpPmF6KPQjVOfGyEJpPv6Ez2C34OODChhXrzYw/9phI0MQ==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.8.0", - "@typescript-eslint/parser": "8.8.0", - "@typescript-eslint/utils": "8.8.0" + "@typescript-eslint/eslint-plugin": "8.18.1", + "@typescript-eslint/parser": "8.18.1", + "@typescript-eslint/utils": "8.18.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4398,10 +4480,9 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/typical": { @@ -4420,9 +4501,9 @@ "dev": true }, "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true }, "node_modules/universal-user-agent": { @@ -4562,16 +4643,16 @@ "node": ">=8" } }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "engines": { - "node": ">=12" + "dependencies": { + "ansi-regex": "^5.0.1" }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "engines": { + "node": ">=8" } }, "node_modules/wrap-ansi/node_modules/ansi-styles": { @@ -4586,21 +4667,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -4678,6 +4744,18 @@ "node": ">=8" } }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -4691,9 +4769,9 @@ } }, "node_modules/zod": { - "version": "3.23.8", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", - "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "version": "3.24.1", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz", + "integrity": "sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==", "dev": true, "funding": { "url": "https://github.com/sponsors/colinhacks" @@ -4714,22 +4792,22 @@ }, "dependencies": { "@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-1.0.1.tgz", + "integrity": "sha512-W+a0/JpU28AqH4IKtwUPcEUnUyXMDLALcn5/JLczGGT9fHE2sIby/xP/oQnx3nxkForzgzPy201RAKcB4xPAFQ==", "dev": true }, "@dprint/darwin-arm64": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/darwin-arm64/-/darwin-arm64-0.47.2.tgz", - "integrity": "sha512-mVPFBJsXxGDKHHCAY8wbqOyS4028g1bN15H9tivCnPAjwaZhkUimZHXWejXADjhGn+Xm2SlakugY9PY/68pH3Q==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/darwin-arm64/-/darwin-arm64-0.47.6.tgz", + "integrity": "sha512-DrtKVOH7Ue6QYsqsUfUwBlTkSZNF2j35xqyI6KimUT1ulgUPocLG53JC/Aej9KuSCPmt4M3J40xxPKRgIM4jPA==", "dev": true, "optional": true }, "@dprint/darwin-x64": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/darwin-x64/-/darwin-x64-0.47.2.tgz", - "integrity": "sha512-T7wzlc+rBV+6BRRiBjoqoy5Hj4TR2Nv2p2s9+ycyPGs10Kj/JXOWD8dnEHeBgUr2r4qe/ZdcxmsFQ5Hf2n0WuA==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/darwin-x64/-/darwin-x64-0.47.6.tgz", + "integrity": "sha512-p16a4lMbAo4RngbNTAmtREnIRI/cOcZFy5wHPIzbCDnnHI+4UyHiAypTrpF8U8EYx1tw3hgih2MyAuupa9Gfag==", "dev": true, "optional": true }, @@ -4740,50 +4818,57 @@ "dev": true }, "@dprint/linux-arm64-glibc": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/linux-arm64-glibc/-/linux-arm64-glibc-0.47.2.tgz", - "integrity": "sha512-B0m1vT5LdVtrNOVdkqpLPrSxuCD+l5bTIgRzPaDoIB1ChWQkler9IlX8C+RStpujjPj6SYvwo5vTzjQSvRdQkA==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/linux-arm64-glibc/-/linux-arm64-glibc-0.47.6.tgz", + "integrity": "sha512-WHphnk0oXpNzwJ9cjbddOL+hEZkXTvHxcA2pM1h1kWCBa5m+4qh0fg8YCktckMfHx1qdQuZYWRoT4l7yQbzWYA==", "dev": true, "optional": true }, "@dprint/linux-arm64-musl": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/linux-arm64-musl/-/linux-arm64-musl-0.47.2.tgz", - "integrity": "sha512-zID6wZZqpg2/Q2Us+ERQkbhLwlW3p3xaeEr00MPf49bpydmEjMiPuSjWPkNv+slQSIyIsVovOxF4lbNZjsdtvw==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/linux-arm64-musl/-/linux-arm64-musl-0.47.6.tgz", + "integrity": "sha512-/2cSPudajg8J0U69ldNZkJx5QiKZNh+ohNVM9leWZ8v6GXN6sJDHX3T6hzS3ohIb03YOCiLOrJZDy9j3+fSgdQ==", + "dev": true, + "optional": true + }, + "@dprint/linux-riscv64-glibc": { + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/linux-riscv64-glibc/-/linux-riscv64-glibc-0.47.6.tgz", + "integrity": "sha512-RMHJ3Zuzpls426upHlAveVwlGMi8oBLzhiCauyC/yWQl3CkGTAYdyhEpGnux0+RxacysfIL2bd8ourx4K0Sx3w==", "dev": true, "optional": true }, "@dprint/linux-x64-glibc": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/linux-x64-glibc/-/linux-x64-glibc-0.47.2.tgz", - "integrity": "sha512-rB3WXMdINnRd33DItIp7mObS7dzHW90ZzeJSsoKJLPp+Z7wXjjb27UUowfqVI4baa/1pd7sdbX54DPohMtfu/A==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/linux-x64-glibc/-/linux-x64-glibc-0.47.6.tgz", + "integrity": "sha512-4zbVsx/a8lHkRyAjfW0PNlN5IMwOJfFapgXNYJowWNO7X3j3m1jYJWovjmdZls+d6pDeOHoanMWtq95wd7zTeQ==", "dev": true, "optional": true }, "@dprint/linux-x64-musl": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/linux-x64-musl/-/linux-x64-musl-0.47.2.tgz", - "integrity": "sha512-E0+TNbzYdTXJ/jCVjUctVxkda/faw++aDQLfyWGcmdMJnbM7NZz+W4fUpDXzMPsjy+zTWxXcPK7/q2DZz2gnbg==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/linux-x64-musl/-/linux-x64-musl-0.47.6.tgz", + "integrity": "sha512-0C13t4OVzomgQjvUyD5IrRyjLDhGuOtqMo00uJlwn3QHucfgOBqkjyQ5fq7T6+grBse0m14/EWblvSbYkZpyDw==", "dev": true, "optional": true }, "@dprint/typescript": { - "version": "0.93.0", - "resolved": "https://registry.npmjs.org/@dprint/typescript/-/typescript-0.93.0.tgz", - "integrity": "sha512-FxzxkheBbQnp7dHZJzkn4RwkP3keG/mvz0jyAGzEQ3P7Wl+ELSA8O2aZ6UJGmErOtP7lA8PbIbwMSu6VSBLSXw==", + "version": "0.93.3", + "resolved": "https://registry.npmjs.org/@dprint/typescript/-/typescript-0.93.3.tgz", + "integrity": "sha512-P/AAHYDyUG+5hih8knuk3s9n2wrCD1LSh0YsLlJMx6+v0Wsjf0PpcVRn+xDvHCtwPUctB5WBkZT2U8mu6Cm7RQ==", "dev": true }, "@dprint/win32-arm64": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/win32-arm64/-/win32-arm64-0.47.2.tgz", - "integrity": "sha512-K1EieTCFjfOCmyIhw9zFSduE6qVCNHEveupqZEfbSkVGw5T9MJQ1I9+n7MDb3RIDYEUk0enJ58/w82q8oDKCyA==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/win32-arm64/-/win32-arm64-0.47.6.tgz", + "integrity": "sha512-UOkeFMBdGIuGNwfkrJdVM9eNiRMdbZRRGVy0Cdo2AXn/FCDVqZ74KJkvYVcoUE27GCytHi4Sp1s4at7659WCOw==", "dev": true, "optional": true }, "@dprint/win32-x64": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/@dprint/win32-x64/-/win32-x64-0.47.2.tgz", - "integrity": "sha512-LhizWr8VrhHvq4ump8HwOERyFmdLiE8C6A42QSntGXzKdaa2nEOq20x/o56ZIiDcesiV+1TmosMKimPcOZHa+Q==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/@dprint/win32-x64/-/win32-x64-0.47.6.tgz", + "integrity": "sha512-i9xwXR8V8Jk/wU1gsYKx15eb0ypBRbRZFkHsnHfC0ZBimcfEOibGnGcfv+UCUcumXtnV46TnBqaJW7H70J1J+A==", "dev": true, "optional": true }, @@ -4982,27 +5067,27 @@ "dev": true }, "@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", "dev": true, "requires": { - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.3" } }, "@eslint-community/regexpp": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", - "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true }, "@eslint/config-array": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", - "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.1.tgz", + "integrity": "sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==", "dev": true, "requires": { - "@eslint/object-schema": "^2.1.4", + "@eslint/object-schema": "^2.1.5", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -5029,15 +5114,18 @@ } }, "@eslint/core": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.6.0.tgz", - "integrity": "sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==", - "dev": true + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.1.tgz", + "integrity": "sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.15" + } }, "@eslint/eslintrc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -5079,26 +5167,50 @@ } }, "@eslint/js": { - "version": "9.11.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.11.1.tgz", - "integrity": "sha512-/qu+TWz8WwPWc7/HcIJKi+c+MOm46GdVaSlTTQcaqaL53+GsoA6MxWp5PtTx48qbSP7ylM1Kn7nhvkugfJvRSA==", + "version": "9.17.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.17.0.tgz", + "integrity": "sha512-Sxc4hqcs1kTu0iID3kcZDW3JHq2a77HO9P8CP6YEA/FpH3Ll8UXE2r/86Rz9YJLKme39S9vU5OWNjC6Xl0Cr3w==", "dev": true }, "@eslint/object-schema": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", - "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.5.tgz", + "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==", "dev": true }, "@eslint/plugin-kit": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.0.tgz", - "integrity": "sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.4.tgz", + "integrity": "sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==", "dev": true, "requires": { "levn": "^0.4.1" } }, + "@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true + }, + "@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "requires": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "dependencies": { + "@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true + } + } + }, "@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -5106,9 +5218,9 @@ "dev": true }, "@humanwhocodes/retry": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", - "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", "dev": true }, "@isaacs/cliui": { @@ -5123,23 +5235,6 @@ "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", "wrap-ansi": "^8.1.0", "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true - }, - "strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "requires": { - "ansi-regex": "^6.0.1" - } - } } }, "@istanbuljs/schema": { @@ -5245,12 +5340,12 @@ "dev": true }, "@octokit/plugin-paginate-rest": { - "version": "11.3.5", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.3.5.tgz", - "integrity": "sha512-cgwIRtKrpwhLoBi0CUNuY83DPGRMaWVjqVI/bGKsLJ4PzyWZNaEmhHroI2xlrVXkk6nFv0IsZpOp+ZWSWUS2AQ==", + "version": "11.3.6", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.3.6.tgz", + "integrity": "sha512-zcvqqf/+TicbTCa/Z+3w4eBJcAxCFymtc0UAIsR3dEVoNilWld4oXdscQ3laXamTszUZdusw97K8+DrbFiOwjw==", "dev": true, "requires": { - "@octokit/types": "^13.6.0" + "@octokit/types": "^13.6.2" } }, "@octokit/plugin-request-log": { @@ -5261,12 +5356,12 @@ "requires": {} }, "@octokit/plugin-rest-endpoint-methods": { - "version": "13.2.5", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-13.2.5.tgz", - "integrity": "sha512-c4pRWi7OUSFM4E6frfUs+qsAf052aOWt1x2qFQ6llQcd1J0HqQ/0Egfs2lm33IixXeXXhZ+GmC9tf92qbOs25Q==", + "version": "13.2.6", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-13.2.6.tgz", + "integrity": "sha512-wMsdyHMjSfKjGINkdGKki06VEkgdEldIGstIEyGX0wbYHGByOwN/KiM+hAAlUwAtPkP3gvXtVQA9L3ITdV2tVw==", "dev": true, "requires": { - "@octokit/types": "^13.6.0" + "@octokit/types": "^13.6.1" } }, "@octokit/request": { @@ -5303,9 +5398,9 @@ } }, "@octokit/types": { - "version": "13.6.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.6.0.tgz", - "integrity": "sha512-CrooV/vKCXqwLa+osmHLIMUb87brpgUqlqkPGc6iE2wCkUvTrHiXFMhAKoDDaAAYJrtKtrFTgSQTg5nObBEaew==", + "version": "13.6.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.6.2.tgz", + "integrity": "sha512-WpbZfZUcZU77DrSW4wbsSgTPfKcp286q3ItaIgvSbBpZJlu6mnYXAkjZz6LVZPXkEvLIM8McanyZejKTYUHipA==", "dev": true, "requires": { "@octokit/openapi-types": "^22.2.0" @@ -5336,9 +5431,9 @@ "dev": true }, "@types/diff": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/@types/diff/-/diff-5.2.2.tgz", - "integrity": "sha512-qVqLpd49rmJA2nZzLVsmfS/aiiBpfVE95dHhPVwG0NmSBAt+riPxnj53wq2oBq5m4Q2RF1IWFEUpnZTgrQZfEQ==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/diff/-/diff-5.2.3.tgz", + "integrity": "sha512-K0Oqlrq3kQMaO2RhfrNQX5trmt+XLyom88zS0u84nnIcLvFnRUMRRHmrGny5GSM+kNO9IZLARsdQHDzkhAgmrQ==", "dev": true }, "@types/estree": { @@ -5366,9 +5461,9 @@ "dev": true }, "@types/mocha": { - "version": "10.0.8", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.8.tgz", - "integrity": "sha512-HfMcUmy9hTMJh66VNcmeC9iVErIZJli2bszuXc6julh5YGuRb/W5OnkHjwLNYdFlMis0sY3If5SEAp+PktdJjw==", + "version": "10.0.10", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", "dev": true }, "@types/ms": { @@ -5378,12 +5473,12 @@ "dev": true }, "@types/node": { - "version": "22.7.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz", - "integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==", + "version": "22.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz", + "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", "dev": true, "requires": { - "undici-types": "~6.19.2" + "undici-types": "~6.20.0" } }, "@types/source-map-support": { @@ -5402,16 +5497,16 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.8.0.tgz", - "integrity": "sha512-wORFWjU30B2WJ/aXBfOm1LX9v9nyt9D3jsSOxC3cCaTQGCW5k4jNpmjFv3U7p/7s4yvdjHzwtv2Sd2dOyhjS0A==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.1.tgz", + "integrity": "sha512-Ncvsq5CT3Gvh+uJG0Lwlho6suwDfUXH0HztslDf5I+F2wAFAZMRwYLEorumpKLzmO2suAXZ/td1tBg4NZIi9CQ==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.8.0", - "@typescript-eslint/type-utils": "8.8.0", - "@typescript-eslint/utils": "8.8.0", - "@typescript-eslint/visitor-keys": "8.8.0", + "@typescript-eslint/scope-manager": "8.18.1", + "@typescript-eslint/type-utils": "8.18.1", + "@typescript-eslint/utils": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -5419,26 +5514,26 @@ } }, "@typescript-eslint/parser": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.8.0.tgz", - "integrity": "sha512-uEFUsgR+tl8GmzmLjRqz+VrDv4eoaMqMXW7ruXfgThaAShO9JTciKpEsB+TvnfFfbg5IpujgMXVV36gOJRLtZg==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.1.tgz", + "integrity": "sha512-rBnTWHCdbYM2lh7hjyXqxk70wvon3p2FyaniZuey5TrcGBpfhVp0OxOa6gxr9Q9YhZFKyfbEnxc24ZnVbbUkCA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "8.8.0", - "@typescript-eslint/types": "8.8.0", - "@typescript-eslint/typescript-estree": "8.8.0", - "@typescript-eslint/visitor-keys": "8.8.0", + "@typescript-eslint/scope-manager": "8.18.1", + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/typescript-estree": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1", "debug": "^4.3.4" } }, "@typescript-eslint/rule-tester": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-8.8.0.tgz", - "integrity": "sha512-Mz41m89RzbOQfdsQ5lYV7gYghL4yumlULV/VBsKSkhZwYckKfNYD/MgkBBMHCTwtFpcPQKUhxHF5q6feyXAKfQ==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-8.18.1.tgz", + "integrity": "sha512-Ri73SSfOfd+aESELU2k0ikpIahTSY1VVsGiFWarDy54HSuMMZc/2JCST0dfpRep3egAvcI5/lcQvRHmSyzcA4g==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "8.8.0", - "@typescript-eslint/utils": "8.8.0", + "@typescript-eslint/typescript-estree": "8.18.1", + "@typescript-eslint/utils": "8.18.1", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", @@ -5446,41 +5541,41 @@ } }, "@typescript-eslint/scope-manager": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.0.tgz", - "integrity": "sha512-EL8eaGC6gx3jDd8GwEFEV091210U97J0jeEHrAYvIYosmEGet4wJ+g0SYmLu+oRiAwbSA5AVrt6DxLHfdd+bUg==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.1.tgz", + "integrity": "sha512-HxfHo2b090M5s2+/9Z3gkBhI6xBH8OJCFjH9MhQ+nnoZqxU3wNxkLT+VWXWSFWc3UF3Z+CfPAyqdCTdoXtDPCQ==", "dev": true, "requires": { - "@typescript-eslint/types": "8.8.0", - "@typescript-eslint/visitor-keys": "8.8.0" + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1" } }, "@typescript-eslint/type-utils": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.8.0.tgz", - "integrity": "sha512-IKwJSS7bCqyCeG4NVGxnOP6lLT9Okc3Zj8hLO96bpMkJab+10HIfJbMouLrlpyOr3yrQ1cA413YPFiGd1mW9/Q==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.1.tgz", + "integrity": "sha512-jAhTdK/Qx2NJPNOTxXpMwlOiSymtR2j283TtPqXkKBdH8OAMmhiUfP0kJjc/qSE51Xrq02Gj9NY7MwK+UxVwHQ==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "8.8.0", - "@typescript-eslint/utils": "8.8.0", + "@typescript-eslint/typescript-estree": "8.18.1", + "@typescript-eslint/utils": "8.18.1", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" } }, "@typescript-eslint/types": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.0.tgz", - "integrity": "sha512-QJwc50hRCgBd/k12sTykOJbESe1RrzmX6COk8Y525C9l7oweZ+1lw9JiU56im7Amm8swlz00DRIlxMYLizr2Vw==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.1.tgz", + "integrity": "sha512-7uoAUsCj66qdNQNpH2G8MyTFlgerum8ubf21s3TSM3XmKXuIn+H2Sifh/ES2nPOPiYSRJWAk0fDkW0APBWcpfw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.0.tgz", - "integrity": "sha512-ZaMJwc/0ckLz5DaAZ+pNLmHv8AMVGtfWxZe/x2JVEkD5LnmhWiQMMcYT7IY7gkdJuzJ9P14fRy28lUrlDSWYdw==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.1.tgz", + "integrity": "sha512-z8U21WI5txzl2XYOW7i9hJhxoKKNG1kcU4RzyNvKrdZDmbjkmLBo8bgeiOJmA06kizLI76/CCBAAGlTlEeUfyg==", "dev": true, "requires": { - "@typescript-eslint/types": "8.8.0", - "@typescript-eslint/visitor-keys": "8.8.0", + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/visitor-keys": "8.18.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -5490,31 +5585,39 @@ } }, "@typescript-eslint/utils": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.8.0.tgz", - "integrity": "sha512-QE2MgfOTem00qrlPgyByaCHay9yb1+9BjnMFnSFkUKQfu7adBXDTnCAivURnuPPAG/qiB+kzKkZKmKfaMT0zVg==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.1.tgz", + "integrity": "sha512-8vikiIj2ebrC4WRdcAdDcmnu9Q/MXXwg+STf40BVfT8exDqBCUPdypvzcUPxEqRGKg9ALagZ0UWcYCtn+4W2iQ==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.8.0", - "@typescript-eslint/types": "8.8.0", - "@typescript-eslint/typescript-estree": "8.8.0" + "@typescript-eslint/scope-manager": "8.18.1", + "@typescript-eslint/types": "8.18.1", + "@typescript-eslint/typescript-estree": "8.18.1" } }, "@typescript-eslint/visitor-keys": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.0.tgz", - "integrity": "sha512-8mq51Lx6Hpmd7HnA2fcHQo3YgfX1qbccxQOgZcb4tvasu//zXRaA1j5ZRFeCw/VRAdFi4mRM9DnZw0Nu0Q2d1g==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.1.tgz", + "integrity": "sha512-Vj0WLm5/ZsD013YeUKn+K0y8p1M0jPpxOkKdbD1wB0ns53a5piVY02zjf072TblEweAbcYiFiPoSMF3kp+VhhQ==", "dev": true, "requires": { - "@typescript-eslint/types": "8.8.0", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.18.1", + "eslint-visitor-keys": "^4.2.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true + } } }, "acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true }, "acorn-jsx": { @@ -5672,12 +5775,12 @@ "dev": true }, "c8": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.2.tgz", - "integrity": "sha512-Qr6rj76eSshu5CgRYvktW0uM0CFY0yi4Fd5D0duDXO6sYinyopmftUiJVuzBQxQcwQLor7JWDVRP+dUfCmzgJw==", + "version": "10.1.3", + "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.3.tgz", + "integrity": "sha512-LvcyrOAaOnrrlMpW22n690PUvxiq4Uf9WMhQwNJ9vgagkL/ph1+D4uvjvDA5XCbykrc0sx+ay6pVi9YZ1GnhyA==", "dev": true, "requires": { - "@bcoe/v8-coverage": "^0.2.3", + "@bcoe/v8-coverage": "^1.0.1", "@istanbuljs/schema": "^0.1.3", "find-up": "^5.0.0", "foreground-child": "^3.1.1", @@ -5690,17 +5793,24 @@ "yargs-parser": "^21.1.1" } }, - "call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", "dev": true, "requires": { - "es-define-property": "^1.0.0", "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" } }, "callsites": { @@ -5799,6 +5909,15 @@ "strip-ansi": "^6.0.1" } }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -5935,9 +6054,9 @@ "dev": true }, "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "requires": { "path-key": "^3.1.0", @@ -5957,9 +6076,9 @@ } }, "debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "requires": { "ms": "^2.1.3" @@ -6002,17 +6121,6 @@ "clone": "^1.0.2" } }, - "define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "requires": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - } - }, "des.js": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", @@ -6030,19 +6138,31 @@ "dev": true }, "dprint": { - "version": "0.47.2", - "resolved": "https://registry.npmjs.org/dprint/-/dprint-0.47.2.tgz", - "integrity": "sha512-geUcVIIrmLaY+YtuOl4gD7J/QCjsXZa5gUqre9sO6cgH0X/Fa9heBN3l/AWVII6rKPw45ATuCSDWz1pyO+HkPQ==", + "version": "0.47.6", + "resolved": "https://registry.npmjs.org/dprint/-/dprint-0.47.6.tgz", + "integrity": "sha512-vCQC+IMHVZbISA5pxEj+yshQbozmQoVFA4lzcLlqJ8rzIAH8U+1DKvesN/2Uv3Bqz6rMW6W4WY7pYJQljmiZ8w==", "dev": true, "requires": { - "@dprint/darwin-arm64": "0.47.2", - "@dprint/darwin-x64": "0.47.2", - "@dprint/linux-arm64-glibc": "0.47.2", - "@dprint/linux-arm64-musl": "0.47.2", - "@dprint/linux-x64-glibc": "0.47.2", - "@dprint/linux-x64-musl": "0.47.2", - "@dprint/win32-arm64": "0.47.2", - "@dprint/win32-x64": "0.47.2" + "@dprint/darwin-arm64": "0.47.6", + "@dprint/darwin-x64": "0.47.6", + "@dprint/linux-arm64-glibc": "0.47.6", + "@dprint/linux-arm64-musl": "0.47.6", + "@dprint/linux-riscv64-glibc": "0.47.6", + "@dprint/linux-x64-glibc": "0.47.6", + "@dprint/linux-x64-musl": "0.47.6", + "@dprint/win32-arm64": "0.47.6", + "@dprint/win32-x64": "0.47.6" + } + }, + "dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" } }, "eastasianwidth": { @@ -6084,13 +6204,10 @@ } }, "es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dev": true, - "requires": { - "get-intrinsic": "^1.2.4" - } + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true }, "es-errors": { "version": "1.3.0", @@ -6098,6 +6215,15 @@ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true }, + "es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0" + } + }, "esbuild": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", @@ -6143,31 +6269,31 @@ "dev": true }, "eslint": { - "version": "9.11.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.11.1.tgz", - "integrity": "sha512-MobhYKIoAO1s1e4VUrgx1l1Sk2JBR/Gqjjgw8+mfgoLE2xwsHur4gdfTxyTgShrhvdVFTaJSgMiQBl1jv/AWxg==", + "version": "9.17.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.17.0.tgz", + "integrity": "sha512-evtlNcpJg+cZLcnVKwsai8fExnqjGPicK7gnUtlNuzu+Fv9bI0aLpND5T44VLQtoMEnI57LoXO9XAkIXwohKrA==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.11.0", - "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.6.0", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.11.1", - "@eslint/plugin-kit": "^0.2.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.9.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.17.0", + "@eslint/plugin-kit": "^0.2.3", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.3.0", - "@nodelib/fs.walk": "^1.2.8", + "@humanwhocodes/retry": "^0.4.1", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.0.2", - "eslint-visitor-keys": "^4.0.0", - "espree": "^10.1.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -6177,14 +6303,11 @@ "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "dependencies": { "brace-expansion": { @@ -6198,9 +6321,9 @@ } }, "eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true }, "glob-parent": { @@ -6234,13 +6357,13 @@ } }, "eslint-plugin-regexp": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-2.6.0.tgz", - "integrity": "sha512-FCL851+kislsTEQEMioAlpDuK5+E5vs0hi1bF8cFlPlHcEjeRhuAzEsGikXRreE+0j4WhW2uO54MqTjXtYOi3A==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-2.7.0.tgz", + "integrity": "sha512-U8oZI77SBtH8U3ulZ05iu0qEzIizyEDXd+BWHvyVxTOjGwcDcvy/kEpgFG4DYca2ByRLiVPFZ2GeH7j1pdvZTA==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.9.1", + "@eslint-community/regexpp": "^4.11.0", "comment-parser": "^1.4.0", "jsdoc-type-pratt-parser": "^4.0.0", "refa": "^0.12.1", @@ -6249,9 +6372,9 @@ } }, "eslint-scope": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.1.0.tgz", - "integrity": "sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", "dev": true, "requires": { "esrecurse": "^4.3.0", @@ -6265,20 +6388,20 @@ "dev": true }, "espree": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", - "integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, "requires": { - "acorn": "^8.12.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.1.0" + "eslint-visitor-keys": "^4.2.0" }, "dependencies": { "eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true } } @@ -6345,9 +6468,9 @@ "dev": true }, "fast-xml-parser": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.0.tgz", - "integrity": "sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.1.tgz", + "integrity": "sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w==", "dev": true, "requires": { "strnum": "^1.0.5" @@ -6413,9 +6536,9 @@ } }, "flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", "dev": true }, "foreground-child": { @@ -6460,16 +6583,21 @@ "dev": true }, "get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", + "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", "dev": true, "requires": { + "call-bind-apply-helpers": "^1.0.1", + "dunder-proto": "^1.0.0", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.0.0" } }, "glob": { @@ -6496,19 +6624,16 @@ } }, "globals": { - "version": "15.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.9.0.tgz", - "integrity": "sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==", + "version": "15.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.13.0.tgz", + "integrity": "sha512-49TewVEz0UxZjr1WYYsWpPrhyC/B/pA8Bq0fUmet2n+eR7yn0IvNzNaoBwnK6mdkzcN+se7Ez9zUgULTz2QH4g==", "dev": true }, "gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "requires": { - "get-intrinsic": "^1.1.3" - } + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true }, "graceful-fs": { "version": "4.2.11", @@ -6528,25 +6653,10 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "requires": { - "es-define-property": "^1.0.0" - } - }, - "has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "dev": true - }, "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true }, "hasown": { @@ -6669,12 +6779,6 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, - "is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true - }, "is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -6731,9 +6835,9 @@ } }, "jiti": { - "version": "1.21.6", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.6.tgz", - "integrity": "sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.2.tgz", + "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==", "dev": true }, "js-md4": { @@ -6791,9 +6895,9 @@ } }, "knip": { - "version": "5.30.6", - "resolved": "https://registry.npmjs.org/knip/-/knip-5.30.6.tgz", - "integrity": "sha512-YkcnRVl0N99xZ7eaXE7KlH/4cPTCn6BGuk9KxINEdCMFN3yita2vGBizApy97ZOHgghy8tb589gQ3xvLMFIO4w==", + "version": "5.41.0", + "resolved": "https://registry.npmjs.org/knip/-/knip-5.41.0.tgz", + "integrity": "sha512-W8omBs+jhC/P/A3kC0xdEGrhYVmsmWafUVz0wzQjYfoaK0YNEBPPLptUeqwQl6ihYVqzb/X0zs50gY9Akw1Bww==", "dev": true, "requires": { "@nodelib/fs.walk": "1.2.8", @@ -6801,13 +6905,13 @@ "easy-table": "1.2.0", "enhanced-resolve": "^5.17.1", "fast-glob": "^3.3.2", - "jiti": "^1.21.6", + "jiti": "^2.4.0", "js-yaml": "^4.1.0", "minimist": "^1.2.8", - "picocolors": "^1.0.0", + "picocolors": "^1.1.0", "picomatch": "^4.0.1", "pretty-ms": "^9.0.0", - "smol-toml": "^1.3.0", + "smol-toml": "^1.3.1", "strip-json-comments": "5.0.1", "summary": "2.1.0", "zod": "^3.22.4", @@ -6827,9 +6931,9 @@ "dev": true }, "pretty-ms": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.1.0.tgz", - "integrity": "sha512-o1piW0n3tgKIKCwk2vpM/vOV13zjJzvP37Ioze54YlTHE06m4tjEbzg9WsKkvTuyYln2DHjo5pY4qrZGI0otpw==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.2.0.tgz", + "integrity": "sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==", "dev": true, "requires": { "parse-ms": "^4.0.0" @@ -6908,6 +7012,12 @@ "semver": "^7.5.3" } }, + "math-intrinsics": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.0.0.tgz", + "integrity": "sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==", + "dev": true + }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -6952,9 +7062,9 @@ "dev": true }, "mocha": { - "version": "10.7.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz", - "integrity": "sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==", + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", "dev": true, "requires": { "ansi-colors": "^4.1.3", @@ -7029,6 +7139,15 @@ "strip-ansi": "^6.0.1" } }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, "supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -7079,12 +7198,12 @@ "dev": true }, "monocart-coverage-reports": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.11.0.tgz", - "integrity": "sha512-FueI32k3gheTVSv20MzpCyC6NynQOkq6e+81My8An+FiLCDQoqPt4Rzt3GOeWs6+i4FTKvsJAOf7IZu1a0KzPw==", + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.11.4.tgz", + "integrity": "sha512-hFhfhIzD7Yv1fNJgnUVvrEpnwqB44KwSGbghOM9C8AMIVon5ZLRlspbWz+uwW04Yhgvo5WmtPEmX+mnET2VcGA==", "dev": true, "requires": { - "acorn": "^8.12.1", + "acorn": "^8.14.0", "acorn-loose": "^8.4.0", "acorn-walk": "^8.3.4", "commander": "^12.1.0", @@ -7131,9 +7250,9 @@ "dev": true }, "object-inspect": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", - "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", "dev": true }, "once": { @@ -7236,9 +7355,9 @@ "dev": true }, "picocolors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true }, "picomatch": { @@ -7248,13 +7367,13 @@ "dev": true }, "playwright": { - "version": "1.47.2", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.2.tgz", - "integrity": "sha512-nx1cLMmQWqmA3UsnjaaokyoUpdVaaDhJhMoxX2qj3McpjnsqFHs516QAKYhqHAgOP+oCFTEOCOAaD1RgD/RQfA==", + "version": "1.49.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.1.tgz", + "integrity": "sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==", "dev": true, "requires": { "fsevents": "2.3.2", - "playwright-core": "1.47.2" + "playwright-core": "1.49.1" }, "dependencies": { "fsevents": { @@ -7267,9 +7386,9 @@ } }, "playwright-core": { - "version": "1.47.2", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.2.tgz", - "integrity": "sha512-3JvMfF+9LJfe16l7AbSmU555PaTl2tPyQsVInqm3id16pdDfvZ8TTZ/pyzmkbDrZTQefyzU7AIHlZqQnxpqHVQ==", + "version": "1.49.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.1.tgz", + "integrity": "sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==", "dev": true }, "plur": { @@ -7303,9 +7422,9 @@ "dev": true }, "qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.1.tgz", + "integrity": "sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg==", "dev": true, "requires": { "side-channel": "^1.0.6" @@ -7419,20 +7538,6 @@ "randombytes": "^2.1.0" } }, - "set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, - "requires": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - } - }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -7449,15 +7554,51 @@ "dev": true }, "side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "dev": true, "requires": { - "call-bind": "^1.0.7", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + } + }, + "side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + } + }, + "side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + } + }, + "side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" } }, "signal-exit": { @@ -7467,9 +7608,9 @@ "dev": true }, "smol-toml": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.3.0.tgz", - "integrity": "sha512-tWpi2TsODPScmi48b/OQZGi2lgUmBCHy6SZrhi/FdnnHiU1GwebbCfuQuxsC3nHaLwtYeJGPrDZDIeodDOc4pA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.3.1.tgz", + "integrity": "sha512-tEYNll18pPKHroYSmLLrksq233j021G0giwW7P3D24jC54pQ5W5BXMsQ/Mvw1OJCmEYDgY+lrzT+3nNUtoNfXQ==", "dev": true }, "source-map": { @@ -7497,23 +7638,6 @@ "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true - }, - "strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "requires": { - "ansi-regex": "^6.0.1" - } - } } }, "string-width-cjs": { @@ -7532,16 +7656,33 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } } } }, "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "requires": { - "ansi-regex": "^5.0.1" + "ansi-regex": "^6.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true + } } }, "strip-ansi-cjs": { @@ -7609,12 +7750,6 @@ "minimatch": "^9.0.4" } }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -7625,16 +7760,16 @@ } }, "ts-api-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", - "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", "dev": true, "requires": {} }, "tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "dev": true }, "tunnel": { @@ -7672,20 +7807,20 @@ } }, "typescript": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", - "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true }, "typescript-eslint": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.8.0.tgz", - "integrity": "sha512-BjIT/VwJ8+0rVO01ZQ2ZVnjE1svFBiRczcpr1t1Yxt7sT25VSbPfrJtDsQ8uQTy2pilX5nI9gwxhUyLULNentw==", + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.18.1.tgz", + "integrity": "sha512-Mlaw6yxuaDEPQvb/2Qwu3/TfgeBHy9iTJ3mTwe7OvpPmF6KPQjVOfGyEJpPv6Ez2C34OODChhXrzYw/9phI0MQ==", "dev": true, "requires": { - "@typescript-eslint/eslint-plugin": "8.8.0", - "@typescript-eslint/parser": "8.8.0", - "@typescript-eslint/utils": "8.8.0" + "@typescript-eslint/eslint-plugin": "8.18.1", + "@typescript-eslint/parser": "8.18.1", + "@typescript-eslint/utils": "8.18.1" } }, "typical": { @@ -7701,9 +7836,9 @@ "dev": true }, "undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true }, "universal-user-agent": { @@ -7784,26 +7919,11 @@ "strip-ansi": "^7.0.1" }, "dependencies": { - "ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true - }, "ansi-styles": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true - }, - "strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "requires": { - "ansi-regex": "^6.0.1" - } } } }, @@ -7834,6 +7954,15 @@ "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } } } }, @@ -7880,6 +8009,15 @@ "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } } } }, @@ -7908,9 +8046,9 @@ "dev": true }, "zod": { - "version": "3.23.8", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", - "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "version": "3.24.1", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz", + "integrity": "sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==", "dev": true }, "zod-validation-error": { diff --git a/package.json b/package.json index 4ddb7a53a7146..d89e98d368c0b 100644 --- a/package.json +++ b/package.json @@ -40,48 +40,48 @@ ], "devDependencies": { "@dprint/formatter": "^0.4.1", - "@dprint/typescript": "0.93.0", + "@dprint/typescript": "0.93.3", "@esfx/canceltoken": "^1.0.0", - "@eslint/js": "^9.11.1", + "@eslint/js": "^9.17.0", "@octokit/rest": "^21.0.2", "@types/chai": "^4.3.20", - "@types/diff": "^5.2.2", + "@types/diff": "^5.2.3", "@types/minimist": "^1.2.5", - "@types/mocha": "^10.0.8", + "@types/mocha": "^10.0.10", "@types/ms": "^0.7.34", "@types/node": "latest", "@types/source-map-support": "^0.5.10", "@types/which": "^3.0.4", - "@typescript-eslint/rule-tester": "^8.8.0", - "@typescript-eslint/type-utils": "^8.8.0", - "@typescript-eslint/utils": "^8.8.0", + "@typescript-eslint/rule-tester": "^8.18.1", + "@typescript-eslint/type-utils": "^8.18.1", + "@typescript-eslint/utils": "^8.18.1", "azure-devops-node-api": "^14.1.0", - "c8": "^10.1.2", + "c8": "^10.1.3", "chai": "^4.5.0", "chalk": "^4.1.2", "chokidar": "^3.6.0", "diff": "^5.2.0", - "dprint": "^0.47.2", + "dprint": "^0.47.6", "esbuild": "^0.24.0", - "eslint": "^9.11.1", + "eslint": "^9.17.0", "eslint-formatter-autolinkable-stylish": "^1.4.0", - "eslint-plugin-regexp": "^2.6.0", - "fast-xml-parser": "^4.5.0", + "eslint-plugin-regexp": "^2.7.0", + "fast-xml-parser": "^4.5.1", "glob": "^10.4.5", - "globals": "^15.9.0", + "globals": "^15.13.0", "hereby": "^1.10.0", "jsonc-parser": "^3.3.1", - "knip": "^5.30.6", + "knip": "^5.41.0", "minimist": "^1.2.8", - "mocha": "^10.7.3", + "mocha": "^10.8.2", "mocha-fivemat-progress-reporter": "^0.1.0", - "monocart-coverage-reports": "^2.11.0", + "monocart-coverage-reports": "^2.11.4", "ms": "^2.1.3", - "playwright": "^1.47.2", + "playwright": "^1.49.1", "source-map-support": "^0.5.21", - "tslib": "^2.7.0", - "typescript": "^5.6.2", - "typescript-eslint": "^8.8.0", + "tslib": "^2.8.1", + "typescript": "^5.7.2", + "typescript-eslint": "^8.18.1", "which": "^3.0.1" }, "overrides": { From 0dda037f9fc53af3623b9e7371a731947a572d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Wed, 18 Dec 2024 19:44:43 +0100 Subject: [PATCH 30/46] Improve `unknown` narrowing by negated type predicates (#60795) --- src/compiler/checker.ts | 3 +- .../narrowUnknownByTypePredicate.symbols | 89 ++++++++++++ .../narrowUnknownByTypePredicate.types | 135 ++++++++++++++++++ .../compiler/narrowUnknownByTypePredicate.ts | 38 +++++ 4 files changed, 264 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/narrowUnknownByTypePredicate.symbols create mode 100644 tests/baselines/reference/narrowUnknownByTypePredicate.types create mode 100644 tests/cases/compiler/narrowUnknownByTypePredicate.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 04facba3196e7..34fd98bcbfe11 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -29404,8 +29404,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (checkDerived) { return filterType(type, t => !isTypeDerivedFrom(t, candidate)); } + type = type.flags & TypeFlags.Unknown ? unknownUnionType : type; const trueType = getNarrowedType(type, candidate, /*assumeTrue*/ true, /*checkDerived*/ false); - return filterType(type, t => !isTypeSubsetOf(t, trueType)); + return recombineUnknownType(filterType(type, t => !isTypeSubsetOf(t, trueType))); } if (type.flags & TypeFlags.AnyOrUnknown) { return candidate; diff --git a/tests/baselines/reference/narrowUnknownByTypePredicate.symbols b/tests/baselines/reference/narrowUnknownByTypePredicate.symbols new file mode 100644 index 0000000000000..9f0388f934c86 --- /dev/null +++ b/tests/baselines/reference/narrowUnknownByTypePredicate.symbols @@ -0,0 +1,89 @@ +//// [tests/cases/compiler/narrowUnknownByTypePredicate.ts] //// + +=== narrowUnknownByTypePredicate.ts === +declare function isNotNullish(value: unknown): value is {}; +>isNotNullish : Symbol(isNotNullish, Decl(narrowUnknownByTypePredicate.ts, 0, 0)) +>value : Symbol(value, Decl(narrowUnknownByTypePredicate.ts, 0, 30)) +>value : Symbol(value, Decl(narrowUnknownByTypePredicate.ts, 0, 30)) + +declare function isNullish(value: unknown): value is null | undefined; +>isNullish : Symbol(isNullish, Decl(narrowUnknownByTypePredicate.ts, 0, 59)) +>value : Symbol(value, Decl(narrowUnknownByTypePredicate.ts, 1, 27)) +>value : Symbol(value, Decl(narrowUnknownByTypePredicate.ts, 1, 27)) + +declare const value1: unknown; +>value1 : Symbol(value1, Decl(narrowUnknownByTypePredicate.ts, 3, 13)) + +if (isNotNullish(value1)) { +>isNotNullish : Symbol(isNotNullish, Decl(narrowUnknownByTypePredicate.ts, 0, 0)) +>value1 : Symbol(value1, Decl(narrowUnknownByTypePredicate.ts, 3, 13)) + + value1; +>value1 : Symbol(value1, Decl(narrowUnknownByTypePredicate.ts, 3, 13)) +} + +declare const value2: unknown; +>value2 : Symbol(value2, Decl(narrowUnknownByTypePredicate.ts, 8, 13)) + +if (!isNotNullish(value2)) { +>isNotNullish : Symbol(isNotNullish, Decl(narrowUnknownByTypePredicate.ts, 0, 0)) +>value2 : Symbol(value2, Decl(narrowUnknownByTypePredicate.ts, 8, 13)) + + value2; +>value2 : Symbol(value2, Decl(narrowUnknownByTypePredicate.ts, 8, 13)) +} + +declare const value3: unknown; +>value3 : Symbol(value3, Decl(narrowUnknownByTypePredicate.ts, 13, 13)) + +if (isNullish(value3)) { +>isNullish : Symbol(isNullish, Decl(narrowUnknownByTypePredicate.ts, 0, 59)) +>value3 : Symbol(value3, Decl(narrowUnknownByTypePredicate.ts, 13, 13)) + + value3; +>value3 : Symbol(value3, Decl(narrowUnknownByTypePredicate.ts, 13, 13)) +} + +declare const value4: unknown; +>value4 : Symbol(value4, Decl(narrowUnknownByTypePredicate.ts, 18, 13)) + +if (!isNullish(value4)) { +>isNullish : Symbol(isNullish, Decl(narrowUnknownByTypePredicate.ts, 0, 59)) +>value4 : Symbol(value4, Decl(narrowUnknownByTypePredicate.ts, 18, 13)) + + value4; +>value4 : Symbol(value4, Decl(narrowUnknownByTypePredicate.ts, 18, 13)) +} + +declare class A { foo: string; } +>A : Symbol(A, Decl(narrowUnknownByTypePredicate.ts, 21, 1)) +>foo : Symbol(A.foo, Decl(narrowUnknownByTypePredicate.ts, 23, 17)) + +declare function isA(value: unknown): value is A; +>isA : Symbol(isA, Decl(narrowUnknownByTypePredicate.ts, 23, 32)) +>value : Symbol(value, Decl(narrowUnknownByTypePredicate.ts, 24, 21)) +>value : Symbol(value, Decl(narrowUnknownByTypePredicate.ts, 24, 21)) +>A : Symbol(A, Decl(narrowUnknownByTypePredicate.ts, 21, 1)) + +declare const value5: unknown; +>value5 : Symbol(value5, Decl(narrowUnknownByTypePredicate.ts, 26, 13)) + +if (isA(value5)) { +>isA : Symbol(isA, Decl(narrowUnknownByTypePredicate.ts, 23, 32)) +>value5 : Symbol(value5, Decl(narrowUnknownByTypePredicate.ts, 26, 13)) + + value5; +>value5 : Symbol(value5, Decl(narrowUnknownByTypePredicate.ts, 26, 13)) +} + +declare const value6: unknown; +>value6 : Symbol(value6, Decl(narrowUnknownByTypePredicate.ts, 31, 13)) + +if (!isA(value6)) { +>isA : Symbol(isA, Decl(narrowUnknownByTypePredicate.ts, 23, 32)) +>value6 : Symbol(value6, Decl(narrowUnknownByTypePredicate.ts, 31, 13)) + + value6; +>value6 : Symbol(value6, Decl(narrowUnknownByTypePredicate.ts, 31, 13)) +} + diff --git a/tests/baselines/reference/narrowUnknownByTypePredicate.types b/tests/baselines/reference/narrowUnknownByTypePredicate.types new file mode 100644 index 0000000000000..43d8e0b936e4b --- /dev/null +++ b/tests/baselines/reference/narrowUnknownByTypePredicate.types @@ -0,0 +1,135 @@ +//// [tests/cases/compiler/narrowUnknownByTypePredicate.ts] //// + +=== narrowUnknownByTypePredicate.ts === +declare function isNotNullish(value: unknown): value is {}; +>isNotNullish : (value: unknown) => value is {} +> : ^ ^^ ^^^^^ +>value : unknown +> : ^^^^^^^ + +declare function isNullish(value: unknown): value is null | undefined; +>isNullish : (value: unknown) => value is null | undefined +> : ^ ^^ ^^^^^ +>value : unknown +> : ^^^^^^^ + +declare const value1: unknown; +>value1 : unknown +> : ^^^^^^^ + +if (isNotNullish(value1)) { +>isNotNullish(value1) : boolean +> : ^^^^^^^ +>isNotNullish : (value: unknown) => value is {} +> : ^ ^^ ^^^^^ +>value1 : unknown +> : ^^^^^^^ + + value1; +>value1 : {} +> : ^^ +} + +declare const value2: unknown; +>value2 : unknown +> : ^^^^^^^ + +if (!isNotNullish(value2)) { +>!isNotNullish(value2) : boolean +> : ^^^^^^^ +>isNotNullish(value2) : boolean +> : ^^^^^^^ +>isNotNullish : (value: unknown) => value is {} +> : ^ ^^ ^^^^^ +>value2 : unknown +> : ^^^^^^^ + + value2; +>value2 : null | undefined +> : ^^^^^^^^^^^^^^^^ +} + +declare const value3: unknown; +>value3 : unknown +> : ^^^^^^^ + +if (isNullish(value3)) { +>isNullish(value3) : boolean +> : ^^^^^^^ +>isNullish : (value: unknown) => value is null | undefined +> : ^ ^^ ^^^^^ +>value3 : unknown +> : ^^^^^^^ + + value3; +>value3 : null | undefined +> : ^^^^^^^^^^^^^^^^ +} + +declare const value4: unknown; +>value4 : unknown +> : ^^^^^^^ + +if (!isNullish(value4)) { +>!isNullish(value4) : boolean +> : ^^^^^^^ +>isNullish(value4) : boolean +> : ^^^^^^^ +>isNullish : (value: unknown) => value is null | undefined +> : ^ ^^ ^^^^^ +>value4 : unknown +> : ^^^^^^^ + + value4; +>value4 : {} +> : ^^ +} + +declare class A { foo: string; } +>A : A +> : ^ +>foo : string +> : ^^^^^^ + +declare function isA(value: unknown): value is A; +>isA : (value: unknown) => value is A +> : ^ ^^ ^^^^^ +>value : unknown +> : ^^^^^^^ + +declare const value5: unknown; +>value5 : unknown +> : ^^^^^^^ + +if (isA(value5)) { +>isA(value5) : boolean +> : ^^^^^^^ +>isA : (value: unknown) => value is A +> : ^ ^^ ^^^^^ +>value5 : unknown +> : ^^^^^^^ + + value5; +>value5 : A +> : ^ +} + +declare const value6: unknown; +>value6 : unknown +> : ^^^^^^^ + +if (!isA(value6)) { +>!isA(value6) : boolean +> : ^^^^^^^ +>isA(value6) : boolean +> : ^^^^^^^ +>isA : (value: unknown) => value is A +> : ^ ^^ ^^^^^ +>value6 : unknown +> : ^^^^^^^ + + value6; +>value6 : unknown +> : ^^^^^^^ +} + diff --git a/tests/cases/compiler/narrowUnknownByTypePredicate.ts b/tests/cases/compiler/narrowUnknownByTypePredicate.ts new file mode 100644 index 0000000000000..e952788b6a91a --- /dev/null +++ b/tests/cases/compiler/narrowUnknownByTypePredicate.ts @@ -0,0 +1,38 @@ +// @strict: true +// @noEmit: true + +declare function isNotNullish(value: unknown): value is {}; +declare function isNullish(value: unknown): value is null | undefined; + +declare const value1: unknown; +if (isNotNullish(value1)) { + value1; +} + +declare const value2: unknown; +if (!isNotNullish(value2)) { + value2; +} + +declare const value3: unknown; +if (isNullish(value3)) { + value3; +} + +declare const value4: unknown; +if (!isNullish(value4)) { + value4; +} + +declare class A { foo: string; } +declare function isA(value: unknown): value is A; + +declare const value5: unknown; +if (isA(value5)) { + value5; +} + +declare const value6: unknown; +if (!isA(value6)) { + value6; +} From 12e205b1e980d6c46921c78283802ae2bbe034ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Thu, 19 Dec 2024 20:47:26 +0100 Subject: [PATCH 31/46] Don't try to add an implicit undefined for mapped properties outside of `strictNullChecks` (#60393) --- src/compiler/checker.ts | 2 +- ...alMappedTypePropertyNoStrictNullChecks1.js | 48 ++++++++++++ ...pedTypePropertyNoStrictNullChecks1.symbols | 63 ++++++++++++++++ ...appedTypePropertyNoStrictNullChecks1.types | 73 +++++++++++++++++++ ...alMappedTypePropertyNoStrictNullChecks2.js | 48 ++++++++++++ ...pedTypePropertyNoStrictNullChecks2.symbols | 63 ++++++++++++++++ ...appedTypePropertyNoStrictNullChecks2.types | 73 +++++++++++++++++++ ...alMappedTypePropertyNoStrictNullChecks3.js | 48 ++++++++++++ ...pedTypePropertyNoStrictNullChecks3.symbols | 63 ++++++++++++++++ ...appedTypePropertyNoStrictNullChecks3.types | 73 +++++++++++++++++++ ...alMappedTypePropertyNoStrictNullChecks4.js | 17 +++++ ...pedTypePropertyNoStrictNullChecks4.symbols | 22 ++++++ ...appedTypePropertyNoStrictNullChecks4.types | 29 ++++++++ ...alMappedTypePropertyNoStrictNullChecks1.ts | 30 ++++++++ ...alMappedTypePropertyNoStrictNullChecks2.ts | 30 ++++++++ ...alMappedTypePropertyNoStrictNullChecks3.ts | 30 ++++++++ ...alMappedTypePropertyNoStrictNullChecks4.ts | 10 +++ 17 files changed, 721 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.js create mode 100644 tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.symbols create mode 100644 tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.types create mode 100644 tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.js create mode 100644 tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.symbols create mode 100644 tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.types create mode 100644 tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.js create mode 100644 tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.symbols create mode 100644 tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.types create mode 100644 tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.js create mode 100644 tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.symbols create mode 100644 tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.types create mode 100644 tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.ts create mode 100644 tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.ts create mode 100644 tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.ts create mode 100644 tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 34fd98bcbfe11..80b61edd3657a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6267,7 +6267,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return true; } if (requiresAddingUndefined && annotationType) { - annotationType = getOptionalType(annotationType, !isParameter(node)); + annotationType = addOptionality(annotationType, !isParameter(node)); } return !!annotationType && typeNodeIsEquivalentToType(node, type, annotationType) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type); }, diff --git a/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.js b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.js new file mode 100644 index 0000000000000..fcd8a982b4615 --- /dev/null +++ b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.js @@ -0,0 +1,48 @@ +//// [tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.ts] //// + +//// [createApi.ts] +type Id = { + [K in keyof T]: T[K]; +} & {}; + +export declare function createApi(_: { endpoints: Definitions }): { + [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ + status: "uninitialized"; + originalArgs?: undefined; + }>; +}; + +//// [index.ts] +import { createApi } from "./createApi"; + +const slice = createApi({ + endpoints: { + test: { + url: `/user`, + }, + }, +}); + +export const { useTestQuery } = slice; + + + + +//// [createApi.d.ts] +type Id = { + [K in keyof T]: T[K]; +} & {}; +export declare function createApi(_: { + endpoints: Definitions; +}): { + [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ + status: "uninitialized"; + originalArgs?: undefined; + }>; +}; +export {}; +//// [index.d.ts] +export declare const useTestQuery: () => { + status: "uninitialized"; + originalArgs?: undefined; +}; diff --git a/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.symbols b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.symbols new file mode 100644 index 0000000000000..085152b6aedec --- /dev/null +++ b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.symbols @@ -0,0 +1,63 @@ +//// [tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.ts] //// + +=== createApi.ts === +type Id = { +>Id : Symbol(Id, Decl(createApi.ts, 0, 0)) +>T : Symbol(T, Decl(createApi.ts, 0, 8)) + + [K in keyof T]: T[K]; +>K : Symbol(K, Decl(createApi.ts, 1, 3)) +>T : Symbol(T, Decl(createApi.ts, 0, 8)) +>T : Symbol(T, Decl(createApi.ts, 0, 8)) +>K : Symbol(K, Decl(createApi.ts, 1, 3)) + +} & {}; + +export declare function createApi(_: { endpoints: Definitions }): { +>createApi : Symbol(createApi, Decl(createApi.ts, 2, 7)) +>Definitions : Symbol(Definitions, Decl(createApi.ts, 4, 34)) +>_ : Symbol(_, Decl(createApi.ts, 4, 47)) +>endpoints : Symbol(endpoints, Decl(createApi.ts, 4, 51)) +>Definitions : Symbol(Definitions, Decl(createApi.ts, 4, 34)) + + [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ +>K : Symbol(K, Decl(createApi.ts, 5, 3)) +>Definitions : Symbol(Definitions, Decl(createApi.ts, 4, 34)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) +>K : Symbol(K, Decl(createApi.ts, 5, 3)) +>Id : Symbol(Id, Decl(createApi.ts, 0, 0)) + + status: "uninitialized"; +>status : Symbol(status, Decl(createApi.ts, 5, 77)) + + originalArgs?: undefined; +>originalArgs : Symbol(originalArgs, Decl(createApi.ts, 6, 28)) + + }>; +}; + +=== index.ts === +import { createApi } from "./createApi"; +>createApi : Symbol(createApi, Decl(index.ts, 0, 8)) + +const slice = createApi({ +>slice : Symbol(slice, Decl(index.ts, 2, 5)) +>createApi : Symbol(createApi, Decl(index.ts, 0, 8)) + + endpoints: { +>endpoints : Symbol(endpoints, Decl(index.ts, 2, 25)) + + test: { +>test : Symbol(test, Decl(index.ts, 3, 14)) + + url: `/user`, +>url : Symbol(url, Decl(index.ts, 4, 11)) + + }, + }, +}); + +export const { useTestQuery } = slice; +>useTestQuery : Symbol(useTestQuery, Decl(index.ts, 10, 14)) +>slice : Symbol(slice, Decl(index.ts, 2, 5)) + diff --git a/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.types b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.types new file mode 100644 index 0000000000000..6037c9c4e7342 --- /dev/null +++ b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.types @@ -0,0 +1,73 @@ +//// [tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.ts] //// + +=== createApi.ts === +type Id = { +>Id : { [K in keyof T]: T[K]; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^ + + [K in keyof T]: T[K]; +} & {}; + +export declare function createApi(_: { endpoints: Definitions }): { +>createApi : (_: { endpoints: Definitions; }) => { [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ status: "uninitialized"; originalArgs?: undefined; }>; } +> : ^ ^^ ^^ ^^^^^ +>_ : { endpoints: Definitions; } +> : ^^^^^^^^^^^^^ ^^^ +>endpoints : Definitions +> : ^^^^^^^^^^^ + + [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ + status: "uninitialized"; +>status : "uninitialized" +> : ^^^^^^^^^^^^^^^ + + originalArgs?: undefined; +>originalArgs : undefined +> : ^^^^^^^^^ + + }>; +}; + +=== index.ts === +import { createApi } from "./createApi"; +>createApi : (_: { endpoints: Definitions; }) => { [K in keyof Definitions as `use${Capitalize}Query`]: () => { status: "uninitialized"; originalArgs?: undefined; }; } +> : ^ ^^ ^^ ^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^ + +const slice = createApi({ +>slice : { useTestQuery: () => { status: "uninitialized"; originalArgs?: undefined; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^ +>createApi({ endpoints: { test: { url: `/user`, }, },}) : { useTestQuery: () => { status: "uninitialized"; originalArgs?: undefined; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^ +>createApi : (_: { endpoints: Definitions; }) => { [K in keyof Definitions as `use${Capitalize}Query`]: () => { status: "uninitialized"; originalArgs?: undefined; }; } +> : ^ ^^ ^^ ^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^ +>{ endpoints: { test: { url: `/user`, }, },} : { endpoints: { test: { url: string; }; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + endpoints: { +>endpoints : { test: { url: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ test: { url: `/user`, }, } : { test: { url: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + test: { +>test : { url: string; } +> : ^^^^^^^^^^^^^^^^ +>{ url: `/user`, } : { url: string; } +> : ^^^^^^^^^^^^^^^^ + + url: `/user`, +>url : string +> : ^^^^^^ +>`/user` : "/user" +> : ^^^^^^^ + + }, + }, +}); + +export const { useTestQuery } = slice; +>useTestQuery : () => { status: "uninitialized"; originalArgs?: undefined; } +> : ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^ +>slice : { useTestQuery: () => { status: "uninitialized"; originalArgs?: undefined; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^ + diff --git a/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.js b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.js new file mode 100644 index 0000000000000..e677e091d747e --- /dev/null +++ b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.js @@ -0,0 +1,48 @@ +//// [tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.ts] //// + +//// [createApi.ts] +type Id = { + [K in keyof T]: T[K]; +} & {}; + +export declare function createApi(_: { endpoints: Definitions }): { + [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ + status: "uninitialized"; + originalArgs?: any[]; + }>; +}; + +//// [index.ts] +import { createApi } from "./createApi"; + +const slice = createApi({ + endpoints: { + test: { + url: `/user`, + }, + }, +}); + +export const { useTestQuery } = slice; + + + + +//// [createApi.d.ts] +type Id = { + [K in keyof T]: T[K]; +} & {}; +export declare function createApi(_: { + endpoints: Definitions; +}): { + [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ + status: "uninitialized"; + originalArgs?: any[]; + }>; +}; +export {}; +//// [index.d.ts] +export declare const useTestQuery: () => { + status: "uninitialized"; + originalArgs?: any[]; +}; diff --git a/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.symbols b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.symbols new file mode 100644 index 0000000000000..cca1208d49189 --- /dev/null +++ b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.symbols @@ -0,0 +1,63 @@ +//// [tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.ts] //// + +=== createApi.ts === +type Id = { +>Id : Symbol(Id, Decl(createApi.ts, 0, 0)) +>T : Symbol(T, Decl(createApi.ts, 0, 8)) + + [K in keyof T]: T[K]; +>K : Symbol(K, Decl(createApi.ts, 1, 3)) +>T : Symbol(T, Decl(createApi.ts, 0, 8)) +>T : Symbol(T, Decl(createApi.ts, 0, 8)) +>K : Symbol(K, Decl(createApi.ts, 1, 3)) + +} & {}; + +export declare function createApi(_: { endpoints: Definitions }): { +>createApi : Symbol(createApi, Decl(createApi.ts, 2, 7)) +>Definitions : Symbol(Definitions, Decl(createApi.ts, 4, 34)) +>_ : Symbol(_, Decl(createApi.ts, 4, 47)) +>endpoints : Symbol(endpoints, Decl(createApi.ts, 4, 51)) +>Definitions : Symbol(Definitions, Decl(createApi.ts, 4, 34)) + + [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ +>K : Symbol(K, Decl(createApi.ts, 5, 3)) +>Definitions : Symbol(Definitions, Decl(createApi.ts, 4, 34)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) +>K : Symbol(K, Decl(createApi.ts, 5, 3)) +>Id : Symbol(Id, Decl(createApi.ts, 0, 0)) + + status: "uninitialized"; +>status : Symbol(status, Decl(createApi.ts, 5, 77)) + + originalArgs?: any[]; +>originalArgs : Symbol(originalArgs, Decl(createApi.ts, 6, 28)) + + }>; +}; + +=== index.ts === +import { createApi } from "./createApi"; +>createApi : Symbol(createApi, Decl(index.ts, 0, 8)) + +const slice = createApi({ +>slice : Symbol(slice, Decl(index.ts, 2, 5)) +>createApi : Symbol(createApi, Decl(index.ts, 0, 8)) + + endpoints: { +>endpoints : Symbol(endpoints, Decl(index.ts, 2, 25)) + + test: { +>test : Symbol(test, Decl(index.ts, 3, 14)) + + url: `/user`, +>url : Symbol(url, Decl(index.ts, 4, 11)) + + }, + }, +}); + +export const { useTestQuery } = slice; +>useTestQuery : Symbol(useTestQuery, Decl(index.ts, 10, 14)) +>slice : Symbol(slice, Decl(index.ts, 2, 5)) + diff --git a/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.types b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.types new file mode 100644 index 0000000000000..c6b38f9716c0a --- /dev/null +++ b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.types @@ -0,0 +1,73 @@ +//// [tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.ts] //// + +=== createApi.ts === +type Id = { +>Id : { [K in keyof T]: T[K]; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^ + + [K in keyof T]: T[K]; +} & {}; + +export declare function createApi(_: { endpoints: Definitions }): { +>createApi : (_: { endpoints: Definitions; }) => { [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ status: "uninitialized"; originalArgs?: any[]; }>; } +> : ^ ^^ ^^ ^^^^^ +>_ : { endpoints: Definitions; } +> : ^^^^^^^^^^^^^ ^^^ +>endpoints : Definitions +> : ^^^^^^^^^^^ + + [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ + status: "uninitialized"; +>status : "uninitialized" +> : ^^^^^^^^^^^^^^^ + + originalArgs?: any[]; +>originalArgs : any[] +> : ^^^^^ + + }>; +}; + +=== index.ts === +import { createApi } from "./createApi"; +>createApi : (_: { endpoints: Definitions; }) => { [K in keyof Definitions as `use${Capitalize}Query`]: () => { status: "uninitialized"; originalArgs?: any[]; }; } +> : ^ ^^ ^^ ^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^ + +const slice = createApi({ +>slice : { useTestQuery: () => { status: "uninitialized"; originalArgs?: any[]; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^ +>createApi({ endpoints: { test: { url: `/user`, }, },}) : { useTestQuery: () => { status: "uninitialized"; originalArgs?: any[]; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^ +>createApi : (_: { endpoints: Definitions; }) => { [K in keyof Definitions as `use${Capitalize}Query`]: () => { status: "uninitialized"; originalArgs?: any[]; }; } +> : ^ ^^ ^^ ^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^ +>{ endpoints: { test: { url: `/user`, }, },} : { endpoints: { test: { url: string; }; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + endpoints: { +>endpoints : { test: { url: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ test: { url: `/user`, }, } : { test: { url: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + test: { +>test : { url: string; } +> : ^^^^^^^^^^^^^^^^ +>{ url: `/user`, } : { url: string; } +> : ^^^^^^^^^^^^^^^^ + + url: `/user`, +>url : string +> : ^^^^^^ +>`/user` : "/user" +> : ^^^^^^^ + + }, + }, +}); + +export const { useTestQuery } = slice; +>useTestQuery : () => { status: "uninitialized"; originalArgs?: any[]; } +> : ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^ +>slice : { useTestQuery: () => { status: "uninitialized"; originalArgs?: any[]; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^ + diff --git a/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.js b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.js new file mode 100644 index 0000000000000..6e11f34b52877 --- /dev/null +++ b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.js @@ -0,0 +1,48 @@ +//// [tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.ts] //// + +//// [createApi.ts] +type Id = { + [K in keyof T]: T[K]; +} & {}; + +export declare function createApi(_: { endpoints: Definitions }): { + [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ + status: "uninitialized"; + originalArgs?: never; + }>; +}; + +//// [index.ts] +import { createApi } from "./createApi"; + +const slice = createApi({ + endpoints: { + test: { + url: `/user`, + }, + }, +}); + +export const { useTestQuery } = slice; + + + + +//// [createApi.d.ts] +type Id = { + [K in keyof T]: T[K]; +} & {}; +export declare function createApi(_: { + endpoints: Definitions; +}): { + [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ + status: "uninitialized"; + originalArgs?: never; + }>; +}; +export {}; +//// [index.d.ts] +export declare const useTestQuery: () => { + status: "uninitialized"; + originalArgs?: never; +}; diff --git a/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.symbols b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.symbols new file mode 100644 index 0000000000000..bf7ad1bab1421 --- /dev/null +++ b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.symbols @@ -0,0 +1,63 @@ +//// [tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.ts] //// + +=== createApi.ts === +type Id = { +>Id : Symbol(Id, Decl(createApi.ts, 0, 0)) +>T : Symbol(T, Decl(createApi.ts, 0, 8)) + + [K in keyof T]: T[K]; +>K : Symbol(K, Decl(createApi.ts, 1, 3)) +>T : Symbol(T, Decl(createApi.ts, 0, 8)) +>T : Symbol(T, Decl(createApi.ts, 0, 8)) +>K : Symbol(K, Decl(createApi.ts, 1, 3)) + +} & {}; + +export declare function createApi(_: { endpoints: Definitions }): { +>createApi : Symbol(createApi, Decl(createApi.ts, 2, 7)) +>Definitions : Symbol(Definitions, Decl(createApi.ts, 4, 34)) +>_ : Symbol(_, Decl(createApi.ts, 4, 47)) +>endpoints : Symbol(endpoints, Decl(createApi.ts, 4, 51)) +>Definitions : Symbol(Definitions, Decl(createApi.ts, 4, 34)) + + [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ +>K : Symbol(K, Decl(createApi.ts, 5, 3)) +>Definitions : Symbol(Definitions, Decl(createApi.ts, 4, 34)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) +>K : Symbol(K, Decl(createApi.ts, 5, 3)) +>Id : Symbol(Id, Decl(createApi.ts, 0, 0)) + + status: "uninitialized"; +>status : Symbol(status, Decl(createApi.ts, 5, 77)) + + originalArgs?: never; +>originalArgs : Symbol(originalArgs, Decl(createApi.ts, 6, 28)) + + }>; +}; + +=== index.ts === +import { createApi } from "./createApi"; +>createApi : Symbol(createApi, Decl(index.ts, 0, 8)) + +const slice = createApi({ +>slice : Symbol(slice, Decl(index.ts, 2, 5)) +>createApi : Symbol(createApi, Decl(index.ts, 0, 8)) + + endpoints: { +>endpoints : Symbol(endpoints, Decl(index.ts, 2, 25)) + + test: { +>test : Symbol(test, Decl(index.ts, 3, 14)) + + url: `/user`, +>url : Symbol(url, Decl(index.ts, 4, 11)) + + }, + }, +}); + +export const { useTestQuery } = slice; +>useTestQuery : Symbol(useTestQuery, Decl(index.ts, 10, 14)) +>slice : Symbol(slice, Decl(index.ts, 2, 5)) + diff --git a/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.types b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.types new file mode 100644 index 0000000000000..f1bd8df7f79f6 --- /dev/null +++ b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.types @@ -0,0 +1,73 @@ +//// [tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.ts] //// + +=== createApi.ts === +type Id = { +>Id : { [K in keyof T]: T[K]; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^ + + [K in keyof T]: T[K]; +} & {}; + +export declare function createApi(_: { endpoints: Definitions }): { +>createApi : (_: { endpoints: Definitions; }) => { [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ status: "uninitialized"; originalArgs?: never; }>; } +> : ^ ^^ ^^ ^^^^^ +>_ : { endpoints: Definitions; } +> : ^^^^^^^^^^^^^ ^^^ +>endpoints : Definitions +> : ^^^^^^^^^^^ + + [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ + status: "uninitialized"; +>status : "uninitialized" +> : ^^^^^^^^^^^^^^^ + + originalArgs?: never; +>originalArgs : never +> : ^^^^^ + + }>; +}; + +=== index.ts === +import { createApi } from "./createApi"; +>createApi : (_: { endpoints: Definitions; }) => { [K in keyof Definitions as `use${Capitalize}Query`]: () => { status: "uninitialized"; originalArgs?: never; }; } +> : ^ ^^ ^^ ^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^ + +const slice = createApi({ +>slice : { useTestQuery: () => { status: "uninitialized"; originalArgs?: never; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^ +>createApi({ endpoints: { test: { url: `/user`, }, },}) : { useTestQuery: () => { status: "uninitialized"; originalArgs?: never; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^ +>createApi : (_: { endpoints: Definitions; }) => { [K in keyof Definitions as `use${Capitalize}Query`]: () => { status: "uninitialized"; originalArgs?: never; }; } +> : ^ ^^ ^^ ^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^ +>{ endpoints: { test: { url: `/user`, }, },} : { endpoints: { test: { url: string; }; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + endpoints: { +>endpoints : { test: { url: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ test: { url: `/user`, }, } : { test: { url: string; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + test: { +>test : { url: string; } +> : ^^^^^^^^^^^^^^^^ +>{ url: `/user`, } : { url: string; } +> : ^^^^^^^^^^^^^^^^ + + url: `/user`, +>url : string +> : ^^^^^^ +>`/user` : "/user" +> : ^^^^^^^ + + }, + }, +}); + +export const { useTestQuery } = slice; +>useTestQuery : () => { status: "uninitialized"; originalArgs?: never; } +> : ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^ +>slice : { useTestQuery: () => { status: "uninitialized"; originalArgs?: never; }; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^ + diff --git a/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.js b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.js new file mode 100644 index 0000000000000..4f4ef2d3066e1 --- /dev/null +++ b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.js @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts] //// + +//// [declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts] +type InputType = { enable_member_receipts?: boolean }; +type AsEmptyObject = { [K in keyof T]?: undefined }; + +export const test = { + ...({} as AsEmptyObject), +}; + + + + +//// [declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.d.ts] +export declare const test: { + enable_member_receipts?: undefined; +}; diff --git a/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.symbols b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.symbols new file mode 100644 index 0000000000000..b032cfac5e39b --- /dev/null +++ b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.symbols @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts] //// + +=== declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts === +type InputType = { enable_member_receipts?: boolean }; +>InputType : Symbol(InputType, Decl(declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts, 0, 0)) +>enable_member_receipts : Symbol(enable_member_receipts, Decl(declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts, 0, 18)) + +type AsEmptyObject = { [K in keyof T]?: undefined }; +>AsEmptyObject : Symbol(AsEmptyObject, Decl(declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts, 0, 54)) +>T : Symbol(T, Decl(declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts, 1, 19)) +>K : Symbol(K, Decl(declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts, 1, 27)) +>T : Symbol(T, Decl(declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts, 1, 19)) + +export const test = { +>test : Symbol(test, Decl(declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts, 3, 12)) + + ...({} as AsEmptyObject), +>AsEmptyObject : Symbol(AsEmptyObject, Decl(declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts, 0, 54)) +>InputType : Symbol(InputType, Decl(declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts, 0, 0)) + +}; + diff --git a/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.types b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.types new file mode 100644 index 0000000000000..9f902fa6dda7f --- /dev/null +++ b/tests/baselines/reference/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.types @@ -0,0 +1,29 @@ +//// [tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts] //// + +=== declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts === +type InputType = { enable_member_receipts?: boolean }; +>InputType : InputType +> : ^^^^^^^^^ +>enable_member_receipts : boolean +> : ^^^^^^^ + +type AsEmptyObject = { [K in keyof T]?: undefined }; +>AsEmptyObject : AsEmptyObject +> : ^^^^^^^^^^^^^^^^ + +export const test = { +>test : { enable_member_receipts?: undefined; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ ...({} as AsEmptyObject),} : { enable_member_receipts?: undefined; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + ...({} as AsEmptyObject), +>({} as AsEmptyObject) : AsEmptyObject +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>{} as AsEmptyObject : AsEmptyObject +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>{} : {} +> : ^^ + +}; + diff --git a/tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.ts b/tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.ts new file mode 100644 index 0000000000000..8f0f6b5ae9bfb --- /dev/null +++ b/tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks1.ts @@ -0,0 +1,30 @@ +// @strictNullChecks: false +// @declaration: true +// @emitDeclarationOnly: true + +// @filename: createApi.ts + +type Id = { + [K in keyof T]: T[K]; +} & {}; + +export declare function createApi(_: { endpoints: Definitions }): { + [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ + status: "uninitialized"; + originalArgs?: undefined; + }>; +}; + +// @filename: index.ts + +import { createApi } from "./createApi"; + +const slice = createApi({ + endpoints: { + test: { + url: `/user`, + }, + }, +}); + +export const { useTestQuery } = slice; diff --git a/tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.ts b/tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.ts new file mode 100644 index 0000000000000..5add666bcbabe --- /dev/null +++ b/tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks2.ts @@ -0,0 +1,30 @@ +// @strictNullChecks: false +// @declaration: true +// @emitDeclarationOnly: true + +// @filename: createApi.ts + +type Id = { + [K in keyof T]: T[K]; +} & {}; + +export declare function createApi(_: { endpoints: Definitions }): { + [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ + status: "uninitialized"; + originalArgs?: any[]; + }>; +}; + +// @filename: index.ts + +import { createApi } from "./createApi"; + +const slice = createApi({ + endpoints: { + test: { + url: `/user`, + }, + }, +}); + +export const { useTestQuery } = slice; diff --git a/tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.ts b/tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.ts new file mode 100644 index 0000000000000..b9320bc838046 --- /dev/null +++ b/tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks3.ts @@ -0,0 +1,30 @@ +// @strictNullChecks: false +// @declaration: true +// @emitDeclarationOnly: true + +// @filename: createApi.ts + +type Id = { + [K in keyof T]: T[K]; +} & {}; + +export declare function createApi(_: { endpoints: Definitions }): { + [K in keyof Definitions as `use${Capitalize}Query`]: () => Id<{ + status: "uninitialized"; + originalArgs?: never; + }>; +}; + +// @filename: index.ts + +import { createApi } from "./createApi"; + +const slice = createApi({ + endpoints: { + test: { + url: `/user`, + }, + }, +}); + +export const { useTestQuery } = slice; diff --git a/tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts b/tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts new file mode 100644 index 0000000000000..170989a6b8d4a --- /dev/null +++ b/tests/cases/compiler/declarationEmitOptionalMappedTypePropertyNoStrictNullChecks4.ts @@ -0,0 +1,10 @@ +// @strictNullChecks: false +// @declaration: true +// @emitDeclarationOnly: true + +type InputType = { enable_member_receipts?: boolean }; +type AsEmptyObject = { [K in keyof T]?: undefined }; + +export const test = { + ...({} as AsEmptyObject), +}; From 56a08250f3516b3f5bc120d6c7ab4450a9a69352 Mon Sep 17 00:00:00 2001 From: "CSIGS@microsoft.com" Date: Thu, 19 Dec 2024 12:59:24 -0800 Subject: [PATCH 32/46] LEGO: Pull request from lego/hb_5378966c-b857-470a-8675-daebef4a6da1_20241219202405650 to main (#60826) --- .../diagnosticMessages.generated.json.lcl | 49 ++++++++++--------- .../diagnosticMessages.generated.json.lcl | 49 ++++++++++--------- .../diagnosticMessages.generated.json.lcl | 49 ++++++++++--------- .../diagnosticMessages.generated.json.lcl | 49 ++++++++++--------- .../diagnosticMessages.generated.json.lcl | 49 ++++++++++--------- 5 files changed, 130 insertions(+), 115 deletions(-) diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl index 71adee214090b..7cf351b4a47a4 100644 --- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5996,12 +5996,12 @@ - + - + - + @@ -6015,11 +6015,11 @@ - + - + - + @@ -8229,11 +8229,11 @@ - + - + - + @@ -8274,11 +8274,11 @@ - + - + - + @@ -14393,12 +14393,12 @@ - + - + - + @@ -15641,22 +15641,25 @@ - + - + - + - + - + + + + @@ -15671,12 +15674,12 @@ - + - + - + diff --git a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl index 4be73d92563f7..6962aab855863 100644 --- a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5993,12 +5993,12 @@ - + - + - + @@ -6012,11 +6012,11 @@ - + - + - + @@ -8226,11 +8226,11 @@ - + - + - + @@ -8271,11 +8271,11 @@ - + - + - + @@ -14387,12 +14387,12 @@ - + - + - + @@ -15635,22 +15635,25 @@ - + - + - + - + - + + + + @@ -15665,12 +15668,12 @@ - + - + - + diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl index 01dc6066a97aa..d85488288a3ad 100644 --- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5996,12 +5996,12 @@ - + - + - + @@ -6015,11 +6015,11 @@ - + - + - + @@ -8229,11 +8229,11 @@ - + - + - + @@ -8274,11 +8274,11 @@ - + - + - + @@ -14393,12 +14393,12 @@ - + - + - + @@ -15641,22 +15641,25 @@ - + - + - + - + - + + + + @@ -15671,12 +15674,12 @@ - + - + - + diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl index cc93b6cf76364..c138892ef4621 100644 --- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5989,12 +5989,12 @@ - + - + - + @@ -6008,11 +6008,11 @@ - + - + - + @@ -8222,11 +8222,11 @@ - + - + - + @@ -8267,11 +8267,11 @@ - + - + - + @@ -14383,12 +14383,12 @@ - + - + - + @@ -15631,22 +15631,25 @@ - + - + - + - + - + + + + @@ -15661,12 +15664,12 @@ - + - + - + diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl index a673e66cb10cc..441b94f5704c0 100644 --- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5995,12 +5995,12 @@ - + - + - + @@ -6014,11 +6014,11 @@ - + - + - + @@ -8228,11 +8228,11 @@ - + - + - + @@ -8273,11 +8273,11 @@ - + - + - + @@ -14392,12 +14392,12 @@ - + - + - + @@ -15640,22 +15640,25 @@ - + - + - + - + - + + + + @@ -15670,12 +15673,12 @@ - + - + - + From 21c1a61b49082915f93e3327dad0d73205cf4273 Mon Sep 17 00:00:00 2001 From: "CSIGS@microsoft.com" Date: Thu, 2 Jan 2025 18:02:45 -0800 Subject: [PATCH 33/46] LEGO: Pull request from lego/hb_5378966c-b857-470a-8675-daebef4a6da1_20241220203953707 to main (#60833) --- .../diagnosticMessages.generated.json.lcl | 49 ++++++++++--------- .../diagnosticMessages.generated.json.lcl | 49 ++++++++++--------- .../diagnosticMessages.generated.json.lcl | 49 ++++++++++--------- .../diagnosticMessages.generated.json.lcl | 49 ++++++++++--------- .../diagnosticMessages.generated.json.lcl | 49 ++++++++++--------- .../diagnosticMessages.generated.json.lcl | 49 ++++++++++--------- .../diagnosticMessages.generated.json.lcl | 49 ++++++++++--------- .../diagnosticMessages.generated.json.lcl | 49 ++++++++++--------- 8 files changed, 208 insertions(+), 184 deletions(-) diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl index 692ffb1f4d55c..0f2e82e58768e 100644 --- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5996,12 +5996,12 @@ - + - + - + @@ -6015,11 +6015,11 @@ - + - + - + @@ -8229,11 +8229,11 @@ - + - + - + @@ -8274,11 +8274,11 @@ - + - + - + @@ -14393,12 +14393,12 @@ - + - + - + @@ -15641,22 +15641,25 @@ - + - + - + - + - + + + + @@ -15671,12 +15674,12 @@ - + - + - + diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl index adb2e9db074c2..f00bde01f30af 100644 --- a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -6005,12 +6005,12 @@ - + - + - + @@ -6024,11 +6024,11 @@ - + - + - + @@ -8238,11 +8238,11 @@ - + - + - + @@ -8283,11 +8283,11 @@ - + - + - + @@ -14402,12 +14402,12 @@ - + - + - + @@ -15650,22 +15650,25 @@ - + - + - + - + - + + + + @@ -15680,12 +15683,12 @@ - + - + - + diff --git a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl index 18185349b7bd0..9a3fae0b0f4a9 100644 --- a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -6008,12 +6008,12 @@ - + - + - + @@ -6027,11 +6027,11 @@ - + - + - + @@ -8241,11 +8241,11 @@ - + - + - + @@ -8286,11 +8286,11 @@ - + - + - + @@ -14405,12 +14405,12 @@ - + - + - + @@ -15653,22 +15653,25 @@ - + - + - + - + - + + + + @@ -15683,12 +15686,12 @@ - + - + - + diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl index 0ad04f3a8f725..016f07569c64d 100644 --- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -6008,12 +6008,12 @@ - + - + - + @@ -6027,11 +6027,11 @@ - + - + - + @@ -8241,11 +8241,11 @@ - + - + - + @@ -8286,11 +8286,11 @@ - + - + - + @@ -14405,12 +14405,12 @@ - + - + - + @@ -15653,22 +15653,25 @@ - + - + - + - + - + + + + @@ -15683,12 +15686,12 @@ - + - + - + diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl index 0740a0f3970b9..9b0040614c214 100644 --- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5996,12 +5996,12 @@ - + - + - + @@ -6015,11 +6015,11 @@ - + - + - + @@ -8229,11 +8229,11 @@ - + - + - + @@ -8274,11 +8274,11 @@ - + - + - + @@ -14393,12 +14393,12 @@ - + - + - + @@ -15641,22 +15641,25 @@ - + - + - + - + - + + + + @@ -15671,12 +15674,12 @@ - + - + - + diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl index ccd553cb14823..eec1f16743b93 100644 --- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5996,12 +5996,12 @@ - + - + - + @@ -6015,11 +6015,11 @@ - + - + - + @@ -8229,11 +8229,11 @@ - + - + - + @@ -8274,11 +8274,11 @@ - + - + - + @@ -14393,12 +14393,12 @@ - + - + - + @@ -15641,22 +15641,25 @@ - + - + - + - + - + + + + @@ -15671,12 +15674,12 @@ - + - + - + diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 1e97161836c92..335dff5e5b6ad 100644 --- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5986,12 +5986,12 @@ - + - + - + @@ -6005,11 +6005,11 @@ - + - + - + @@ -8219,11 +8219,11 @@ - + - + - + @@ -8264,11 +8264,11 @@ - + - + - + @@ -14380,12 +14380,12 @@ - + - + - + @@ -15628,22 +15628,25 @@ - + - + - + - + - + + + + @@ -15658,12 +15661,12 @@ - + - + - + diff --git a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 2253ce7f3a07a..1b27a13a52369 100644 --- a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5989,12 +5989,12 @@ - + - + - + @@ -6008,11 +6008,11 @@ - + - + - + @@ -8222,11 +8222,11 @@ - + - + - + @@ -8267,11 +8267,11 @@ - + - + - + @@ -14386,12 +14386,12 @@ - + - + - + @@ -15634,22 +15634,25 @@ - + - + - + - + - + + + + @@ -15664,12 +15667,12 @@ - + - + - + From d49b89618058b028a65ba5d9a04886e9d0928840 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 11:32:54 -0800 Subject: [PATCH 34/46] Bump the github-actions group across 1 directory with 3 updates (#60844) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 6 +++--- .github/workflows/codeql.yml | 6 +++--- .github/workflows/release-branch-artifact.yaml | 2 +- .github/workflows/scorecard.yml | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf4169e329aff..4141cc512e5cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,12 +90,12 @@ jobs: run: npm test -- --no-lint --coverage - name: Upload coverage artifact - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 with: name: coverage path: coverage - - uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1 + - uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2 with: use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }} disable_search: true @@ -334,7 +334,7 @@ jobs: - name: Upload baseline diff artifact if: ${{ failure() && steps.check-baselines.conclusion == 'failure' }} - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 with: name: fix_baselines.patch path: fix_baselines.patch diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index eaf86b3ed4bd6..a727b884d21ae 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -46,7 +46,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 + uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 with: config-file: ./.github/codeql/codeql-configuration.yml # Override language selection by uncommenting this and choosing your languages @@ -56,7 +56,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below). - name: Autobuild - uses: github/codeql-action/autobuild@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 + uses: github/codeql-action/autobuild@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -70,4 +70,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 + uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 diff --git a/.github/workflows/release-branch-artifact.yaml b/.github/workflows/release-branch-artifact.yaml index 8ccdfb282043a..3b91ae5a2f3dc 100644 --- a/.github/workflows/release-branch-artifact.yaml +++ b/.github/workflows/release-branch-artifact.yaml @@ -44,7 +44,7 @@ jobs: npm pack ./ mv typescript-*.tgz typescript.tgz - name: Upload built tarfile - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 with: name: tgz path: typescript.tgz diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 0d3ec6648a560..e3e43e4fc0d22 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -47,7 +47,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: 'Upload artifact' - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 with: name: SARIF file path: results.sarif @@ -55,6 +55,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: 'Upload to code-scanning' - uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 + uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 with: sarif_file: results.sarif From c0b3ff2da1a5c1480710a81a994659ea706af484 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:35:43 -0800 Subject: [PATCH 35/46] Fix CodeQL configuration, releases (#60828) --- .github/codeql/codeql-configuration.yml | 5 +---- azure-pipelines.release.yml | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/codeql/codeql-configuration.yml b/.github/codeql/codeql-configuration.yml index 5012a8c080e48..dbe5b23a53c56 100644 --- a/.github/codeql/codeql-configuration.yml +++ b/.github/codeql/codeql-configuration.yml @@ -1,8 +1,5 @@ name: CodeQL Configuration -paths: - - src - - scripts - - Herebyfile.mjs paths-ignore: - src/lib + - tests diff --git a/azure-pipelines.release.yml b/azure-pipelines.release.yml index 64e2da5f5b8e8..fdf1415501094 100644 --- a/azure-pipelines.release.yml +++ b/azure-pipelines.release.yml @@ -10,6 +10,9 @@ resources: name: 1ESPipelineTemplates/1ESPipelineTemplates ref: refs/tags/release +variables: + Codeql.InitParameters: '--codescanning-config=$(Build.SourcesDirectory)/.github/codeql/codeql-configuration.yml' + extends: template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines parameters: From a5196c7d3bdb9e7e1e4e0268e4a5817d6282aaa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Tue, 7 Jan 2025 21:26:00 +0100 Subject: [PATCH 36/46] Narrow types by typeof operands with extra parenthesis (#60928) --- src/compiler/binder.ts | 8 +-- .../narrowingTypeofParenthesized1.symbols | 30 +++++++++++ .../narrowingTypeofParenthesized1.types | 53 +++++++++++++++++++ .../compiler/narrowingTypeofParenthesized1.ts | 18 +++++++ 4 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 tests/baselines/reference/narrowingTypeofParenthesized1.symbols create mode 100644 tests/baselines/reference/narrowingTypeofParenthesized1.types create mode 100644 tests/cases/compiler/narrowingTypeofParenthesized1.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 41966df6672e9..b07a0a075080e 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -1318,9 +1318,11 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { case SyntaxKind.ExclamationEqualsToken: case SyntaxKind.EqualsEqualsEqualsToken: case SyntaxKind.ExclamationEqualsEqualsToken: - return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || - isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) || - (isBooleanLiteral(expr.right) && isNarrowingExpression(expr.left) || isBooleanLiteral(expr.left) && isNarrowingExpression(expr.right)); + const left = skipParentheses(expr.left); + const right = skipParentheses(expr.right); + return isNarrowableOperand(left) || isNarrowableOperand(right) || + isNarrowingTypeofOperands(right, left) || isNarrowingTypeofOperands(left, right) || + (isBooleanLiteral(right) && isNarrowingExpression(left) || isBooleanLiteral(left) && isNarrowingExpression(right)); case SyntaxKind.InstanceOfKeyword: return isNarrowableOperand(expr.left); case SyntaxKind.InKeyword: diff --git a/tests/baselines/reference/narrowingTypeofParenthesized1.symbols b/tests/baselines/reference/narrowingTypeofParenthesized1.symbols new file mode 100644 index 0000000000000..a24be2e1c7519 --- /dev/null +++ b/tests/baselines/reference/narrowingTypeofParenthesized1.symbols @@ -0,0 +1,30 @@ +//// [tests/cases/compiler/narrowingTypeofParenthesized1.ts] //// + +=== narrowingTypeofParenthesized1.ts === +// https://github.com/microsoft/TypeScript/issues/42203 + +declare const foo: string; +>foo : Symbol(foo, Decl(narrowingTypeofParenthesized1.ts, 2, 13)) + +if ((typeof foo) === "string") { +>foo : Symbol(foo, Decl(narrowingTypeofParenthesized1.ts, 2, 13)) + + foo; +>foo : Symbol(foo, Decl(narrowingTypeofParenthesized1.ts, 2, 13)) + +} else { + foo; +>foo : Symbol(foo, Decl(narrowingTypeofParenthesized1.ts, 2, 13)) +} + +if (typeof foo === ("string")) { +>foo : Symbol(foo, Decl(narrowingTypeofParenthesized1.ts, 2, 13)) + + foo; +>foo : Symbol(foo, Decl(narrowingTypeofParenthesized1.ts, 2, 13)) + +} else { + foo; +>foo : Symbol(foo, Decl(narrowingTypeofParenthesized1.ts, 2, 13)) +} + diff --git a/tests/baselines/reference/narrowingTypeofParenthesized1.types b/tests/baselines/reference/narrowingTypeofParenthesized1.types new file mode 100644 index 0000000000000..423d7bfc23f2f --- /dev/null +++ b/tests/baselines/reference/narrowingTypeofParenthesized1.types @@ -0,0 +1,53 @@ +//// [tests/cases/compiler/narrowingTypeofParenthesized1.ts] //// + +=== narrowingTypeofParenthesized1.ts === +// https://github.com/microsoft/TypeScript/issues/42203 + +declare const foo: string; +>foo : string +> : ^^^^^^ + +if ((typeof foo) === "string") { +>(typeof foo) === "string" : boolean +> : ^^^^^^^ +>(typeof foo) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>typeof foo : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>foo : string +> : ^^^^^^ +>"string" : "string" +> : ^^^^^^^^ + + foo; +>foo : string +> : ^^^^^^ + +} else { + foo; +>foo : never +> : ^^^^^ +} + +if (typeof foo === ("string")) { +>typeof foo === ("string") : boolean +> : ^^^^^^^ +>typeof foo : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>foo : string +> : ^^^^^^ +>("string") : "string" +> : ^^^^^^^^ +>"string" : "string" +> : ^^^^^^^^ + + foo; +>foo : string +> : ^^^^^^ + +} else { + foo; +>foo : never +> : ^^^^^ +} + diff --git a/tests/cases/compiler/narrowingTypeofParenthesized1.ts b/tests/cases/compiler/narrowingTypeofParenthesized1.ts new file mode 100644 index 0000000000000..abdc5b4bc6851 --- /dev/null +++ b/tests/cases/compiler/narrowingTypeofParenthesized1.ts @@ -0,0 +1,18 @@ +// @strict: true +// @noEmit: true + +// https://github.com/microsoft/TypeScript/issues/42203 + +declare const foo: string; + +if ((typeof foo) === "string") { + foo; +} else { + foo; +} + +if (typeof foo === ("string")) { + foo; +} else { + foo; +} From 717d05cc2d528deb51cf7785bdd71891935d19a8 Mon Sep 17 00:00:00 2001 From: Armando Aguirre Date: Tue, 7 Jan 2025 15:58:37 -0800 Subject: [PATCH 37/46] Fixed BADCLIENT error message (#60925) Co-authored-by: Armando Aguirre Sepulveda --- src/server/session.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/server/session.ts b/src/server/session.ts index 1019a44d85642..120f043e2e83c 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -3058,20 +3058,21 @@ export class Session implements EventSender { codeActions = project.getLanguageService().getCodeFixesAtPosition(file, startPosition, endPosition, args.errorCodes, this.getFormatOptions(file), this.getPreferences(file)); } catch (e) { + const error = e instanceof Error ? e : new Error(e); + const ls = project.getLanguageService(); const existingDiagCodes = [ ...ls.getSyntacticDiagnostics(file), ...ls.getSemanticDiagnostics(file), ...ls.getSuggestionDiagnostics(file), - ].map(d => - decodedTextSpanIntersectsWith(startPosition, endPosition - startPosition, d.start!, d.length!) - && d.code - ); + ] + .filter(d => decodedTextSpanIntersectsWith(startPosition, endPosition - startPosition, d.start!, d.length!)) + .map(d => d.code); const badCode = args.errorCodes.find(c => !existingDiagCodes.includes(c)); if (badCode !== undefined) { - e.message = `BADCLIENT: Bad error code, ${badCode} not found in range ${startPosition}..${endPosition} (found: ${existingDiagCodes.join(", ")}); could have caused this error:\n${e.message}`; + error.message += `\nAdditional information: BADCLIENT: Bad error code, ${badCode} not found in range ${startPosition}..${endPosition} (found: ${existingDiagCodes.join(", ")})`; } - throw e; + throw error; } return simplifiedResult ? codeActions.map(codeAction => this.mapCodeFixAction(codeAction)) : codeActions; } From e1cef5fa3a616bd800fa5e23c2312fc9f951e59f Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Wed, 8 Jan 2025 15:15:35 -0800 Subject: [PATCH 38/46] Fix GHA badge in readme (#60937) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3314c58f49221..b6505f7362b63 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # TypeScript -[![GitHub Actions CI](https://github.com/microsoft/TypeScript/workflows/CI/badge.svg)](https://github.com/microsoft/TypeScript/actions?query=workflow%3ACI) +[![CI](https://github.com/microsoft/TypeScript/actions/workflows/ci.yml/badge.svg)](https://github.com/microsoft/TypeScript/actions/workflows/ci.yml) [![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript) [![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/microsoft/TypeScript/badge)](https://securityscorecards.dev/viewer/?uri=github.com/microsoft/TypeScript) From e9738050cf896a9c08d1d3d911f304513f80b76a Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Thu, 9 Jan 2025 11:36:08 -0800 Subject: [PATCH 39/46] Write path normalization without array allocations (#60812) --- src/compiler/path.ts | 112 ++++++++++++++++++++++++++++-- src/testRunner/unittests/paths.ts | 15 ++++ 2 files changed, 121 insertions(+), 6 deletions(-) diff --git a/src/compiler/path.ts b/src/compiler/path.ts index b05216adc47b5..a06359d51e549 100644 --- a/src/compiler/path.ts +++ b/src/compiler/path.ts @@ -624,28 +624,128 @@ export function getNormalizedPathComponents(path: string, currentDirectory: stri } /** @internal */ -export function getNormalizedAbsolutePath(fileName: string, currentDirectory: string | undefined): string { - return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); +export function getNormalizedAbsolutePath(path: string, currentDirectory: string | undefined): string { + let rootLength = getRootLength(path); + if (rootLength === 0 && currentDirectory) { + path = combinePaths(currentDirectory, path); + rootLength = getRootLength(path); + } + else { + // combinePaths normalizes slashes, so not necessary in the other branch + path = normalizeSlashes(path); + } + + const simpleNormalized = simpleNormalizePath(path); + if (simpleNormalized !== undefined) { + return simpleNormalized.length > rootLength ? removeTrailingDirectorySeparator(simpleNormalized) : simpleNormalized; + } + + const length = path.length; + const root = path.substring(0, rootLength); + // `normalized` is only initialized once `path` is determined to be non-normalized + let normalized; + let index = rootLength; + let segmentStart = index; + let normalizedUpTo = index; + let seenNonDotDotSegment = rootLength !== 0; + while (index < length) { + // At beginning of segment + segmentStart = index; + let ch = path.charCodeAt(index); + while (ch === CharacterCodes.slash && index + 1 < length) { + index++; + ch = path.charCodeAt(index); + } + if (index > segmentStart) { + // Seen superfluous separator + normalized ??= path.substring(0, segmentStart - 1); + segmentStart = index; + } + // Past any superfluous separators + let segmentEnd = path.indexOf(directorySeparator, index + 1); + if (segmentEnd === -1) { + segmentEnd = length; + } + const segmentLength = segmentEnd - segmentStart; + if (segmentLength === 1 && path.charCodeAt(index) === CharacterCodes.dot) { + // "." segment (skip) + normalized ??= path.substring(0, normalizedUpTo); + } + else if (segmentLength === 2 && path.charCodeAt(index) === CharacterCodes.dot && path.charCodeAt(index + 1) === CharacterCodes.dot) { + // ".." segment + if (!seenNonDotDotSegment) { + if (normalized !== undefined) { + normalized += normalized.length === rootLength ? ".." : "/.."; + } + else { + normalizedUpTo = index + 2; + } + } + else if (normalized === undefined) { + if (normalizedUpTo - 2 >= 0) { + normalized = path.substring(0, Math.max(rootLength, path.lastIndexOf(directorySeparator, normalizedUpTo - 2))); + } + else { + normalized = path.substring(0, normalizedUpTo); + } + } + else { + const lastSlash = normalized.lastIndexOf(directorySeparator); + if (lastSlash !== -1) { + normalized = normalized.substring(0, Math.max(rootLength, lastSlash)); + } + else { + normalized = root; + } + if (normalized.length === rootLength) { + seenNonDotDotSegment = rootLength !== 0; + } + } + } + else if (normalized !== undefined) { + if (normalized.length !== rootLength) { + normalized += directorySeparator; + } + seenNonDotDotSegment = true; + normalized += path.substring(segmentStart, segmentEnd); + } + else { + seenNonDotDotSegment = true; + normalizedUpTo = segmentEnd; + } + index = segmentEnd + 1; + } + return normalized ?? (length > rootLength ? removeTrailingDirectorySeparator(path) : path); } /** @internal */ export function normalizePath(path: string): string { path = normalizeSlashes(path); + let normalized = simpleNormalizePath(path); + if (normalized !== undefined) { + return normalized; + } + normalized = getNormalizedAbsolutePath(path, ""); + return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized; +} + +function simpleNormalizePath(path: string): string | undefined { // Most paths don't require normalization if (!relativePathSegmentRegExp.test(path)) { return path; } // Some paths only require cleanup of `/./` or leading `./` - const simplified = path.replace(/\/\.\//g, "/").replace(/^\.\//, ""); + let simplified = path.replace(/\/\.\//g, "/"); + if (simplified.startsWith("./")) { + simplified = simplified.slice(2); + } if (simplified !== path) { path = simplified; if (!relativePathSegmentRegExp.test(path)) { return path; } } - // Other paths require full normalization - const normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path))); - return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized; + return undefined; } function getPathWithoutRoot(pathComponents: readonly string[]) { diff --git a/src/testRunner/unittests/paths.ts b/src/testRunner/unittests/paths.ts index e76bdc7cd26de..743e791baa181 100644 --- a/src/testRunner/unittests/paths.ts +++ b/src/testRunner/unittests/paths.ts @@ -317,9 +317,24 @@ describe("unittests:: core paths", () => { assert.strictEqual(ts.getNormalizedAbsolutePath("", ""), ""); assert.strictEqual(ts.getNormalizedAbsolutePath(".", ""), ""); assert.strictEqual(ts.getNormalizedAbsolutePath("./", ""), ""); + assert.strictEqual(ts.getNormalizedAbsolutePath("./a", ""), "a"); // Strangely, these do not normalize to the empty string. assert.strictEqual(ts.getNormalizedAbsolutePath("..", ""), ".."); assert.strictEqual(ts.getNormalizedAbsolutePath("../", ""), ".."); + assert.strictEqual(ts.getNormalizedAbsolutePath("../..", ""), "../.."); + assert.strictEqual(ts.getNormalizedAbsolutePath("../../", ""), "../.."); + assert.strictEqual(ts.getNormalizedAbsolutePath("./..", ""), ".."); + assert.strictEqual(ts.getNormalizedAbsolutePath("../../a/..", ""), "../.."); + + // More .. segments + assert.strictEqual(ts.getNormalizedAbsolutePath("src/ts/foo/../../../bar/bar.ts", ""), "bar/bar.ts"); + assert.strictEqual(ts.getNormalizedAbsolutePath("src/ts/foo/../../..", ""), ""); + // not a real URL root! + assert.strictEqual(ts.getNormalizedAbsolutePath("file:/Users/matb/projects/san/../../../../../../typings/@epic/Core.d.ts", ""), "../typings/@epic/Core.d.ts"); + // the root is `file://Users/` + assert.strictEqual(ts.getNormalizedAbsolutePath("file://Users/matb/projects/san/../../../../../../typings/@epic/Core.d.ts", ""), "file://Users/typings/@epic/Core.d.ts"); + // this is real + assert.strictEqual(ts.getNormalizedAbsolutePath("file:///Users/matb/projects/san/../../../../../../typings/@epic/Core.d.ts", ""), "file:///typings/@epic/Core.d.ts"); // Interaction between relative paths and currentDirectory. assert.strictEqual(ts.getNormalizedAbsolutePath("", "/home"), "/home"); From df54a3d6b49071d59f67f1710cc6aa91aeda6d02 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 9 Jan 2025 16:28:50 -0500 Subject: [PATCH 40/46] Add non-generic fallback overloads for TypedArray constructors (#60934) --- src/lib/es2020.bigint.d.ts | 6 ++++-- src/lib/es5.d.ts | 9 +++++++++ .../cases/compiler/typedArrayConstructorOverloads.ts | 12 +++++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/lib/es2020.bigint.d.ts b/src/lib/es2020.bigint.d.ts index 05fbbf12ce146..5a258425418ed 100644 --- a/src/lib/es2020.bigint.d.ts +++ b/src/lib/es2020.bigint.d.ts @@ -373,6 +373,7 @@ interface BigInt64ArrayConstructor { new (length?: number): BigInt64Array; new (array: ArrayLike | Iterable): BigInt64Array; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): BigInt64Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): BigInt64Array; new (array: ArrayLike | ArrayBuffer): BigInt64Array; /** The size in bytes of each element in the array. */ @@ -650,6 +651,7 @@ interface BigUint64ArrayConstructor { new (length?: number): BigUint64Array; new (array: ArrayLike | Iterable): BigUint64Array; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): BigUint64Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): BigUint64Array; new (array: ArrayLike | ArrayBuffer): BigUint64Array; /** The size in bytes of each element in the array. */ @@ -667,8 +669,8 @@ interface BigUint64ArrayConstructor { * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(arrayLike: ArrayLike): BigUint64Array; - from(arrayLike: ArrayLike, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigUint64Array; + from(arrayLike: ArrayLike): BigUint64Array; + from(arrayLike: ArrayLike, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigUint64Array; } declare var BigUint64Array: BigUint64ArrayConstructor; diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 963f6ad24f1a7..2b0b01abe2cb6 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -2103,6 +2103,7 @@ interface Int8ArrayConstructor { new (length: number): Int8Array; new (array: ArrayLike): Int8Array; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): Int8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; new (array: ArrayLike | ArrayBuffer): Int8Array; /** @@ -2384,6 +2385,7 @@ interface Uint8ArrayConstructor { new (length: number): Uint8Array; new (array: ArrayLike): Uint8Array; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): Uint8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; new (array: ArrayLike | ArrayBuffer): Uint8Array; /** @@ -2665,6 +2667,7 @@ interface Uint8ClampedArrayConstructor { new (length: number): Uint8ClampedArray; new (array: ArrayLike): Uint8ClampedArray; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray; new (array: ArrayLike | ArrayBuffer): Uint8ClampedArray; /** @@ -2945,6 +2948,7 @@ interface Int16ArrayConstructor { new (length: number): Int16Array; new (array: ArrayLike): Int16Array; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): Int16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; new (array: ArrayLike | ArrayBuffer): Int16Array; /** @@ -3226,6 +3230,7 @@ interface Uint16ArrayConstructor { new (length: number): Uint16Array; new (array: ArrayLike): Uint16Array; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): Uint16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; new (array: ArrayLike | ArrayBuffer): Uint16Array; /** @@ -3506,6 +3511,7 @@ interface Int32ArrayConstructor { new (length: number): Int32Array; new (array: ArrayLike): Int32Array; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): Int32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; new (array: ArrayLike | ArrayBuffer): Int32Array; /** @@ -3786,6 +3792,7 @@ interface Uint32ArrayConstructor { new (length: number): Uint32Array; new (array: ArrayLike): Uint32Array; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): Uint32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; new (array: ArrayLike | ArrayBuffer): Uint32Array; /** @@ -4067,6 +4074,7 @@ interface Float32ArrayConstructor { new (length: number): Float32Array; new (array: ArrayLike): Float32Array; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): Float32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; new (array: ArrayLike | ArrayBuffer): Float32Array; /** @@ -4348,6 +4356,7 @@ interface Float64ArrayConstructor { new (length: number): Float64Array; new (array: ArrayLike): Float64Array; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): Float64Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; new (array: ArrayLike | ArrayBuffer): Float64Array; /** diff --git a/tests/cases/compiler/typedArrayConstructorOverloads.ts b/tests/cases/compiler/typedArrayConstructorOverloads.ts index 0a656f7eaeb2f..c532545d39d1a 100644 --- a/tests/cases/compiler/typedArrayConstructorOverloads.ts +++ b/tests/cases/compiler/typedArrayConstructorOverloads.ts @@ -5,9 +5,19 @@ // https://github.com/microsoft/TypeScript/issues/60367 type TypedArrayConstructor = + | Int8ArrayConstructor + | Uint8ArrayConstructor + | Uint8ClampedArrayConstructor + | Int16ArrayConstructor + | Uint16ArrayConstructor + | Int32ArrayConstructor + | Uint32ArrayConstructor + | Float32ArrayConstructor | Float64ArrayConstructor | BigInt64ArrayConstructor + | BigUint64ArrayConstructor export function makeTypedArray(buffer: ArrayBuffer, ctr: TypedArrayConstructor) { - return new ctr(buffer); + new ctr(buffer); + new ctr(buffer, 0, 0); } From cbac1ddfc73ca3b9d8741c1b51b74663a0f24695 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Thu, 9 Jan 2025 17:35:20 -0800 Subject: [PATCH 41/46] Skip `verifyCompilerOptions` when possible on program updates (#60754) Co-authored-by: Daniel Rosenwasser --- src/compiler/_namespaces/ts.ts | 1 + src/compiler/program.ts | 483 ++++------------------------- src/compiler/programDiagnostics.ts | 426 +++++++++++++++++++++++++ src/compiler/types.ts | 2 + src/compiler/utilities.ts | 100 +++++- 5 files changed, 581 insertions(+), 431 deletions(-) create mode 100644 src/compiler/programDiagnostics.ts diff --git a/src/compiler/_namespaces/ts.ts b/src/compiler/_namespaces/ts.ts index 94fb16857d38e..bd9684e481982 100644 --- a/src/compiler/_namespaces/ts.ts +++ b/src/compiler/_namespaces/ts.ts @@ -61,6 +61,7 @@ export * from "../transformer.js"; export * from "../emitter.js"; export * from "../watchUtilities.js"; export * from "../program.js"; +export * from "../programDiagnostics.js"; export * from "../builderStatePublic.js"; export * from "../builderState.js"; export * from "../builder.js"; diff --git a/src/compiler/program.ts b/src/compiler/program.ts index fbb0145507ce0..96fad44852c62 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -33,17 +33,16 @@ import { createCommentDirectivesMap, createCompilerDiagnostic, createCompilerDiagnosticFromMessageChain, - createDiagnosticCollection, createDiagnosticForNodeFromMessageChain, createDiagnosticForNodeInSourceFile, createDiagnosticForRange, createFileDiagnostic, - createFileDiagnosticFromMessageChain, createGetCanonicalFileName, createModeAwareCache, createModeAwareCacheKey, createModuleResolutionCache, createMultiMap, + createProgramDiagnostics, CreateProgramOptions, createSourceFile, CreateSourceFileOptions, @@ -75,7 +74,6 @@ import { equateStringsCaseInsensitive, equateStringsCaseSensitive, exclusivelyPrefixedNodeCoreModules, - explainIfFileIsRedirectAndImpliedFormat, ExportAssignment, ExportDeclaration, Extension, @@ -86,10 +84,7 @@ import { fileExtensionIsOneOf, FileIncludeKind, FileIncludeReason, - fileIncludeReasonToDiagnostics, - FilePreprocessingDiagnostics, FilePreprocessingDiagnosticsKind, - FilePreprocessingLibReferenceDiagnostic, FileReference, filter, find, @@ -104,6 +99,8 @@ import { forEachEmittedFile, forEachEntry, forEachKey, + forEachOptionsSyntaxByName, + forEachProjectReference, forEachPropertyAssignment, forEachResolvedProjectReference as ts_forEachResolvedProjectReference, forEachTsConfigPropArray, @@ -126,11 +123,9 @@ import { getIsolatedModules, getJSXImplicitImportBase, getJSXRuntimeImport, + getLibFileNameFromLibReference, getLineAndCharacterOfPosition, getLineStarts, - getMatchedFileSpec, - getMatchedIncludeSpec, - getNameOfScriptTarget, getNewLineCharacter, getNormalizedAbsolutePath, getNormalizedAbsolutePathWithoutRoot, @@ -139,14 +134,12 @@ import { getPackageScopeForPath, getPathFromPathComponents, getPositionOfLineAndCharacter, - getPropertyArrayElementValue, getResolvedModuleFromResolution, getResolvedTypeReferenceDirectiveFromResolution, getResolveJsonModule, getRootLength, getSetExternalModuleIndicator, getSourceFileOfNode, - getSpellingSuggestion, getStrictOptionValue, getSupportedExtensions, getSupportedExtensionsWithJsonIfResolveJsonModule, @@ -155,7 +148,6 @@ import { getTransformers, getTsBuildInfoEmitOutputFilePath, getTsConfigObjectLiteralExpression, - getTsConfigPropArrayElementValue, getTypesPackageName, HasChangedAutomaticTypeDirectiveNames, hasChangesInResolutions, @@ -215,7 +207,6 @@ import { JsonSourceFile, JsxEmit, length, - libMap, LibResolution, libs, mapDefined, @@ -246,6 +237,7 @@ import { noTransformers, ObjectLiteralExpression, OperationCanceledException, + optionDeclarations, optionsHaveChanges, PackageId, packageIdToPackageName, @@ -317,7 +309,6 @@ import { trace, tracing, tryCast, - TsConfigSourceFile, TypeChecker, typeDirectiveIsEqualTo, TypeReferenceDirectiveResolutionCache, @@ -1142,60 +1133,6 @@ export function loadWithModeAwareCache( - resolvedProjectReferences: readonly (ResolvedProjectReference | undefined)[] | undefined, - cb: (resolvedProjectReference: ResolvedProjectReference, parent: ResolvedProjectReference | undefined) => T | undefined, -): T | undefined { - return forEachProjectReference( - /*projectReferences*/ undefined, - resolvedProjectReferences, - (resolvedRef, parent) => resolvedRef && cb(resolvedRef, parent), - ); -} - -function forEachProjectReference( - projectReferences: readonly ProjectReference[] | undefined, - resolvedProjectReferences: readonly (ResolvedProjectReference | undefined)[] | undefined, - cbResolvedRef: (resolvedRef: ResolvedProjectReference | undefined, parent: ResolvedProjectReference | undefined, index: number) => T | undefined, - cbRef?: (projectReferences: readonly ProjectReference[] | undefined, parent: ResolvedProjectReference | undefined) => T | undefined, -): T | undefined { - let seenResolvedRefs: Set | undefined; - return worker(projectReferences, resolvedProjectReferences, /*parent*/ undefined); - - function worker( - projectReferences: readonly ProjectReference[] | undefined, - resolvedProjectReferences: readonly (ResolvedProjectReference | undefined)[] | undefined, - parent: ResolvedProjectReference | undefined, - ): T | undefined { - // Visit project references first - if (cbRef) { - const result = cbRef(projectReferences, parent); - if (result) return result; - } - let skipChildren: Set | undefined; - return forEach( - resolvedProjectReferences, - (resolvedRef, index) => { - if (resolvedRef && seenResolvedRefs?.has(resolvedRef.sourceFile.path)) { - (skipChildren ??= new Set()).add(resolvedRef); - // ignore recursives - return undefined; - } - const result = cbResolvedRef(resolvedRef, parent, index); - if (result || !resolvedRef) return result; - (seenResolvedRefs ||= new Set()).add(resolvedRef.sourceFile.path); - }, - ) || forEach( - resolvedProjectReferences, - resolvedRef => - resolvedRef && !skipChildren?.has(resolvedRef) ? - worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef) : - undefined, - ); - } -} - /** @internal */ export const inferredTypesContainingFile = "__inferred type names__.ts"; @@ -1220,15 +1157,6 @@ export function getLibraryNameFromLibFileName(libFileName: string): string { return "@typescript/lib-" + path; } -function getLibNameFromLibReference(libReference: FileReference) { - return toFileNameLowerCase(libReference.fileName); -} - -function getLibFileNameFromLibReference(libReference: FileReference) { - const libName = getLibNameFromLibReference(libReference); - return libMap.get(libName); -} - /** @internal */ export function isReferencedFile(reason: FileIncludeReason | undefined): reason is ReferencedFile { switch (reason?.kind) { @@ -1536,16 +1464,6 @@ const plainJSErrors = new Set([ Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value.code, ]); -interface LazyProgramDiagnosticExplainingFile { - file: SourceFile; - diagnostic: DiagnosticMessage; - args: DiagnosticArguments; -} -interface FileReasonToChainCache { - fileIncludeReasonDetails: DiagnosticMessageChain | undefined; - redirectInfo: DiagnosticMessageChain[] | undefined; - details?: DiagnosticMessageChain[]; -} /** * Determine if source file needs to be re-created even if its text hasn't changed */ @@ -1611,17 +1529,13 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg let processingOtherFiles: SourceFile[] | undefined; let files: SourceFile[]; let symlinks: SymlinkCache | undefined; - let commonSourceDirectory: string; let typeChecker: TypeChecker; let classifiableNames: Set<__String>; - let fileReasons = createMultiMap(); let filesWithReferencesProcessed: Set | undefined; - let fileReasonsToChain: Map | undefined; - let reasonToRelatedInfo: Map | undefined; let cachedBindAndCheckDiagnosticsForFile: Map | undefined; let cachedDeclarationDiagnosticsForFile: Map | undefined; + const programDiagnostics = createProgramDiagnostics(getCompilerOptionsObjectLiteralSyntax); - let fileProcessingDiagnostics: FilePreprocessingDiagnostics[] | undefined; let automaticTypeDirectiveNames: string[] | undefined; let automaticTypeDirectiveResolutions: ModeAwareCache; @@ -1661,13 +1575,8 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg let skipDefaultLib = options.noLib; const getDefaultLibraryFileName = memoize(() => host.getDefaultLibFileName(options)); const defaultLibraryPath = host.getDefaultLibLocation ? host.getDefaultLibLocation() : getDirectoryPath(getDefaultLibraryFileName()); - /** - * Diagnostics for the program - * Only add diagnostics directly if it always would be done irrespective of program structure reuse. - * Otherwise fileProcessingDiagnostics is correct locations so that the diagnostics can be reported in all structure use scenarios - */ - const programDiagnostics = createDiagnosticCollection(); - let lazyProgramDiagnosticExplainingFile: LazyProgramDiagnosticExplainingFile[] | undefined = []; + + let skipVerifyCompilerOptions = false; const currentDirectory = host.getCurrentDirectory(); const supportedExtensions = getSupportedExtensions(options); const supportedExtensionsWithJsonIfResolveJsonModule = getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions); @@ -1990,7 +1899,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg getTypeCount: () => getTypeChecker().getTypeCount(), getInstantiationCount: () => getTypeChecker().getInstantiationCount(), getRelationCacheSizes: () => getTypeChecker().getRelationCacheSizes(), - getFileProcessingDiagnostics: () => fileProcessingDiagnostics, + getFileProcessingDiagnostics: () => programDiagnostics.getFileProcessingDiagnostics(), getAutomaticTypeDirectiveNames: () => automaticTypeDirectiveNames!, getAutomaticTypeDirectiveResolutions: () => automaticTypeDirectiveResolutions, isSourceFileFromExternalLibrary, @@ -2006,6 +1915,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg resolvedModules, resolvedTypeReferenceDirectiveNames, resolvedLibReferences, + getProgramDiagnosticsContainer: () => programDiagnostics, getResolvedModule, getResolvedModuleFromModuleSpecifier, getResolvedTypeReferenceDirective, @@ -2038,7 +1948,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg realpath: host.realpath?.bind(host), useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(), getCanonicalFileName, - getFileIncludeReasons: () => fileReasons, + getFileIncludeReasons: () => programDiagnostics.getFileReasons(), structureIsReused, writeFile, getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation), @@ -2046,63 +1956,15 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg onProgramCreateComplete(); - verifyCompilerOptions(); + if (!skipVerifyCompilerOptions) { + verifyCompilerOptions(); + } performance.mark("afterProgram"); performance.measure("Program", "beforeProgram", "afterProgram"); tracing?.pop(); return program; - function updateAndGetProgramDiagnostics() { - if (lazyProgramDiagnosticExplainingFile) { - // Add file processingDiagnostics - fileProcessingDiagnostics?.forEach(diagnostic => { - switch (diagnostic.kind) { - case FilePreprocessingDiagnosticsKind.FilePreprocessingFileExplainingDiagnostic: - return programDiagnostics.add( - createDiagnosticExplainingFile( - diagnostic.file && getSourceFileByPath(diagnostic.file), - diagnostic.fileProcessingReason, - diagnostic.diagnostic, - diagnostic.args || emptyArray, - ), - ); - case FilePreprocessingDiagnosticsKind.FilePreprocessingLibReferenceDiagnostic: - return programDiagnostics.add(filePreprocessingLibreferenceDiagnostic(diagnostic)); - case FilePreprocessingDiagnosticsKind.ResolutionDiagnostics: - return diagnostic.diagnostics.forEach(d => programDiagnostics.add(d)); - default: - Debug.assertNever(diagnostic); - } - }); - lazyProgramDiagnosticExplainingFile.forEach(({ file, diagnostic, args }) => - programDiagnostics.add( - createDiagnosticExplainingFile(file, /*fileProcessingReason*/ undefined, diagnostic, args), - ) - ); - lazyProgramDiagnosticExplainingFile = undefined; - fileReasonsToChain = undefined; - reasonToRelatedInfo = undefined; - } - return programDiagnostics; - } - - function filePreprocessingLibreferenceDiagnostic({ reason }: FilePreprocessingLibReferenceDiagnostic) { - const { file, pos, end } = getReferencedFileLocation(program, reason) as ReferenceFileLocation; - const libReference = file.libReferenceDirectives[reason.index]; - const libName = getLibNameFromLibReference(libReference); - const unqualifiedLibName = removeSuffix(removePrefix(libName, "lib."), ".d.ts"); - const suggestion = getSpellingSuggestion(unqualifiedLibName, libs, identity); - return createFileDiagnostic( - file, - Debug.checkDefined(pos), - Debug.checkDefined(end) - pos, - suggestion ? Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : Diagnostics.Cannot_find_lib_definition_for_0, - libName, - suggestion!, - ); - } - function getResolvedModule(file: SourceFile, moduleName: string, mode: ResolutionMode) { return resolvedModules?.get(file.path)?.get(moduleName, mode); } @@ -2170,7 +2032,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg function addResolutionDiagnostics(resolution: ResolvedModuleWithFailedLookupLocations | ResolvedTypeReferenceDirectiveWithFailedLookupLocations) { if (!resolution.resolutionDiagnostics?.length) return; - (fileProcessingDiagnostics ??= []).push({ + programDiagnostics.addFileProcessingDiagnostic({ kind: FilePreprocessingDiagnosticsKind.ResolutionDiagnostics, diagnostics: resolution.resolutionDiagnostics, }); @@ -2289,16 +2151,19 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg } function getCommonSourceDirectory() { - if (commonSourceDirectory === undefined) { - const emittedFiles = filter(files, file => sourceFileMayBeEmitted(file, program)); - commonSourceDirectory = ts_getCommonSourceDirectory( - options, - () => mapDefined(emittedFiles, file => file.isDeclarationFile ? undefined : file.fileName), - currentDirectory, - getCanonicalFileName, - commonSourceDirectory => checkSourceFilesBelongToPath(emittedFiles, commonSourceDirectory), - ); + let commonSourceDirectory = programDiagnostics.getCommonSourceDirectory(); + if (commonSourceDirectory !== undefined) { + return commonSourceDirectory; } + const emittedFiles = filter(files, file => sourceFileMayBeEmitted(file, program)); + commonSourceDirectory = ts_getCommonSourceDirectory( + options, + () => mapDefined(emittedFiles, file => file.isDeclarationFile ? undefined : file.fileName), + currentDirectory, + getCanonicalFileName, + commonSourceDirectory => checkSourceFilesBelongToPath(emittedFiles, commonSourceDirectory), + ); + programDiagnostics.setCommonSourceDirectory(commonSourceDirectory); return commonSourceDirectory; } @@ -2722,9 +2587,12 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg filesByName.set(path, filesByName.get(oldFile.path)); }); + const isConfigIdentical = oldOptions.configFile && oldOptions.configFile === options.configFile + || !oldOptions.configFile && !options.configFile && !optionsHaveChanges(oldOptions, options, optionDeclarations); + programDiagnostics.reuseStateFromOldProgram(oldProgram.getProgramDiagnosticsContainer(), isConfigIdentical); + skipVerifyCompilerOptions = isConfigIdentical; + files = newSourceFiles; - fileReasons = oldProgram.getFileIncludeReasons(); - fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics(); automaticTypeDirectiveNames = oldProgram.getAutomaticTypeDirectiveNames(); automaticTypeDirectiveResolutions = oldProgram.getAutomaticTypeDirectiveResolutions(); @@ -2985,7 +2853,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg return emptyArray; } - const programDiagnosticsInFile = updateAndGetProgramDiagnostics().getDiagnostics(sourceFile.fileName); + const programDiagnosticsInFile = programDiagnostics.getCombinedDiagnostics(program).getDiagnostics(sourceFile.fileName); if (!sourceFile.commentDirectives?.length) { return programDiagnosticsInFile; } @@ -3435,16 +3303,16 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg function getOptionsDiagnostics(): SortedReadonlyArray { return sortAndDeduplicateDiagnostics(concatenate( - updateAndGetProgramDiagnostics().getGlobalDiagnostics(), + programDiagnostics.getCombinedDiagnostics(program).getGlobalDiagnostics(), getOptionsDiagnosticsOfConfigFile(), )); } function getOptionsDiagnosticsOfConfigFile() { if (!options.configFile) return emptyArray; - let diagnostics = updateAndGetProgramDiagnostics().getDiagnostics(options.configFile.fileName); + let diagnostics = programDiagnostics.getCombinedDiagnostics(program).getDiagnostics(options.configFile.fileName); forEachResolvedProjectReference(resolvedRef => { - diagnostics = concatenate(diagnostics, updateAndGetProgramDiagnostics().getDiagnostics(resolvedRef.sourceFile.fileName)); + diagnostics = concatenate(diagnostics, programDiagnostics.getCombinedDiagnostics(program).getDiagnostics(resolvedRef.sourceFile.fileName)); }); return diagnostics; } @@ -3666,7 +3534,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg } function reportFileNamesDifferOnlyInCasingError(fileName: string, existingFile: SourceFile, reason: FileIncludeReason): void { - const hasExistingReasonToReportErrorOn = !isReferencedFile(reason) && some(fileReasons.get(existingFile.path), isReferencedFile); + const hasExistingReasonToReportErrorOn = !isReferencedFile(reason) && some(programDiagnostics.getFileReasons().get(existingFile.path), isReferencedFile); if (hasExistingReasonToReportErrorOn) { addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, Diagnostics.Already_included_file_name_0_differs_from_file_name_1_only_in_casing, [existingFile.fileName, fileName]); } @@ -3881,7 +3749,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg function addFileIncludeReason(file: SourceFile | undefined, reason: FileIncludeReason, checkExisting: boolean) { if (file && (!checkExisting || !isReferencedFile(reason) || !filesWithReferencesProcessed?.has(reason.file))) { - fileReasons.add(file.path, reason); + programDiagnostics.getFileReasons().add(file.path, reason); return true; } return false; @@ -4115,7 +3983,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg processRootFile(pathForLibFile(libFileName), /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ true, { kind: FileIncludeKind.LibReferenceDirective, file: file.path, index }); } else { - (fileProcessingDiagnostics ||= []).push({ + programDiagnostics.addFileProcessingDiagnostic({ kind: FilePreprocessingDiagnosticsKind.FilePreprocessingLibReferenceDiagnostic, reason: { kind: FileIncludeKind.LibReferenceDirective, file: file.path, index }, }); @@ -4202,10 +4070,11 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg if (!sourceFile.isDeclarationFile) { const absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { - addLazyProgramDiagnosticExplainingFile( + programDiagnostics.addLazyConfigDiagnostic( sourceFile, Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, - [sourceFile.fileName, rootDirectory], + sourceFile.fileName, + rootDirectory, ); allFilesBelongToPath = false; } @@ -4308,7 +4177,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg const outputFile = options.outFile; if (!options.tsBuildInfoFile && options.incremental && !outputFile && !options.configFilePath) { - programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified)); + programDiagnostics.addConfigDiagnostic(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified)); } verifyDeprecatedCompilerOptions(); @@ -4320,10 +4189,11 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg for (const file of files) { // Ignore file that is not emitted if (sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) { - addLazyProgramDiagnosticExplainingFile( + programDiagnostics.addLazyConfigDiagnostic( file, Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, - [file.fileName, options.configFilePath || ""], + file.fileName, + options.configFilePath || "", ); } } @@ -4410,7 +4280,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg else if (firstNonAmbientExternalModuleSourceFile && languageVersion < ScriptTarget.ES2015 && options.module === ModuleKind.None) { // We cannot use createDiagnosticFromNode because nodes do not have parents yet const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator!); - programDiagnostics.add(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none)); + programDiagnostics.addConfigDiagnostic(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none)); } // Cannot specify module gen that isn't amd or system with --out @@ -4420,7 +4290,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg } else if (options.module === undefined && firstNonAmbientExternalModuleSourceFile) { const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator!); - programDiagnostics.add(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, "outFile")); + programDiagnostics.addConfigDiagnostic(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, "outFile")); } } @@ -4699,123 +4569,8 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg }); } - function createDiagnosticExplainingFile(file: SourceFile | undefined, fileProcessingReason: FileIncludeReason | undefined, diagnostic: DiagnosticMessage, args: DiagnosticArguments): Diagnostic { - let seenReasons: Set | undefined; - const reasons = file && fileReasons.get(file.path); - let fileIncludeReasons: DiagnosticMessageChain[] | undefined; - let relatedInfo: DiagnosticWithLocation[] | undefined; - let locationReason = isReferencedFile(fileProcessingReason) ? fileProcessingReason : undefined; - let fileIncludeReasonDetails: DiagnosticMessageChain | undefined; - let redirectInfo: DiagnosticMessageChain[] | undefined; - let cachedChain = file && fileReasonsToChain?.get(file.path); - let chain: DiagnosticMessageChain | undefined; - if (cachedChain) { - if (cachedChain.fileIncludeReasonDetails) { - seenReasons = new Set(reasons); - reasons?.forEach(populateRelatedInfo); - } - else { - reasons?.forEach(processReason); - } - redirectInfo = cachedChain.redirectInfo; - } - else { - reasons?.forEach(processReason); - redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file, getCompilerOptionsForFile(file)); - } - - if (fileProcessingReason) processReason(fileProcessingReason); - const processedExtraReason = seenReasons?.size !== reasons?.length; - - // If we have location and there is only one reason file is in which is the location, dont add details for file include - if (locationReason && seenReasons?.size === 1) seenReasons = undefined; - - if (seenReasons && cachedChain) { - if (cachedChain.details && !processedExtraReason) { - chain = chainDiagnosticMessages(cachedChain.details, diagnostic, ...args || emptyArray); - } - else if (cachedChain.fileIncludeReasonDetails) { - if (!processedExtraReason) { - if (!cachedFileIncludeDetailsHasProcessedExtraReason()) { - fileIncludeReasonDetails = cachedChain.fileIncludeReasonDetails; - } - else { - fileIncludeReasons = cachedChain.fileIncludeReasonDetails.next!.slice(0, reasons!.length); - } - } - else { - if (!cachedFileIncludeDetailsHasProcessedExtraReason()) { - fileIncludeReasons = [...cachedChain.fileIncludeReasonDetails.next!, fileIncludeReasons![0]]; - } - else { - fileIncludeReasons = append(cachedChain.fileIncludeReasonDetails.next!.slice(0, reasons!.length), fileIncludeReasons![0]); - } - } - } - } - - if (!chain) { - if (!fileIncludeReasonDetails) fileIncludeReasonDetails = seenReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon); - chain = chainDiagnosticMessages( - redirectInfo ? - fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : - fileIncludeReasonDetails, - diagnostic, - ...args || emptyArray, - ); - } - - // This is chain's next contains: - // - File is in program because: - // - Files reasons listed - // - extra reason if its not already processed - this happens in case sensitive file system where files differ in casing and we are giving reasons for two files so reason is not in file's reason - // fyi above whole secton is ommited if we have single reason and we are reporting at that reason's location - // - redirect and additional information about file - // So cache result if we havent ommited file include reasons - if (file) { - if (cachedChain) { - // Cache new fileIncludeDetails if we have update - // Or if we had cached with more details than the reasons - if (!cachedChain.fileIncludeReasonDetails || (!processedExtraReason && fileIncludeReasonDetails)) { - cachedChain.fileIncludeReasonDetails = fileIncludeReasonDetails; - } - } - else { - (fileReasonsToChain ??= new Map()).set(file.path, cachedChain = { fileIncludeReasonDetails, redirectInfo }); - } - // If we didnt compute extra file include reason , cache the details to use directly - if (!cachedChain.details && !processedExtraReason) cachedChain.details = chain.next; - } - - const location = locationReason && getReferencedFileLocation(program, locationReason); - return location && isReferenceFileLocation(location) ? - createFileDiagnosticFromMessageChain(location.file, location.pos, location.end - location.pos, chain, relatedInfo) : - createCompilerDiagnosticFromMessageChain(chain, relatedInfo); - - function processReason(reason: FileIncludeReason) { - if (seenReasons?.has(reason)) return; - (seenReasons ??= new Set()).add(reason); - (fileIncludeReasons ??= []).push(fileIncludeReasonToDiagnostics(program, reason)); - populateRelatedInfo(reason); - } - - function populateRelatedInfo(reason: FileIncludeReason) { - if (!locationReason && isReferencedFile(reason)) { - // Report error at first reference file or file currently in processing and dont report in related information - locationReason = reason; - } - else if (locationReason !== reason) { - relatedInfo = append(relatedInfo, getFileIncludeReasonToRelatedInformation(reason)); - } - } - - function cachedFileIncludeDetailsHasProcessedExtraReason() { - return cachedChain!.fileIncludeReasonDetails!.next?.length !== reasons?.length; - } - } - function addFilePreprocessingFileExplainingDiagnostic(file: SourceFile | undefined, fileProcessingReason: FileIncludeReason, diagnostic: DiagnosticMessage, args: DiagnosticArguments) { - (fileProcessingDiagnostics ||= []).push({ + programDiagnostics.addFileProcessingDiagnostic({ kind: FilePreprocessingDiagnosticsKind.FilePreprocessingFileExplainingDiagnostic, file: file && file.path, fileProcessingReason, @@ -4824,111 +4579,6 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg }); } - function addLazyProgramDiagnosticExplainingFile(file: SourceFile, diagnostic: DiagnosticMessage, args: DiagnosticArguments) { - lazyProgramDiagnosticExplainingFile!.push({ file, diagnostic, args }); - } - - function getFileIncludeReasonToRelatedInformation(reason: FileIncludeReason) { - let relatedInfo = reasonToRelatedInfo?.get(reason); - if (relatedInfo === undefined) (reasonToRelatedInfo ??= new Map()).set(reason, relatedInfo = fileIncludeReasonToRelatedInformation(reason) ?? false); - return relatedInfo || undefined; - } - - function fileIncludeReasonToRelatedInformation(reason: FileIncludeReason): DiagnosticWithLocation | undefined { - if (isReferencedFile(reason)) { - const referenceLocation = getReferencedFileLocation(program, reason); - let message: DiagnosticMessage; - switch (reason.kind) { - case FileIncludeKind.Import: - message = Diagnostics.File_is_included_via_import_here; - break; - case FileIncludeKind.ReferenceFile: - message = Diagnostics.File_is_included_via_reference_here; - break; - case FileIncludeKind.TypeReferenceDirective: - message = Diagnostics.File_is_included_via_type_library_reference_here; - break; - case FileIncludeKind.LibReferenceDirective: - message = Diagnostics.File_is_included_via_library_reference_here; - break; - default: - Debug.assertNever(reason); - } - return isReferenceFileLocation(referenceLocation) ? createFileDiagnostic( - referenceLocation.file, - referenceLocation.pos, - referenceLocation.end - referenceLocation.pos, - message, - ) : undefined; - } - - if (!options.configFile) return undefined; - let configFileNode: Node | undefined; - let message: DiagnosticMessage; - switch (reason.kind) { - case FileIncludeKind.RootFile: - if (!options.configFile.configFileSpecs) return undefined; - const fileName = getNormalizedAbsolutePath(rootNames[reason.index], currentDirectory); - const matchedByFiles = getMatchedFileSpec(program, fileName); - if (matchedByFiles) { - configFileNode = getTsConfigPropArrayElementValue(options.configFile, "files", matchedByFiles); - message = Diagnostics.File_is_matched_by_files_list_specified_here; - break; - } - const matchedByInclude = getMatchedIncludeSpec(program, fileName); - // Could be additional files specified as roots - if (!matchedByInclude || !isString(matchedByInclude)) return undefined; - configFileNode = getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude); - message = Diagnostics.File_is_matched_by_include_pattern_specified_here; - break; - case FileIncludeKind.SourceFromProjectReference: - case FileIncludeKind.OutputFromProjectReference: - const referencedResolvedRef = Debug.checkDefined(resolvedProjectReferences?.[reason.index]); - const referenceInfo = forEachProjectReference( - projectReferences, - resolvedProjectReferences, - (resolvedRef, parent, index) => - resolvedRef === referencedResolvedRef ? - { sourceFile: parent?.sourceFile || options.configFile!, index } : - undefined, - ); - if (!referenceInfo) return undefined; - const { sourceFile, index } = referenceInfo; - const referencesSyntax = forEachTsConfigPropArray(sourceFile as TsConfigSourceFile, "references", property => isArrayLiteralExpression(property.initializer) ? property.initializer : undefined); - return referencesSyntax && referencesSyntax.elements.length > index ? - createDiagnosticForNodeInSourceFile( - sourceFile, - referencesSyntax.elements[index], - reason.kind === FileIncludeKind.OutputFromProjectReference ? - Diagnostics.File_is_output_from_referenced_project_specified_here : - Diagnostics.File_is_source_from_referenced_project_specified_here, - ) : - undefined; - case FileIncludeKind.AutomaticTypeDirectiveFile: - if (!options.types) return undefined; - configFileNode = getOptionsSyntaxByArrayElementValue("types", reason.typeReference); - message = Diagnostics.File_is_entry_point_of_type_library_specified_here; - break; - case FileIncludeKind.LibFile: - if (reason.index !== undefined) { - configFileNode = getOptionsSyntaxByArrayElementValue("lib", options.lib![reason.index]); - message = Diagnostics.File_is_library_specified_here; - break; - } - const target = getNameOfScriptTarget(getEmitScriptTarget(options)); - configFileNode = target ? getOptionsSyntaxByValue("target", target) : undefined; - message = Diagnostics.File_is_default_library_for_target_specified_here; - break; - default: - Debug.assertNever(reason); - } - return configFileNode && createDiagnosticForNodeInSourceFile( - options.configFile, - configFileNode, - message, - ); - } - function verifyProjectReferences() { const buildInfoPath = !options.suppressOutputPathCheck ? getTsBuildInfoEmitOutputFilePath(options) : undefined; forEachProjectReference( @@ -4966,7 +4616,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg forEachPropertyAssignment(pathProp.initializer, key, keyProps => { const initializer = keyProps.initializer; if (isArrayLiteralExpression(initializer) && initializer.elements.length > valueIndex) { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile!, initializer.elements[valueIndex], message, ...args)); + programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(options.configFile!, initializer.elements[valueIndex], message, ...args)); needCompilerDiagnostic = false; } }); @@ -4999,21 +4649,8 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg } } - function forEachOptionsSyntaxByName(name: string, callback: (prop: PropertyAssignment) => T | undefined): T | undefined { - return forEachPropertyAssignment(getCompilerOptionsObjectLiteralSyntax(), name, callback); - } - function forEachOptionPathsSyntax(callback: (prop: PropertyAssignment) => T | undefined) { - return forEachOptionsSyntaxByName("paths", callback); - } - - function getOptionsSyntaxByValue(name: string, value: string) { - return forEachOptionsSyntaxByName(name, property => isStringLiteral(property.initializer) && property.initializer.text === value ? property.initializer : undefined); - } - - function getOptionsSyntaxByArrayElementValue(name: string, value: string) { - const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); - return compilerOptionsObjectLiteralSyntax && getPropertyArrayElementValue(compilerOptionsObjectLiteralSyntax, name, value); + return forEachOptionsSyntaxByName(getCompilerOptionsObjectLiteralSyntax(), "paths", callback); } function createDiagnosticForOptionName(message: DiagnosticMessage, option1: string, option2?: string, option3?: string) { @@ -5028,10 +4665,10 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg function createDiagnosticForReference(sourceFile: JsonSourceFile | undefined, index: number, message: DiagnosticMessage, ...args: DiagnosticArguments) { const referencesSyntax = forEachTsConfigPropArray(sourceFile || options.configFile, "references", property => isArrayLiteralExpression(property.initializer) ? property.initializer : undefined); if (referencesSyntax && referencesSyntax.elements.length > index) { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile!, referencesSyntax.elements[index], message, ...args)); + programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile!, referencesSyntax.elements[index], message, ...args)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, ...args)); + programDiagnostics.addConfigDiagnostic(createCompilerDiagnostic(message, ...args)); } } @@ -5055,18 +4692,18 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg if (compilerOptionsProperty) { // eslint-disable-next-line local/no-in-operator if ("messageText" in message) { - programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile!, compilerOptionsProperty.name, message)); + programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeFromMessageChain(options.configFile!, compilerOptionsProperty.name, message)); } else { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile!, compilerOptionsProperty.name, message, ...args)); + programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(options.configFile!, compilerOptionsProperty.name, message, ...args)); } } // eslint-disable-next-line local/no-in-operator else if ("messageText" in message) { - programDiagnostics.add(createCompilerDiagnosticFromMessageChain(message)); + programDiagnostics.addConfigDiagnostic(createCompilerDiagnosticFromMessageChain(message)); } else { - programDiagnostics.add(createCompilerDiagnostic(message, ...args)); + programDiagnostics.addConfigDiagnostic(createCompilerDiagnostic(message, ...args)); } } @@ -5097,10 +4734,10 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg forEachPropertyAssignment(objectLiteral, key1, prop => { // eslint-disable-next-line local/no-in-operator if ("messageText" in message) { - programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile!, onKey ? prop.name : prop.initializer, message)); + programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeFromMessageChain(options.configFile!, onKey ? prop.name : prop.initializer, message)); } else { - programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile!, onKey ? prop.name : prop.initializer, message, ...args)); + programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(options.configFile!, onKey ? prop.name : prop.initializer, message, ...args)); } needsCompilerDiagnostic = true; }, key2); @@ -5109,7 +4746,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg function blockEmittingOfFile(emitFileName: string, diag: Diagnostic) { hasEmitBlockingDiagnostics.set(toPath(emitFileName), true); - programDiagnostics.add(diag); + programDiagnostics.addConfigDiagnostic(diag); } function isEmittedFile(file: string): boolean { diff --git a/src/compiler/programDiagnostics.ts b/src/compiler/programDiagnostics.ts new file mode 100644 index 0000000000000..ee4d1161eaa19 --- /dev/null +++ b/src/compiler/programDiagnostics.ts @@ -0,0 +1,426 @@ +import { + append, + chainDiagnosticMessages, + createCompilerDiagnosticFromMessageChain, + createDiagnosticCollection, + createDiagnosticForNodeInSourceFile, + createFileDiagnostic, + createFileDiagnosticFromMessageChain, + createMultiMap, + Debug, + Diagnostic, + DiagnosticArguments, + DiagnosticCollection, + DiagnosticMessage, + DiagnosticMessageChain, + Diagnostics, + DiagnosticWithLocation, + emptyArray, + explainIfFileIsRedirectAndImpliedFormat, + FileIncludeKind, + FileIncludeReason, + fileIncludeReasonToDiagnostics, + FilePreprocessingDiagnostics, + FilePreprocessingDiagnosticsKind, + FilePreprocessingLibReferenceDiagnostic, + forEachProjectReference, + forEachTsConfigPropArray, + getEmitScriptTarget, + getLibNameFromLibReference, + getMatchedFileSpec, + getMatchedIncludeSpec, + getNameOfScriptTarget, + getNormalizedAbsolutePath, + getOptionsSyntaxByArrayElementValue, + getOptionsSyntaxByValue, + getReferencedFileLocation, + getSpellingSuggestion, + getTsConfigPropArrayElementValue, + identity, + isArrayLiteralExpression, + isReferencedFile, + isReferenceFileLocation, + isString, + libs, + MultiMap, + Node, + ObjectLiteralExpression, + Path, + Program, + ReferenceFileLocation, + removePrefix, + removeSuffix, + SourceFile, + TsConfigSourceFile, +} from "./_namespaces/ts.js"; + +interface FileReasonToChainCache { + fileIncludeReasonDetails: DiagnosticMessageChain | undefined; + redirectInfo: DiagnosticMessageChain[] | undefined; + details?: DiagnosticMessageChain[]; +} + +/** @internal */ +export interface LazyConfigDiagnostic { + file: SourceFile; + diagnostic: DiagnosticMessage; + args: DiagnosticArguments; +} + +/** @internal */ +export interface ProgramDiagnostics { + addConfigDiagnostic(diag: Diagnostic): void; + addLazyConfigDiagnostic(file: SourceFile, message: DiagnosticMessage, ...args: DiagnosticArguments): void; + addFileProcessingDiagnostic(diag: FilePreprocessingDiagnostics): void; + setCommonSourceDirectory(directory: string): void; + + reuseStateFromOldProgram(oldProgramDiagnostics: ProgramDiagnostics, isConfigIdentical: boolean): void; + + getFileProcessingDiagnostics(): FilePreprocessingDiagnostics[] | undefined; + getFileReasons(): MultiMap; + getConfigDiagnostics(): DiagnosticCollection | undefined; + getLazyConfigDiagnostics(): LazyConfigDiagnostic[] | undefined; + getCommonSourceDirectory(): string | undefined; + getCombinedDiagnostics(program: Program): DiagnosticCollection; +} + +/** @internal */ +export function createProgramDiagnostics(getCompilerOptionsObjectLiteralSyntax: () => ObjectLiteralExpression | undefined): ProgramDiagnostics { + // Only valid for a single program. The individual components can be reused under certain + // circumstances (described below), but during `getCombinedDiagnostics`, position information + // is applied to the diagnostics, so they cannot be shared between programs. + let computedDiagnostics: DiagnosticCollection | undefined; + + // Valid between programs if `StructureIsReused.Completely`. + let fileReasons = createMultiMap(); + let fileProcessingDiagnostics: FilePreprocessingDiagnostics[] | undefined; + + // Valid between programs if `StructureIsReused.Completely` and config file is identical. + let commonSourceDirectory: string | undefined; + let configDiagnostics: DiagnosticCollection | undefined; + let lazyConfigDiagnostics: LazyConfigDiagnostic[] | undefined; + + // Local state, only used during getDiagnostics + let fileReasonsToChain: Map | undefined; + let reasonToRelatedInfo: Map | undefined; + + return { + addConfigDiagnostic(diag) { + Debug.assert(computedDiagnostics === undefined, "Cannot modify program diagnostic state after requesting combined diagnostics"); + (configDiagnostics ??= createDiagnosticCollection()).add(diag); + }, + addLazyConfigDiagnostic(file, message, ...args) { + Debug.assert(computedDiagnostics === undefined, "Cannot modify program diagnostic state after requesting combined diagnostics"); + (lazyConfigDiagnostics ??= []).push({ file, diagnostic: message, args }); + }, + addFileProcessingDiagnostic(diag) { + Debug.assert(computedDiagnostics === undefined, "Cannot modify program diagnostic state after requesting combined diagnostics"); + (fileProcessingDiagnostics ??= []).push(diag); + }, + setCommonSourceDirectory(directory) { + commonSourceDirectory = directory; + }, + + reuseStateFromOldProgram(oldProgramDiagnostics, isConfigIdentical) { + fileReasons = oldProgramDiagnostics.getFileReasons(); + fileProcessingDiagnostics = oldProgramDiagnostics.getFileProcessingDiagnostics(); + if (isConfigIdentical) { + commonSourceDirectory = oldProgramDiagnostics.getCommonSourceDirectory(); + configDiagnostics = oldProgramDiagnostics.getConfigDiagnostics(); + lazyConfigDiagnostics = oldProgramDiagnostics.getLazyConfigDiagnostics(); + } + }, + + getFileProcessingDiagnostics() { + return fileProcessingDiagnostics; + }, + getFileReasons() { + return fileReasons; + }, + getCommonSourceDirectory() { + return commonSourceDirectory; + }, + getConfigDiagnostics() { + return configDiagnostics; + }, + getLazyConfigDiagnostics() { + return lazyConfigDiagnostics; + }, + getCombinedDiagnostics(program: Program) { + if (computedDiagnostics) { + return computedDiagnostics; + } + + computedDiagnostics = createDiagnosticCollection(); + + configDiagnostics?.getDiagnostics().forEach(d => computedDiagnostics!.add(d)); + + fileProcessingDiagnostics?.forEach(diagnostic => { + switch (diagnostic.kind) { + case FilePreprocessingDiagnosticsKind.FilePreprocessingFileExplainingDiagnostic: + return computedDiagnostics!.add( + createDiagnosticExplainingFile( + program, + diagnostic.file && program.getSourceFileByPath(diagnostic.file), + diagnostic.fileProcessingReason, + diagnostic.diagnostic, + diagnostic.args || emptyArray, + ), + ); + case FilePreprocessingDiagnosticsKind.FilePreprocessingLibReferenceDiagnostic: + return computedDiagnostics!.add(filePreprocessingLibreferenceDiagnostic(program, diagnostic)); + case FilePreprocessingDiagnosticsKind.ResolutionDiagnostics: + return diagnostic.diagnostics.forEach(d => computedDiagnostics!.add(d)); + default: + Debug.assertNever(diagnostic); + } + }); + lazyConfigDiagnostics?.forEach(({ file, diagnostic, args }) => + computedDiagnostics!.add( + createDiagnosticExplainingFile(program, file, /*fileProcessingReason*/ undefined, diagnostic, args), + ) + ); + fileReasonsToChain = undefined; + reasonToRelatedInfo = undefined; + return computedDiagnostics; + }, + }; + + function filePreprocessingLibreferenceDiagnostic(program: Program, { reason }: FilePreprocessingLibReferenceDiagnostic) { + const { file, pos, end } = getReferencedFileLocation(program, reason) as ReferenceFileLocation; + const libReference = file.libReferenceDirectives[reason.index]; + const libName = getLibNameFromLibReference(libReference); + const unqualifiedLibName = removeSuffix(removePrefix(libName, "lib."), ".d.ts"); + const suggestion = getSpellingSuggestion(unqualifiedLibName, libs, identity); + return createFileDiagnostic( + file, + Debug.checkDefined(pos), + Debug.checkDefined(end) - pos, + suggestion ? Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : Diagnostics.Cannot_find_lib_definition_for_0, + libName, + suggestion!, + ); + } + + function createDiagnosticExplainingFile(program: Program, file: SourceFile | undefined, fileProcessingReason: FileIncludeReason | undefined, diagnostic: DiagnosticMessage, args: DiagnosticArguments): Diagnostic { + let seenReasons: Set | undefined; + let fileIncludeReasons: DiagnosticMessageChain[] | undefined; + let relatedInfo: DiagnosticWithLocation[] | undefined; + let fileIncludeReasonDetails: DiagnosticMessageChain | undefined; + let redirectInfo: DiagnosticMessageChain[] | undefined; + let chain: DiagnosticMessageChain | undefined; + + const reasons = file && fileReasons.get(file.path); + let locationReason = isReferencedFile(fileProcessingReason) ? fileProcessingReason : undefined; + let cachedChain = file && fileReasonsToChain?.get(file.path); + if (cachedChain) { + if (cachedChain.fileIncludeReasonDetails) { + seenReasons = new Set(reasons); + reasons?.forEach(populateRelatedInfo); + } + else { + reasons?.forEach(processReason); + } + redirectInfo = cachedChain.redirectInfo; + } + else { + reasons?.forEach(processReason); + redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file, program.getCompilerOptionsForFile(file)); + } + + if (fileProcessingReason) processReason(fileProcessingReason); + const processedExtraReason = seenReasons?.size !== reasons?.length; + + // If we have location and there is only one reason file is in which is the location, dont add details for file include + if (locationReason && seenReasons?.size === 1) seenReasons = undefined; + + if (seenReasons && cachedChain) { + if (cachedChain.details && !processedExtraReason) { + chain = chainDiagnosticMessages(cachedChain.details, diagnostic, ...args ?? emptyArray); + } + else if (cachedChain.fileIncludeReasonDetails) { + if (!processedExtraReason) { + if (!cachedFileIncludeDetailsHasProcessedExtraReason()) { + fileIncludeReasonDetails = cachedChain.fileIncludeReasonDetails; + } + else { + fileIncludeReasons = cachedChain.fileIncludeReasonDetails.next!.slice(0, reasons!.length); + } + } + else { + if (!cachedFileIncludeDetailsHasProcessedExtraReason()) { + fileIncludeReasons = [...cachedChain.fileIncludeReasonDetails.next!, fileIncludeReasons![0]]; + } + else { + fileIncludeReasons = append(cachedChain.fileIncludeReasonDetails.next!.slice(0, reasons!.length), fileIncludeReasons![0]); + } + } + } + } + + if (!chain) { + if (!fileIncludeReasonDetails) fileIncludeReasonDetails = seenReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon); + chain = chainDiagnosticMessages( + redirectInfo ? + fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : + fileIncludeReasonDetails, + diagnostic, + ...args || emptyArray, + ); + } + + // This is chain's next contains: + // - File is in program because: + // - Files reasons listed + // - extra reason if its not already processed - this happens in case sensitive file system where files differ in casing and we are giving reasons for two files so reason is not in file's reason + // fyi above whole secton is ommited if we have single reason and we are reporting at that reason's location + // - redirect and additional information about file + // So cache result if we havent ommited file include reasons + if (file) { + if (cachedChain) { + // Cache new fileIncludeDetails if we have update + // Or if we had cached with more details than the reasons + if (!cachedChain.fileIncludeReasonDetails || (!processedExtraReason && fileIncludeReasonDetails)) { + cachedChain.fileIncludeReasonDetails = fileIncludeReasonDetails; + } + } + else { + (fileReasonsToChain ??= new Map()).set(file.path, cachedChain = { fileIncludeReasonDetails, redirectInfo }); + } + // If we didnt compute extra file include reason , cache the details to use directly + if (!cachedChain.details && !processedExtraReason) cachedChain.details = chain.next; + } + + const location = locationReason && getReferencedFileLocation(program, locationReason); + return location && isReferenceFileLocation(location) ? + createFileDiagnosticFromMessageChain(location.file, location.pos, location.end - location.pos, chain, relatedInfo) : + createCompilerDiagnosticFromMessageChain(chain, relatedInfo); + + function processReason(reason: FileIncludeReason) { + if (seenReasons?.has(reason)) return; + (seenReasons ??= new Set()).add(reason); + (fileIncludeReasons ??= []).push(fileIncludeReasonToDiagnostics(program, reason)); + populateRelatedInfo(reason); + } + + function populateRelatedInfo(reason: FileIncludeReason) { + if (!locationReason && isReferencedFile(reason)) { + // Report error at first reference file or file currently in processing and dont report in related information + locationReason = reason; + } + else if (locationReason !== reason) { + relatedInfo = append(relatedInfo, getFileIncludeReasonToRelatedInformation(program, reason)); + } + } + + function cachedFileIncludeDetailsHasProcessedExtraReason() { + return cachedChain!.fileIncludeReasonDetails!.next?.length !== reasons?.length; + } + } + + function getFileIncludeReasonToRelatedInformation(program: Program, reason: FileIncludeReason) { + let relatedInfo = reasonToRelatedInfo?.get(reason); + if (relatedInfo === undefined) (reasonToRelatedInfo ??= new Map()).set(reason, relatedInfo = fileIncludeReasonToRelatedInformation(program, reason) ?? false); + return relatedInfo || undefined; + } + + function fileIncludeReasonToRelatedInformation(program: Program, reason: FileIncludeReason): DiagnosticWithLocation | undefined { + if (isReferencedFile(reason)) { + const referenceLocation = getReferencedFileLocation(program, reason); + let message: DiagnosticMessage; + switch (reason.kind) { + case FileIncludeKind.Import: + message = Diagnostics.File_is_included_via_import_here; + break; + case FileIncludeKind.ReferenceFile: + message = Diagnostics.File_is_included_via_reference_here; + break; + case FileIncludeKind.TypeReferenceDirective: + message = Diagnostics.File_is_included_via_type_library_reference_here; + break; + case FileIncludeKind.LibReferenceDirective: + message = Diagnostics.File_is_included_via_library_reference_here; + break; + default: + Debug.assertNever(reason); + } + return isReferenceFileLocation(referenceLocation) ? createFileDiagnostic( + referenceLocation.file, + referenceLocation.pos, + referenceLocation.end - referenceLocation.pos, + message, + ) : undefined; + } + + const currentDirectory = program.getCurrentDirectory(); + const rootNames = program.getRootFileNames(); + const options = program.getCompilerOptions(); + if (!options.configFile) return undefined; + let configFileNode: Node | undefined; + let message: DiagnosticMessage; + switch (reason.kind) { + case FileIncludeKind.RootFile: + if (!options.configFile.configFileSpecs) return undefined; + const fileName = getNormalizedAbsolutePath(rootNames[reason.index], currentDirectory); + const matchedByFiles = getMatchedFileSpec(program, fileName); + if (matchedByFiles) { + configFileNode = getTsConfigPropArrayElementValue(options.configFile, "files", matchedByFiles); + message = Diagnostics.File_is_matched_by_files_list_specified_here; + break; + } + const matchedByInclude = getMatchedIncludeSpec(program, fileName); + // Could be additional files specified as roots + if (!matchedByInclude || !isString(matchedByInclude)) return undefined; + configFileNode = getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude); + message = Diagnostics.File_is_matched_by_include_pattern_specified_here; + break; + case FileIncludeKind.SourceFromProjectReference: + case FileIncludeKind.OutputFromProjectReference: + const resolvedProjectReferences = program.getResolvedProjectReferences(); + const projectReferences = program.getProjectReferences(); + const referencedResolvedRef = Debug.checkDefined(resolvedProjectReferences?.[reason.index]); + const referenceInfo = forEachProjectReference( + projectReferences, + resolvedProjectReferences, + (resolvedRef, parent, index) => + resolvedRef === referencedResolvedRef ? + { sourceFile: parent?.sourceFile || options.configFile!, index } : + undefined, + ); + if (!referenceInfo) return undefined; + const { sourceFile, index } = referenceInfo; + const referencesSyntax = forEachTsConfigPropArray(sourceFile as TsConfigSourceFile, "references", property => isArrayLiteralExpression(property.initializer) ? property.initializer : undefined); + return referencesSyntax && referencesSyntax.elements.length > index ? + createDiagnosticForNodeInSourceFile( + sourceFile, + referencesSyntax.elements[index], + reason.kind === FileIncludeKind.OutputFromProjectReference ? + Diagnostics.File_is_output_from_referenced_project_specified_here : + Diagnostics.File_is_source_from_referenced_project_specified_here, + ) : + undefined; + case FileIncludeKind.AutomaticTypeDirectiveFile: + if (!options.types) return undefined; + configFileNode = getOptionsSyntaxByArrayElementValue(getCompilerOptionsObjectLiteralSyntax(), "types", reason.typeReference); + message = Diagnostics.File_is_entry_point_of_type_library_specified_here; + break; + case FileIncludeKind.LibFile: + if (reason.index !== undefined) { + configFileNode = getOptionsSyntaxByArrayElementValue(getCompilerOptionsObjectLiteralSyntax(), "lib", options.lib![reason.index]); + message = Diagnostics.File_is_library_specified_here; + break; + } + const target = getNameOfScriptTarget(getEmitScriptTarget(options)); + configFileNode = target ? getOptionsSyntaxByValue(getCompilerOptionsObjectLiteralSyntax(), "target", target) : undefined; + message = Diagnostics.File_is_default_library_for_target_specified_here; + break; + default: + Debug.assertNever(reason); + } + return configFileNode && createDiagnosticForNodeInSourceFile( + options.configFile, + configFileNode, + message, + ); + } +} diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 49938f0fc8249..4a92c3187045f 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -13,6 +13,7 @@ import { PackageJsonInfo, PackageJsonInfoCache, Pattern, + ProgramDiagnostics, SymlinkCache, ThisContainer, } from "./_namespaces/ts.js"; @@ -4892,6 +4893,7 @@ export interface Program extends ScriptReferenceHost { * @internal */ resolvedLibReferences: Map | undefined; + /** @internal */ getProgramDiagnosticsContainer: () => ProgramDiagnostics; /** @internal */ getCurrentPackagesMap(): Map | undefined; /** * Is the file emitted file diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 1ff3a2acada46..60db22498601f 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -138,6 +138,7 @@ import { FileExtensionInfo, fileExtensionIs, fileExtensionIsOneOf, + FileReference, FileWatcher, filter, find, @@ -408,6 +409,7 @@ import { lastOrUndefined, LateVisibilityPaintedStatement, length, + libMap, LiteralImportTypeNode, LiteralLikeElementAccessExpression, LiteralLikeNode, @@ -497,6 +499,7 @@ import { ResolutionMode, ResolvedModuleFull, ResolvedModuleWithFailedLookupLocations, + ResolvedProjectReference, ResolvedTypeReferenceDirective, ResolvedTypeReferenceDirectiveWithFailedLookupLocations, resolvePath, @@ -549,6 +552,7 @@ import { TextRange, TextSpan, ThisTypePredicate, + toFileNameLowerCase, Token, TokenFlags, tokenToString, @@ -3016,14 +3020,6 @@ export function forEachPropertyAssignment(objectLiteral: ObjectLiteralExpress }); } -/** @internal */ -export function getPropertyArrayElementValue(objectLiteral: ObjectLiteralExpression, propKey: string, elementValue: string): StringLiteral | undefined { - return forEachPropertyAssignment(objectLiteral, propKey, property => - isArrayLiteralExpression(property.initializer) ? - find(property.initializer.elements, (element): element is StringLiteral => isStringLiteral(element) && element.text === elementValue) : - undefined); -} - /** @internal */ export function getTsConfigObjectLiteralExpression(tsConfigSourceFile: TsConfigSourceFile | undefined): ObjectLiteralExpression | undefined { if (tsConfigSourceFile && tsConfigSourceFile.statements.length) { @@ -12113,3 +12109,91 @@ export function isNewScopeNode(node: Node): node is IntroducesNewScopeNode { || isJSDocSignature(node) || isMappedTypeNode(node); } + +/** @internal */ +export function getLibNameFromLibReference(libReference: FileReference): string { + return toFileNameLowerCase(libReference.fileName); +} + +/** @internal */ +export function getLibFileNameFromLibReference(libReference: FileReference): string | undefined { + const libName = getLibNameFromLibReference(libReference); + return libMap.get(libName); +} + +/** @internal */ +export function forEachResolvedProjectReference( + resolvedProjectReferences: readonly (ResolvedProjectReference | undefined)[] | undefined, + cb: (resolvedProjectReference: ResolvedProjectReference, parent: ResolvedProjectReference | undefined) => T | undefined, +): T | undefined { + return forEachProjectReference( + /*projectReferences*/ undefined, + resolvedProjectReferences, + (resolvedRef, parent) => resolvedRef && cb(resolvedRef, parent), + ); +} + +/** @internal */ +export function forEachProjectReference( + projectReferences: readonly ProjectReference[] | undefined, + resolvedProjectReferences: readonly (ResolvedProjectReference | undefined)[] | undefined, + cbResolvedRef: (resolvedRef: ResolvedProjectReference | undefined, parent: ResolvedProjectReference | undefined, index: number) => T | undefined, + cbRef?: (projectReferences: readonly ProjectReference[] | undefined, parent: ResolvedProjectReference | undefined) => T | undefined, +): T | undefined { + let seenResolvedRefs: Set | undefined; + return worker(projectReferences, resolvedProjectReferences, /*parent*/ undefined); + + function worker( + projectReferences: readonly ProjectReference[] | undefined, + resolvedProjectReferences: readonly (ResolvedProjectReference | undefined)[] | undefined, + parent: ResolvedProjectReference | undefined, + ): T | undefined { + // Visit project references first + if (cbRef) { + const result = cbRef(projectReferences, parent); + if (result) return result; + } + let skipChildren: Set | undefined; + return forEach( + resolvedProjectReferences, + (resolvedRef, index) => { + if (resolvedRef && seenResolvedRefs?.has(resolvedRef.sourceFile.path)) { + (skipChildren ??= new Set()).add(resolvedRef); + // ignore recursives + return undefined; + } + const result = cbResolvedRef(resolvedRef, parent, index); + if (result || !resolvedRef) return result; + (seenResolvedRefs ||= new Set()).add(resolvedRef.sourceFile.path); + }, + ) || forEach( + resolvedProjectReferences, + resolvedRef => + resolvedRef && !skipChildren?.has(resolvedRef) ? + worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef) : + undefined, + ); + } +} + +/** @internal */ +export function getOptionsSyntaxByArrayElementValue(optionsObject: ObjectLiteralExpression | undefined, name: string, value: string): StringLiteral | undefined { + return optionsObject && getPropertyArrayElementValue(optionsObject, name, value); +} + +function getPropertyArrayElementValue(objectLiteral: ObjectLiteralExpression, propKey: string, elementValue: string): StringLiteral | undefined { + return forEachPropertyAssignment(objectLiteral, propKey, property => + isArrayLiteralExpression(property.initializer) ? + find(property.initializer.elements, (element): element is StringLiteral => isStringLiteral(element) && element.text === elementValue) : + undefined); +} + +/** @internal */ +export function getOptionsSyntaxByValue(optionsObject: ObjectLiteralExpression | undefined, name: string, value: string): StringLiteral | undefined { + return forEachOptionsSyntaxByName(optionsObject, name, property => isStringLiteral(property.initializer) && property.initializer.text === value ? property.initializer : undefined); +} + +/** @internal */ +export function forEachOptionsSyntaxByName(optionsObject: ObjectLiteralExpression | undefined, name: string, callback: (prop: PropertyAssignment) => T | undefined): T | undefined { + return forEachPropertyAssignment(optionsObject, name, callback); +} From 700ee076e515db2ef49d8cf7e4dc4bf70679575c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 10:42:48 -0800 Subject: [PATCH 42/46] Bump the github-actions group with 2 updates (#60963) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- .github/workflows/codeql.yml | 6 +++--- .github/workflows/release-branch-artifact.yaml | 2 +- .github/workflows/scorecard.yml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4141cc512e5cb..e771cc8234f96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,7 +90,7 @@ jobs: run: npm test -- --no-lint --coverage - name: Upload coverage artifact - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: name: coverage path: coverage @@ -334,7 +334,7 @@ jobs: - name: Upload baseline diff artifact if: ${{ failure() && steps.check-baselines.conclusion == 'failure' }} - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: name: fix_baselines.patch path: fix_baselines.patch diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a727b884d21ae..e0aef479f0815 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -46,7 +46,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 + uses: github/codeql-action/init@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1 with: config-file: ./.github/codeql/codeql-configuration.yml # Override language selection by uncommenting this and choosing your languages @@ -56,7 +56,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below). - name: Autobuild - uses: github/codeql-action/autobuild@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 + uses: github/codeql-action/autobuild@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -70,4 +70,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 + uses: github/codeql-action/analyze@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1 diff --git a/.github/workflows/release-branch-artifact.yaml b/.github/workflows/release-branch-artifact.yaml index 3b91ae5a2f3dc..21488653e0855 100644 --- a/.github/workflows/release-branch-artifact.yaml +++ b/.github/workflows/release-branch-artifact.yaml @@ -44,7 +44,7 @@ jobs: npm pack ./ mv typescript-*.tgz typescript.tgz - name: Upload built tarfile - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: name: tgz path: typescript.tgz diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index e3e43e4fc0d22..253495c24edc1 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -47,7 +47,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: 'Upload artifact' - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: name: SARIF file path: results.sarif @@ -55,6 +55,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: 'Upload to code-scanning' - uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 + uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1 with: sarif_file: results.sarif From 7901a397214e8c7b39de8954eecc707dce8cb099 Mon Sep 17 00:00:00 2001 From: BitFlippa27 <32537389+BitFlippa27@users.noreply.github.com> Date: Fri, 17 Jan 2025 00:58:51 +0100 Subject: [PATCH 43/46] Fix JSDoc for Array#sort, TypedArray#sort and Array#toSorted methods (#60983) --- src/lib/es2023.array.d.ts | 4 ++-- src/lib/es5.d.ts | 2 +- .../completionEntryForUnionMethod.baseline | 2 +- ...oToTypeDefinition_arrayType.baseline.jsonc | 4 ++-- tests/lib/lib.d.ts | 20 +++++++++---------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/lib/es2023.array.d.ts b/src/lib/es2023.array.d.ts index 6615937424fa1..77f3766c5c728 100644 --- a/src/lib/es2023.array.d.ts +++ b/src/lib/es2023.array.d.ts @@ -31,7 +31,7 @@ interface Array { * Returns a copy of an array with its elements sorted. * @param compareFn Function used to determine the order of the elements. It is expected to return * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive - * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. + * value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order. * ```ts * [11, 2, 22, 1].toSorted((a, b) => a - b) // [1, 2, 11, 22] * ``` @@ -109,7 +109,7 @@ interface ReadonlyArray { * Copies and sorts the array. * @param compareFn Function used to determine the order of the elements. It is expected to return * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive - * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. + * value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order. * ```ts * [11, 2, 22, 1].toSorted((a, b) => a - b) // [1, 2, 11, 22] * ``` diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 2b0b01abe2cb6..ae5c1e2b60bbf 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -1366,7 +1366,7 @@ interface Array { * This method mutates the array and returns a reference to the same array. * @param compareFn Function used to determine the order of the elements. It is expected to return * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive - * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. + * value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order. * ```ts * [11,2,22,1].sort((a, b) => a - b) * ``` diff --git a/tests/baselines/reference/completionEntryForUnionMethod.baseline b/tests/baselines/reference/completionEntryForUnionMethod.baseline index fac6df3daa661..4a503b4a10a4c 100644 --- a/tests/baselines/reference/completionEntryForUnionMethod.baseline +++ b/tests/baselines/reference/completionEntryForUnionMethod.baseline @@ -4190,7 +4190,7 @@ "kind": "space" }, { - "text": "Function used to determine the order of the elements. It is expected to return\na negative value if the first argument is less than the second argument, zero if they're equal, and a positive\nvalue otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\n```ts\n[11,2,22,1].sort((a, b) => a - b)\n```", + "text": "Function used to determine the order of the elements. It is expected to return\na negative value if the first argument is less than the second argument, zero if they're equal, and a positive\nvalue otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order.\n```ts\n[11,2,22,1].sort((a, b) => a - b)\n```", "kind": "text" } ] diff --git a/tests/baselines/reference/goToTypeDefinition_arrayType.baseline.jsonc b/tests/baselines/reference/goToTypeDefinition_arrayType.baseline.jsonc index 1dc5b63951e85..5ae8068d95112 100644 --- a/tests/baselines/reference/goToTypeDefinition_arrayType.baseline.jsonc +++ b/tests/baselines/reference/goToTypeDefinition_arrayType.baseline.jsonc @@ -78,7 +78,7 @@ // * This method mutates the array and returns a reference to the same array. // * @param compareFn Function used to determine the order of the elements. It is expected to return // * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive -// * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. +// * value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order. // * ```ts // * [11,2,22,1].sort((a, b) => a - b) // * ``` @@ -331,7 +331,7 @@ // * This method mutates the array and returns a reference to the same array. // * @param compareFn Function used to determine the order of the elements. It is expected to return // * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive -// * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. +// * value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order. // * ```ts // * [11,2,22,1].sort((a, b) => a - b) // * ``` diff --git a/tests/lib/lib.d.ts b/tests/lib/lib.d.ts index 7266b020156ab..4bbda4f3b6130 100644 --- a/tests/lib/lib.d.ts +++ b/tests/lib/lib.d.ts @@ -1068,7 +1068,7 @@ interface Array { /** * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. + * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, UTF-16 code unit order. */ sort(compareFn?: (a: T, b: T) => number): T[]; @@ -1612,7 +1612,7 @@ interface Int8Array { /** * Sorts an array. * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. + * omitted, the elements are sorted in ascending, numerical order. */ sort(compareFn?: (a: number, b: number) => number): Int8Array; @@ -1885,7 +1885,7 @@ interface Uint8Array { /** * Sorts an array. * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. + * omitted, the elements are sorted in ascending, numerical order. */ sort(compareFn?: (a: number, b: number) => number): Uint8Array; @@ -2159,7 +2159,7 @@ interface Uint8ClampedArray { /** * Sorts an array. * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. + * omitted, the elements are sorted in ascending, numerical order. */ sort(compareFn?: (a: number, b: number) => number): Uint8ClampedArray; @@ -2432,7 +2432,7 @@ interface Int16Array { /** * Sorts an array. * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. + * omitted, the elements are sorted in ascending, numerical order. */ sort(compareFn?: (a: number, b: number) => number): Int16Array; @@ -2706,7 +2706,7 @@ interface Uint16Array { /** * Sorts an array. * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. + * omitted, the elements are sorted in ascending, numerical order. */ sort(compareFn?: (a: number, b: number) => number): Uint16Array; @@ -2979,7 +2979,7 @@ interface Int32Array { /** * Sorts an array. * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. + * omitted, the elements are sorted in ascending, numerical order. */ sort(compareFn?: (a: number, b: number) => number): Int32Array; @@ -3252,7 +3252,7 @@ interface Uint32Array { /** * Sorts an array. * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. + * omitted, the elements are sorted in ascending, numerical order. */ sort(compareFn?: (a: number, b: number) => number): Uint32Array; @@ -3525,7 +3525,7 @@ interface Float32Array { /** * Sorts an array. * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. + * omitted, the elements are sorted in ascending, numerical order. */ sort(compareFn?: (a: number, b: number) => number): Float32Array; @@ -3799,7 +3799,7 @@ interface Float64Array { /** * Sorts an array. * @param compareFn The name of the function used to determine the order of the elements. If - * omitted, the elements are sorted in ascending, ASCII character order. + * omitted, the elements are sorted in ascending, numerical order. */ sort(compareFn?: (a: number, b: number) => number): Float64Array; From 32e8f8b81c84acb929c77cc06929e7e5f59f309a Mon Sep 17 00:00:00 2001 From: "Oleksandr T." Date: Fri, 17 Jan 2025 21:57:01 +0200 Subject: [PATCH 44/46] feat(60475): Add getUnknownType to checker api (#60502) --- src/compiler/checker.ts | 1 + src/compiler/types.ts | 1 + tests/baselines/reference/api/typescript.d.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 80b61edd3657a..5eb14081e2a3c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1824,6 +1824,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { getNumberLiteralType, getBigIntType: () => bigintType, getBigIntLiteralType, + getUnknownType: () => unknownType, createPromiseType, createArrayType, getElementTypeOfArrayType, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 4a92c3187045f..ad915af32ee83 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -5263,6 +5263,7 @@ export interface TypeChecker { getBigIntType(): Type; getBigIntLiteralType(value: PseudoBigInt): BigIntLiteralType; getBooleanType(): Type; + getUnknownType(): Type; /* eslint-disable @typescript-eslint/unified-signatures */ /** @internal */ getFalseType(fresh?: boolean): Type; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 4b4404634fdaa..2f7870cfad96f 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -6288,6 +6288,7 @@ declare namespace ts { getBigIntType(): Type; getBigIntLiteralType(value: PseudoBigInt): BigIntLiteralType; getBooleanType(): Type; + getUnknownType(): Type; getFalseType(): Type; getTrueType(): Type; getVoidType(): Type; From f99803d05f3ec8b4b5317359f05a15a17f69dec4 Mon Sep 17 00:00:00 2001 From: "Oleksandr T." Date: Fri, 17 Jan 2025 22:05:26 +0200 Subject: [PATCH 45/46] fix(60551): satisfies is shown on go-to-implementation (#60801) --- src/services/findAllReferences.ts | 3 +- ...oToImplementation_satisfies.baseline.jsonc | 30 +++++++++++++++++++ .../fourslash/goToImplementation_satisfies.ts | 12 ++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/goToImplementation_satisfies.baseline.jsonc create mode 100644 tests/cases/fourslash/goToImplementation_satisfies.ts diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 710a01b1c2dea..ea1f164f84f7f 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -179,6 +179,7 @@ import { isReferencedFile, isReferenceFileLocation, isRightSideOfPropertyAccess, + isSatisfiesExpression, isShorthandPropertyAssignment, isSourceFile, isStatement, @@ -2282,7 +2283,7 @@ export namespace Core { addIfImplementation(body); } } - else if (isAssertionExpression(typeHavingNode)) { + else if (isAssertionExpression(typeHavingNode) || isSatisfiesExpression(typeHavingNode)) { addIfImplementation(typeHavingNode.expression); } } diff --git a/tests/baselines/reference/goToImplementation_satisfies.baseline.jsonc b/tests/baselines/reference/goToImplementation_satisfies.baseline.jsonc new file mode 100644 index 0000000000000..7001dc9668590 --- /dev/null +++ b/tests/baselines/reference/goToImplementation_satisfies.baseline.jsonc @@ -0,0 +1,30 @@ +// === goToImplementation === +// === /a.ts === +// interface /*GOTO IMPL*/I { +// foo: string; +// } +// +// function f() { +// const foo = [|{ foo: '' }|] satisfies I; +// } + + // === Details === + [ + { + "kind": "interface", + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "object literal", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ] + } + ] \ No newline at end of file diff --git a/tests/cases/fourslash/goToImplementation_satisfies.ts b/tests/cases/fourslash/goToImplementation_satisfies.ts new file mode 100644 index 0000000000000..1befdcfa40146 --- /dev/null +++ b/tests/cases/fourslash/goToImplementation_satisfies.ts @@ -0,0 +1,12 @@ +/// + +// @filename: /a.ts +////interface /*def*/I { +//// foo: string; +////} +//// +////function f() { +//// const foo = { foo: '' } satisfies [|I|]; +////} + +verify.baselineGoToImplementation('def'); From 5170645f4e4b395891fad823bfe03ac628411afb Mon Sep 17 00:00:00 2001 From: "Oleksandr T." Date: Fri, 17 Jan 2025 22:12:12 +0200 Subject: [PATCH 46/46] fix(60592): JSDoc implements space sensetive (#60640) --- src/compiler/parser.ts | 1 + tests/baselines/reference/extendsTag3.js | 19 +++++++++++ tests/baselines/reference/extendsTag3.symbols | 14 ++++++++ tests/baselines/reference/extendsTag3.types | 19 +++++++++++ tests/baselines/reference/extendsTag6.symbols | 26 +++++++++++++++ tests/baselines/reference/extendsTag6.types | 32 +++++++++++++++++++ .../reference/jsdocImplementsTag.symbols | 17 ++++++++++ .../reference/jsdocImplementsTag.types | 21 ++++++++++++ tests/cases/conformance/jsdoc/extendsTag3.ts | 10 ++++++ tests/cases/conformance/jsdoc/extendsTag6.ts | 22 +++++++++++++ .../conformance/jsdoc/jsdocImplementsTag.ts | 15 +++++++++ 11 files changed, 196 insertions(+) create mode 100644 tests/baselines/reference/extendsTag6.symbols create mode 100644 tests/baselines/reference/extendsTag6.types create mode 100644 tests/baselines/reference/jsdocImplementsTag.symbols create mode 100644 tests/baselines/reference/jsdocImplementsTag.types create mode 100644 tests/cases/conformance/jsdoc/extendsTag6.ts create mode 100644 tests/cases/conformance/jsdoc/jsdocImplementsTag.ts diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 59ad1f030220f..8c69cccba1282 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -9536,6 +9536,7 @@ namespace Parser { const node = factory.createExpressionWithTypeArguments(expression, typeArguments) as ExpressionWithTypeArguments & { expression: Identifier | PropertyAccessEntityNameExpression; }; const res = finishNode(node, pos); if (usedBrace) { + skipWhitespace(); parseExpected(SyntaxKind.CloseBraceToken); } return res; diff --git a/tests/baselines/reference/extendsTag3.js b/tests/baselines/reference/extendsTag3.js index 999982f3289b1..68180aa6214fb 100644 --- a/tests/baselines/reference/extendsTag3.js +++ b/tests/baselines/reference/extendsTag3.js @@ -17,6 +17,16 @@ class B extends A { super(); } } + +/** + * @extends { A } + * @constructor + */ +class C extends A { + constructor() { + super(); + } +} //// [foo.js] @@ -35,3 +45,12 @@ class B extends A { super(); } } +/** + * @extends { A } + * @constructor + */ +class C extends A { + constructor() { + super(); + } +} diff --git a/tests/baselines/reference/extendsTag3.symbols b/tests/baselines/reference/extendsTag3.symbols index 4fa623c2649ce..265cd1313f900 100644 --- a/tests/baselines/reference/extendsTag3.symbols +++ b/tests/baselines/reference/extendsTag3.symbols @@ -24,3 +24,17 @@ class B extends A { } } +/** + * @extends { A } + * @constructor + */ +class C extends A { +>C : Symbol(C, Decl(foo.js, 15, 1)) +>A : Symbol(A, Decl(foo.js, 0, 0)) + + constructor() { + super(); +>super : Symbol(A, Decl(foo.js, 0, 0)) + } +} + diff --git a/tests/baselines/reference/extendsTag3.types b/tests/baselines/reference/extendsTag3.types index c9f7a76260cdd..04a08d0f32ce2 100644 --- a/tests/baselines/reference/extendsTag3.types +++ b/tests/baselines/reference/extendsTag3.types @@ -30,3 +30,22 @@ class B extends A { } } +/** + * @extends { A } + * @constructor + */ +class C extends A { +>C : C +> : ^ +>A : A +> : ^ + + constructor() { + super(); +>super() : void +> : ^^^^ +>super : typeof A +> : ^^^^^^^^ + } +} + diff --git a/tests/baselines/reference/extendsTag6.symbols b/tests/baselines/reference/extendsTag6.symbols new file mode 100644 index 0000000000000..c0e9f051ce49f --- /dev/null +++ b/tests/baselines/reference/extendsTag6.symbols @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/jsdoc/extendsTag6.ts] //// + +=== foo.js === +/** + * @constructor + */ +class A { +>A : Symbol(A, Decl(foo.js, 0, 0)) + + constructor() {} +} + +/** + * @extends { A } + * @constructor + */ +class B extends A { +>B : Symbol(B, Decl(foo.js, 5, 1)) +>A : Symbol(A, Decl(foo.js, 0, 0)) + + constructor() { + super(); +>super : Symbol(A, Decl(foo.js, 0, 0)) + } +} + diff --git a/tests/baselines/reference/extendsTag6.types b/tests/baselines/reference/extendsTag6.types new file mode 100644 index 0000000000000..886b33328eae3 --- /dev/null +++ b/tests/baselines/reference/extendsTag6.types @@ -0,0 +1,32 @@ +//// [tests/cases/conformance/jsdoc/extendsTag6.ts] //// + +=== foo.js === +/** + * @constructor + */ +class A { +>A : A +> : ^ + + constructor() {} +} + +/** + * @extends { A } + * @constructor + */ +class B extends A { +>B : B +> : ^ +>A : A +> : ^ + + constructor() { + super(); +>super() : void +> : ^^^^ +>super : typeof A +> : ^^^^^^^^ + } +} + diff --git a/tests/baselines/reference/jsdocImplementsTag.symbols b/tests/baselines/reference/jsdocImplementsTag.symbols new file mode 100644 index 0000000000000..e582dae1d074a --- /dev/null +++ b/tests/baselines/reference/jsdocImplementsTag.symbols @@ -0,0 +1,17 @@ +//// [tests/cases/conformance/jsdoc/jsdocImplementsTag.ts] //// + +=== /a.js === +/** + * @typedef { { foo: string } } A + */ + +/** + * @implements { A } + */ +class B { +>B : Symbol(B, Decl(a.js, 0, 0)) + + foo = '' +>foo : Symbol(B.foo, Decl(a.js, 7, 9)) +} + diff --git a/tests/baselines/reference/jsdocImplementsTag.types b/tests/baselines/reference/jsdocImplementsTag.types new file mode 100644 index 0000000000000..496e4b1fcbfe7 --- /dev/null +++ b/tests/baselines/reference/jsdocImplementsTag.types @@ -0,0 +1,21 @@ +//// [tests/cases/conformance/jsdoc/jsdocImplementsTag.ts] //// + +=== /a.js === +/** + * @typedef { { foo: string } } A + */ + +/** + * @implements { A } + */ +class B { +>B : B +> : ^ + + foo = '' +>foo : string +> : ^^^^^^ +>'' : "" +> : ^^ +} + diff --git a/tests/cases/conformance/jsdoc/extendsTag3.ts b/tests/cases/conformance/jsdoc/extendsTag3.ts index 81ac1e68843d3..28ca684ac71d8 100644 --- a/tests/cases/conformance/jsdoc/extendsTag3.ts +++ b/tests/cases/conformance/jsdoc/extendsTag3.ts @@ -20,3 +20,13 @@ class B extends A { super(); } } + +/** + * @extends { A } + * @constructor + */ +class C extends A { + constructor() { + super(); + } +} diff --git a/tests/cases/conformance/jsdoc/extendsTag6.ts b/tests/cases/conformance/jsdoc/extendsTag6.ts new file mode 100644 index 0000000000000..e7eee6ec8cdf9 --- /dev/null +++ b/tests/cases/conformance/jsdoc/extendsTag6.ts @@ -0,0 +1,22 @@ +// @allowJs: true +// @checkJs: true +// @target: esnext +// @noEmit: true +// @Filename: foo.js + +/** + * @constructor + */ +class A { + constructor() {} +} + +/** + * @extends { A } + * @constructor + */ +class B extends A { + constructor() { + super(); + } +} diff --git a/tests/cases/conformance/jsdoc/jsdocImplementsTag.ts b/tests/cases/conformance/jsdoc/jsdocImplementsTag.ts new file mode 100644 index 0000000000000..355ac8ca43af3 --- /dev/null +++ b/tests/cases/conformance/jsdoc/jsdocImplementsTag.ts @@ -0,0 +1,15 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true + +// @Filename: /a.js +/** + * @typedef { { foo: string } } A + */ + +/** + * @implements { A } + */ +class B { + foo = '' +}