diff --git a/package.json b/package.json index ffc56b0d24a1a..55f107c8f25df 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "4.6.0", + "version": "4.6.0-beta", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/corePublic.ts b/src/compiler/corePublic.ts index f15b438c02fc3..d279a6e9d286c 100644 --- a/src/compiler/corePublic.ts +++ b/src/compiler/corePublic.ts @@ -5,7 +5,7 @@ namespace ts { // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - export const version: string = `${versionMajorMinor}.0-dev`; + export const version = `${versionMajorMinor}.0-beta`; /** * Type of objects whose values are all of the same type. diff --git a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node12).errors.txt b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node12).errors.txt new file mode 100644 index 0000000000000..a962cf6923089 --- /dev/null +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node12).errors.txt @@ -0,0 +1,12 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/compiler/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=nodenext).errors.txt b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=nodenext).errors.txt new file mode 100644 index 0000000000000..6b05a193faf78 --- /dev/null +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=nodenext).errors.txt @@ -0,0 +1,12 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/compiler/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/importAssertionNonstring.errors.txt b/tests/baselines/reference/importAssertionNonstring.errors.txt index a619f9f2d4f7a..b9695df3dec75 100644 --- a/tests/baselines/reference/importAssertionNonstring.errors.txt +++ b/tests/baselines/reference/importAssertionNonstring.errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/compiler/mod.mts(1,52): error TS2837: Import assertion values must be string literal expressions. tests/cases/compiler/mod.mts(3,52): error TS2837: Import assertion values must be string literal expressions. tests/cases/compiler/mod.mts(5,52): error TS2837: Import assertion values must be string literal expressions. @@ -6,6 +7,7 @@ tests/cases/compiler/mod.mts(9,52): error TS2837: Import assertion values must b tests/cases/compiler/mod.mts(11,66): error TS2837: Import assertion values must be string literal expressions. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/compiler/mod.mts (6 errors) ==== import * as thing1 from "./mod.mjs" assert {field: 0}; ~ diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node12).errors.txt b/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node12).errors.txt new file mode 100644 index 0000000000000..a73ccd1ed6c4a --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node12).errors.txt @@ -0,0 +1,15 @@ +error TS4124: Compiler option 'moduleResolution' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'moduleResolution' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": "./entrypoint.js" + } +==== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts (0 errors) ==== + export declare function thing(): void; +==== tests/cases/compiler/index.ts (0 errors) ==== + import * as p from "pkg"; + p.thing(); \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=nodenext).errors.txt b/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=nodenext).errors.txt new file mode 100644 index 0000000000000..c4033bb0e75e1 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=nodenext).errors.txt @@ -0,0 +1,15 @@ +error TS4124: Compiler option 'moduleResolution' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'moduleResolution' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": "./entrypoint.js" + } +==== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts (0 errors) ==== + export declare function thing(): void; +==== tests/cases/compiler/index.ts (0 errors) ==== + import * as p from "pkg"; + p.thing(); \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).errors.txt b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).errors.txt index dc0e81b025924..54e5df1e14817 100644 --- a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).errors.txt +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/compiler/index.ts(1,20): error TS2307: Cannot find module 'pkg' or its corresponding type declarations. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== { "name": "pkg", diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node12).errors.txt b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node12).errors.txt new file mode 100644 index 0000000000000..83e9440780da1 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node12).errors.txt @@ -0,0 +1,15 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": "./entrypoint.js" + } +==== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts (0 errors) ==== + export declare function thing(): void; +==== tests/cases/compiler/index.ts (0 errors) ==== + import * as p from "pkg"; + p.thing(); \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=nodenext).errors.txt b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=nodenext).errors.txt new file mode 100644 index 0000000000000..83e9440780da1 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=nodenext).errors.txt @@ -0,0 +1,15 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": "./entrypoint.js" + } +==== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts (0 errors) ==== + export declare function thing(): void; +==== tests/cases/compiler/index.ts (0 errors) ==== + import * as p from "pkg"; + p.thing(); \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node).errors.txt b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node).errors.txt index dc0e81b025924..6189f8f7157e5 100644 --- a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node).errors.txt +++ b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/compiler/index.ts(1,20): error TS2307: Cannot find module 'pkg' or its corresponding type declarations. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== { "name": "pkg", diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node12).errors.txt b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node12).errors.txt new file mode 100644 index 0000000000000..e600215c02e9c --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node12).errors.txt @@ -0,0 +1,15 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": "./entrypoint.js" + } +==== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts (0 errors) ==== + export declare function thing(): void; +==== tests/cases/compiler/index.ts (0 errors) ==== + import * as p from "pkg"; + p.thing(); \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=nodenext).errors.txt b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=nodenext).errors.txt new file mode 100644 index 0000000000000..e600215c02e9c --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=nodenext).errors.txt @@ -0,0 +1,15 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": "./entrypoint.js" + } +==== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts (0 errors) ==== + export declare function thing(): void; +==== tests/cases/compiler/index.ts (0 errors) ==== + import * as p from "pkg"; + p.thing(); \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt index 5f3cbbc121cfb..8049137b88dc6 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.mjs'? /src/bar.mts(3,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== /src/foo.mts (0 errors) ==== export function foo() { return ""; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension2.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension2.errors.txt index e541ad83a67cd..be802c75d2029 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension2.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension2.errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /src/buzz.mts(2,22): error TS2307: Cannot find module './foo' or its corresponding type declarations. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== /src/buzz.mts (1 errors) ==== // Extensionless relative path cjs import in an ES module import foo = require("./foo"); // should error, should not ask for extension diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt index 0c753a1029900..351b441e9b6c4 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.jsx'? +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== /src/foo.tsx (0 errors) ==== export function foo() { return ""; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt index afd24269d69bc..f3e5a6798fe18 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.js'? +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== /src/foo.tsx (0 errors) ==== export function foo() { return ""; diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension5.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension5.errors.txt index b4b0a89ae974f..e9960a2913dc6 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension5.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension5.errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /src/buzz.mts(2,8): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== /src/buzz.mts (1 errors) ==== // Extensionless relative path dynamic import in an ES module import("./foo").then(x => x); // should error, ask for extension diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension6.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension6.errors.txt index 267a4cd5a0a53..f1a04e1436786 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension6.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension6.errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /src/bar.cts(4,21): error TS2307: Cannot find module './foo' or its corresponding type declarations. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== /src/bar.cts (1 errors) ==== // Extensionless relative path import statement in a cjs module // Import statements are not allowed in cjs files, diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension7.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension7.errors.txt index 0ff660b3418e3..7e9dfe9e3da65 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension7.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension7.errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /src/bar.cts(2,22): error TS2307: Cannot find module './foo' or its corresponding type declarations. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== /src/bar.cts (1 errors) ==== // Extensionless relative path cjs import in a cjs module import foo = require("./foo"); // should error, should not ask for extension diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension8.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension8.errors.txt index c990522c6c707..29446cac10eb0 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension8.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension8.errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. /src/bar.cts(2,8): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== /src/bar.cts (1 errors) ==== // Extensionless relative path dynamic import in a cjs module import("./foo").then(x => x); // should error, ask for extension diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).errors.txt b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).errors.txt index bdf6aba250c51..715d7ca6491d6 100644 --- a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).errors.txt +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.cjs(2,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as self from "package"; diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=nodenext).errors.txt b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=nodenext).errors.txt index bdf6aba250c51..fae0f8d77b6cf 100644 --- a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=nodenext).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.cjs(2,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as self from "package"; diff --git a/tests/baselines/reference/nodeModules1(module=node12).errors.txt b/tests/baselines/reference/nodeModules1(module=node12).errors.txt index 724e3b73ed7b2..2d044d8e9a543 100644 --- a/tests/baselines/reference/nodeModules1(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModules1(module=node12).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(2,21): error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(3,21): error TS1471: Module './index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(6,21): error TS1471: Module './subfolder/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -81,6 +82,7 @@ tests/cases/conformance/node/index.ts(83,21): error TS2834: Relative import path tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== // cjs format file const x = 1; diff --git a/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt index 724e3b73ed7b2..25bf469c4edd9 100644 --- a/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(2,21): error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(3,21): error TS1471: Module './index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(6,21): error TS1471: Module './subfolder/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -81,6 +82,7 @@ tests/cases/conformance/node/index.ts(83,21): error TS2834: Relative import path tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== // cjs format file const x = 1; diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt index 178c28ed46004..6b41311ed0a86 100644 --- a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.cjs(2,21): error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(3,21): error TS1471: Module './index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(6,21): error TS1471: Module './subfolder/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -114,6 +115,7 @@ tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Relative im tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (0 errors) ==== // cjs format file const x = 1; diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt index 178c28ed46004..91108c039eca6 100644 --- a/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.cjs(2,21): error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(3,21): error TS1471: Module './index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(6,21): error TS1471: Module './subfolder/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -114,6 +115,7 @@ tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Relative im tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (0 errors) ==== // cjs format file const x = 1; diff --git a/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node12).errors.txt new file mode 100644 index 0000000000000..3f2ac5c4fb40a --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node12).errors.txt @@ -0,0 +1,9 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/conformance/node/allowJs/foo.cjs (0 errors) ==== + exports.foo = "foo" +==== tests/cases/conformance/node/allowJs/bar.ts (0 errors) ==== + import foo from "./foo.cjs" + foo.foo; \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=nodenext).errors.txt new file mode 100644 index 0000000000000..13c8a3d188ed4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=nodenext).errors.txt @@ -0,0 +1,9 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/conformance/node/allowJs/foo.cjs (0 errors) ==== + exports.foo = "foo" +==== tests/cases/conformance/node/allowJs/bar.ts (0 errors) ==== + import foo from "./foo.cjs" + foo.foo; \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).errors.txt index 83e50c001e74c..3d6661ca7df4f 100644 --- a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts(2,13): error TS2303: Circular definition of import alias 'cjs'. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=nodenext).errors.txt index 83e50c001e74c..3c5537638eeeb 100644 --- a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=nodenext).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts(2,13): error TS2303: Circular definition of import alias 'cjs'. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).errors.txt new file mode 100644 index 0000000000000..ea7e025400d30 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).errors.txt @@ -0,0 +1,26 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/conformance/node/allowJs/subfolder/index.js (0 errors) ==== + // cjs format file + export async function main() { + const { readFile } = await import("fs"); + } +==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== + // esm format file + export async function main() { + const { readFile } = await import("fs"); + } +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/allowJs/types.d.ts (0 errors) ==== + declare module "fs"; \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=nodenext).errors.txt new file mode 100644 index 0000000000000..c2277811d17c4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=nodenext).errors.txt @@ -0,0 +1,26 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/conformance/node/allowJs/subfolder/index.js (0 errors) ==== + // cjs format file + export async function main() { + const { readFile } = await import("fs"); + } +==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== + // esm format file + export async function main() { + const { readFile } = await import("fs"); + } +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/allowJs/types.d.ts (0 errors) ==== + declare module "fs"; \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).errors.txt index a0a3d489f44cb..4482e7d789158 100644 --- a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/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`. tests/cases/conformance/node/allowJs/index.js(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. tests/cases/conformance/node/allowJs/index.js(3,1): error TS8003: 'export =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/subfolder/index.js(3,1): error TS8003: 'export =' can only be used in TypeScript files. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (1 errors) ==== // cjs format file const a = {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=nodenext).errors.txt index a0a3d489f44cb..2c045814c36a6 100644 --- a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=nodenext).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/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`. tests/cases/conformance/node/allowJs/index.js(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. tests/cases/conformance/node/allowJs/index.js(3,1): error TS8003: 'export =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/subfolder/index.js(3,1): error TS8003: 'export =' can only be used in TypeScript files. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (1 errors) ==== // cjs format file const a = {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).errors.txt index 84386984bc398..a6ca0097301ed 100644 --- a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/subfolder/index.js(2,10): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. tests/cases/conformance/node/allowJs/subfolder/index.js(3,7): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. tests/cases/conformance/node/allowJs/subfolder/index.js(4,7): error TS2725: Class name cannot be 'Object' when targeting ES5 with module Node12. tests/cases/conformance/node/allowJs/subfolder/index.js(5,14): error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (4 errors) ==== // cjs format file function require() {} diff --git a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=nodenext).errors.txt index 1e12bbbe4ed99..8bba21e77bc3f 100644 --- a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=nodenext).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/subfolder/index.js(2,10): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. tests/cases/conformance/node/allowJs/subfolder/index.js(3,7): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. tests/cases/conformance/node/allowJs/subfolder/index.js(4,7): error TS2725: Class name cannot be 'Object' when targeting ES5 with module NodeNext. tests/cases/conformance/node/allowJs/subfolder/index.js(5,14): error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (4 errors) ==== // cjs format file function require() {} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).errors.txt index bbc352d7a78d5..941c563c3af79 100644 --- a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/file.js(4,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/file.js(6,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(2,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -6,6 +7,7 @@ tests/cases/conformance/node/allowJs/subfolder/index.js(2,1): error TS8002: 'imp tests/cases/conformance/node/allowJs/subfolder/index.js(4,1): error TS8002: 'import ... =' can only be used in TypeScript files. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (2 errors) ==== // cjs format file import fs = require("fs"); diff --git a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=nodenext).errors.txt index bbc352d7a78d5..543734d516107 100644 --- a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=nodenext).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/file.js(4,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/file.js(6,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(2,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -6,6 +7,7 @@ tests/cases/conformance/node/allowJs/subfolder/index.js(2,1): error TS8002: 'imp tests/cases/conformance/node/allowJs/subfolder/index.js(4,1): error TS8002: 'import ... =' can only be used in TypeScript files. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (2 errors) ==== // cjs format file import fs = require("fs"); diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).errors.txt index b75c1c1e6f563..0fd3dc2ac0f92 100644 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/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'. tests/cases/conformance/node/allowJs/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'. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (2 errors) ==== // cjs format file import {default as _fs} from "fs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=nodenext).errors.txt index b75c1c1e6f563..34cc47a951495 100644 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=nodenext).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/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'. tests/cases/conformance/node/allowJs/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'. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (2 errors) ==== // cjs format file import {default as _fs} from "fs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).errors.txt index e07871859dbc2..c009a29213dc6 100644 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/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'. tests/cases/conformance/node/allowJs/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'. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.ts (2 errors) ==== // cjs format file export * from "fs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=nodenext).errors.txt index e07871859dbc2..367ad35213cec 100644 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=nodenext).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/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'. tests/cases/conformance/node/allowJs/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'. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.ts (2 errors) ==== // cjs format file export * from "fs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).errors.txt index cd8457101bb44..9847faa236b58 100644 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/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'. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (1 errors) ==== // cjs format file export {default} from "fs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=nodenext).errors.txt index cd8457101bb44..61d1f088aa772 100644 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=nodenext).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/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'. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (1 errors) ==== // cjs format file export {default} from "fs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).errors.txt index 7f8ce4691522c..679dde1f67834 100644 --- a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/subfolder/index.js(2,11): error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (1 errors) ==== // cjs format file const x = import.meta.url; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=nodenext).errors.txt index 7f8ce4691522c..beb6eb935fe7d 100644 --- a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=nodenext).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/subfolder/index.js(2,11): error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (1 errors) ==== // cjs format file const x = import.meta.url; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).errors.txt index e6f4b3ce2eb2b..a26c1da9e0499 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -6,6 +7,7 @@ tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=nodenext).errors.txt index e6f4b3ce2eb2b..20778cab9d115 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=nodenext).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -6,6 +7,7 @@ tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).errors.txt index 261be58f1a221..e78972c525aae 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module '#mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module '#type' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as cjs from "#cjs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=nodenext).errors.txt index 261be58f1a221..d73f4ed90f800 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=nodenext).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module '#mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module '#type' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as cjs from "#cjs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).errors.txt index 0f1999477226b..87d06e019b681 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.cjs(3,23): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as cjsi from "inner/cjs/index"; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=nodenext).errors.txt index 0f1999477226b..223e1c61067e1 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=nodenext).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.cjs(3,23): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as cjsi from "inner/cjs/index"; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).errors.txt index 2036308bb9b9f..75037c36d2575 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.cjs(2,23): error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. tests/cases/conformance/node/allowJs/index.cjs(3,23): error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. tests/cases/conformance/node/allowJs/index.cjs(4,24): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. @@ -18,6 +19,7 @@ tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(3,22): error tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(4,23): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/index.js (3 errors) ==== // esm format file import * as cjsi from "inner/cjs/index.cjs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=nodenext).errors.txt index b989016f16abe..76fb57ea4cead 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=nodenext).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.cjs(3,23): error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as cjsi from "inner/cjs/index.cjs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).errors.txt index c722192e6704e..313bb477b0f22 100644 --- a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.js(3,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/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 synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(5,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -7,6 +8,7 @@ tests/cases/conformance/node/allowJs/subfolder/index.js(3,22): error TS1471: Mod tests/cases/conformance/node/allowJs/subfolder/index.js(5,1): error TS8002: 'import ... =' can only be used in TypeScript files. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (4 errors) ==== // cjs format file import {h} from "../index.js"; diff --git a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=nodenext).errors.txt index c722192e6704e..c54de3edf40a7 100644 --- a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=nodenext).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.js(3,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/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 synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(5,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -7,6 +8,7 @@ tests/cases/conformance/node/allowJs/subfolder/index.js(3,22): error TS1471: Mod tests/cases/conformance/node/allowJs/subfolder/index.js(5,1): error TS8002: 'import ... =' can only be used in TypeScript files. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (4 errors) ==== // cjs format file import {h} from "../index.js"; diff --git a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).errors.txt index b7096bfd56e69..9f4ff910671bb 100644 --- a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/index.js(2,11): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. tests/cases/conformance/node/allowJs/index.js(4,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. tests/cases/conformance/node/allowJs/subfolder/index.js(2,11): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. tests/cases/conformance/node/allowJs/subfolder/index.js(4,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (2 errors) ==== // cjs format file const x = await 1; diff --git a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=nodenext).errors.txt index 50ff19655e97d..6f3e46becedad 100644 --- a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=nodenext).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/allowJs/subfolder/index.js(2,11): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. tests/cases/conformance/node/allowJs/subfolder/index.js(4,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (2 errors) ==== // cjs format file const x = await 1; diff --git a/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node12).errors.txt b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node12).errors.txt new file mode 100644 index 0000000000000..9de4d5bdd5968 --- /dev/null +++ b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node12).errors.txt @@ -0,0 +1,21 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== + // cjs format file + export const a = 1; +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import mod from "./subfolder/index.js"; + mod; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=nodenext).errors.txt new file mode 100644 index 0000000000000..a9b57d52dc6bc --- /dev/null +++ b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=nodenext).errors.txt @@ -0,0 +1,21 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== + // cjs format file + export const a = 1; +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import mod from "./subfolder/index.js"; + mod; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).errors.txt index 7397e1e1dbd27..08df7263b48d6 100644 --- a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/node_modules/inner/index.d.mts(2,13): error TS2303: Circular definition of import alias 'cjs'. tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=nodenext).errors.txt index 7397e1e1dbd27..09f68a442637c 100644 --- a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=nodenext).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/node_modules/inner/index.d.mts(2,13): error TS2303: Circular definition of import alias 'cjs'. tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.errors.txt b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.errors.txt new file mode 100644 index 0000000000000..9025396f15567 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.errors.txt @@ -0,0 +1,73 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + export {}; +==== tests/cases/conformance/node/index.mts (0 errors) ==== + // esm format file + export {}; +==== tests/cases/conformance/node/index.cts (0 errors) ==== + // cjs format file + export {}; +==== tests/cases/conformance/node/other.ts (0 errors) ==== + // esm format file + export const a = await import("package/cjs"); + export const b = await import("package/mjs"); + export const c = await import("package"); + export const f = await import("inner"); +==== tests/cases/conformance/node/other2.ts (0 errors) ==== + // esm format file + export const d = await import("inner/cjs"); + export const e = await import("inner/mjs"); +==== tests/cases/conformance/node/other.mts (0 errors) ==== + // esm format file + export const a = await import("package/cjs"); + export const b = await import("package/mjs"); + export const c = await import("package"); + export const f = await import("inner"); +==== tests/cases/conformance/node/other2.mts (0 errors) ==== + // esm format file + export const d = await import("inner/cjs"); + export const e = await import("inner/mjs"); +==== tests/cases/conformance/node/other.cts (0 errors) ==== + // cjs format file, no TLA + export const a = import("package/cjs"); + export const b = import("package/mjs"); + export const c = import("package"); + export const f = import("inner"); +==== tests/cases/conformance/node/other2.cts (0 errors) ==== + // cjs format file, no TLA + export const d = import("inner/cjs"); + export const e = import("inner/mjs"); +==== tests/cases/conformance/node/node_modules/inner/index.d.ts (0 errors) ==== + // cjs format file + export const cjsMain = true; +==== tests/cases/conformance/node/node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + export const esm = true; +==== tests/cases/conformance/node/node_modules/inner/index.d.cts (0 errors) ==== + // cjs format file + export const cjsNonmain = true; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } +==== tests/cases/conformance/node/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/nodeModulesDeclarationEmitDynamicImportWithPackageExports.js b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.js index f8d6161af5772..e4448e0ad33fa 100644 --- a/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.js +++ b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.js @@ -169,112 +169,3 @@ export declare const d: Promise<{ cjsNonmain: true; }>; export declare const e: Promise; - - -//// [DtsFileErrors] - - -tests/cases/conformance/node/other.d.cts(4,47): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/other.d.cts(5,47): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/other2.d.cts(5,47): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - - -==== tests/cases/conformance/node/index.d.ts (0 errors) ==== - export {}; - -==== tests/cases/conformance/node/index.d.mts (0 errors) ==== - export {}; - -==== tests/cases/conformance/node/index.d.cts (0 errors) ==== - export {}; - -==== tests/cases/conformance/node/other.d.ts (0 errors) ==== - export declare const a: { - default: typeof import("package/cjs"); - }; - export declare const b: typeof import("package/mjs"); - export declare const c: typeof import("package"); - export declare const f: { - default: typeof import("inner"); - cjsMain: true; - }; - -==== tests/cases/conformance/node/other2.d.ts (0 errors) ==== - export declare const d: { - default: typeof import("inner/cjs"); - cjsNonmain: true; - }; - export declare const e: typeof import("inner/mjs"); - -==== tests/cases/conformance/node/other.d.mts (0 errors) ==== - export declare const a: { - default: typeof import("package/cjs"); - }; - export declare const b: typeof import("package/mjs"); - export declare const c: typeof import("package"); - export declare const f: { - default: typeof import("inner"); - cjsMain: true; - }; - -==== tests/cases/conformance/node/other2.d.mts (0 errors) ==== - export declare const d: { - default: typeof import("inner/cjs"); - cjsNonmain: true; - }; - export declare const e: typeof import("inner/mjs"); - -==== tests/cases/conformance/node/other.d.cts (2 errors) ==== - export declare const a: Promise<{ - default: typeof import("package/cjs"); - }>; - export declare const b: Promise; - ~~~~~~~~~~~~~ -!!! error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - export declare const c: Promise; - ~~~~~~~~~ -!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - export declare const f: Promise<{ - default: typeof import("inner"); - cjsMain: true; - }>; - -==== tests/cases/conformance/node/other2.d.cts (1 errors) ==== - export declare const d: Promise<{ - default: typeof import("inner/cjs"); - cjsNonmain: true; - }>; - export declare const e: Promise; - ~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - -==== tests/cases/conformance/node/node_modules/inner/index.d.ts (0 errors) ==== - // cjs format file - export const cjsMain = true; -==== tests/cases/conformance/node/node_modules/inner/index.d.mts (0 errors) ==== - // esm format file - export const esm = true; -==== tests/cases/conformance/node/node_modules/inner/index.d.cts (0 errors) ==== - // cjs format file - export const cjsNonmain = true; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } - } -==== tests/cases/conformance/node/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=node12).errors.txt b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).errors.txt index 11f39b9dd9366..76c4349f83f15 100644 --- a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -8,6 +9,7 @@ tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: tests/cases/conformance/node/node_modules/inner/index.d.ts(5,1): error TS1036: Statements are not allowed in ambient contexts. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=nodenext).errors.txt index 11f39b9dd9366..6a6d1d80fd43a 100644 --- a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=nodenext).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -8,6 +9,7 @@ tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: tests/cases/conformance/node/node_modules/inner/index.d.ts(5,1): error TS1036: Statements are not allowed in ambient contexts. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesDynamicImport(module=node12).errors.txt b/tests/baselines/reference/nodeModulesDynamicImport(module=node12).errors.txt new file mode 100644 index 0000000000000..e0546b6d62e95 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDynamicImport(module=node12).errors.txt @@ -0,0 +1,26 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== + // cjs format file + export async function main() { + const { readFile } = await import("fs"); + } +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + export async function main() { + const { readFile } = await import("fs"); + } +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/types.d.ts (0 errors) ==== + declare module "fs"; \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesDynamicImport(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesDynamicImport(module=nodenext).errors.txt new file mode 100644 index 0000000000000..e9b5fff04a9e8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDynamicImport(module=nodenext).errors.txt @@ -0,0 +1,26 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== + // cjs format file + export async function main() { + const { readFile } = await import("fs"); + } +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + export async function main() { + const { readFile } = await import("fs"); + } +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/types.d.ts (0 errors) ==== + declare module "fs"; \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportAssignments(module=node12).errors.txt b/tests/baselines/reference/nodeModulesExportAssignments(module=node12).errors.txt index cef2966380663..fb1764a424a74 100644 --- a/tests/baselines/reference/nodeModulesExportAssignments(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesExportAssignments(module=node12).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.ts(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== // cjs format file const a = {}; diff --git a/tests/baselines/reference/nodeModulesExportAssignments(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesExportAssignments(module=nodenext).errors.txt index cef2966380663..b35017bbbf00b 100644 --- a/tests/baselines/reference/nodeModulesExportAssignments(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesExportAssignments(module=nodenext).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.ts(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== // cjs format file const a = {}; diff --git a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).errors.txt b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).errors.txt index d6b74fdf7e00a..b099743821ab5 100644 --- a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).errors.txt @@ -1,8 +1,10 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. tests/cases/conformance/node/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. tests/cases/conformance/node/index.ts(3,19): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (3 errors) ==== // esm format file import { Thing } from "inner/other"; diff --git a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=nodenext).errors.txt index 53ab414e38ba6..838875b26fb4d 100644 --- a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=nodenext).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. tests/cases/conformance/node/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. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (2 errors) ==== // esm format file import { Thing } from "inner/other"; diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).errors.txt index 1a9b16d74f2d7..818ab92f89f2e 100644 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other.js' or its corresponding type declarations. tests/cases/conformance/node/index.ts(3,19): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (2 errors) ==== // esm format file import { Thing } from "inner/other.js"; // should fail diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=nodenext).errors.txt index b25fc090f8b5d..03e6afbd591be 100644 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=nodenext).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other.js' or its corresponding type declarations. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (1 errors) ==== // esm format file import { Thing } from "inner/other.js"; // should fail diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).errors.txt index 7216f0655b9f8..40b2a5da7b8fe 100644 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. tests/cases/conformance/node/index.ts(3,19): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (2 errors) ==== // esm format file import { Thing } from "inner/other"; diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=nodenext).errors.txt index b2d874ee38bb1..3187a4352dcf6 100644 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=nodenext).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (1 errors) ==== // esm format file import { Thing } from "inner/other"; diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).errors.txt index 9db5139062495..f033b7a95b7d1 100644 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).errors.txt @@ -1,8 +1,10 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. tests/cases/conformance/node/index.ts(3,19): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. tests/cases/conformance/node/index.ts(3,32): error TS2307: Cannot find module 'inner/index.js' or its corresponding type declarations. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (3 errors) ==== // esm format file import { Thing } from "inner/other"; diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=nodenext).errors.txt index c315a2a523203..c8771dc688700 100644 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=nodenext).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (1 errors) ==== // esm format file import { Thing } from "inner/other"; diff --git a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).errors.txt b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).errors.txt index 984483a332e29..a5fc3ae053713 100644 --- a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/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. tests/cases/conformance/node/index.cts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. tests/cases/conformance/node/index.cts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. @@ -24,6 +25,7 @@ tests/cases/conformance/node/subfolder2/index.mts(2,20): error TS7059: This synt tests/cases/conformance/node/subfolder2/index.mts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== // cjs format file const x = () => (void 0); diff --git a/tests/baselines/reference/nodeModulesForbidenSyntax(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesForbidenSyntax(module=nodenext).errors.txt index 984483a332e29..a703565ad22c9 100644 --- a/tests/baselines/reference/nodeModulesForbidenSyntax(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesForbidenSyntax(module=nodenext).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/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. tests/cases/conformance/node/index.cts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. tests/cases/conformance/node/index.cts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. @@ -24,6 +25,7 @@ tests/cases/conformance/node/subfolder2/index.mts(2,20): error TS7059: This synt tests/cases/conformance/node/subfolder2/index.mts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== // cjs format file const x = () => (void 0); diff --git a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).errors.txt b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).errors.txt index bcf0d1d592ca8..60e7877bc55f8 100644 --- a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/subfolder/index.ts(2,10): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. tests/cases/conformance/node/subfolder/index.ts(3,7): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. tests/cases/conformance/node/subfolder/index.ts(4,7): error TS2725: Class name cannot be 'Object' when targeting ES5 with module Node12. tests/cases/conformance/node/subfolder/index.ts(5,14): error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (4 errors) ==== // cjs format file function require() {} diff --git a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=nodenext).errors.txt index abc62c363a23c..0821da5e7ca18 100644 --- a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=nodenext).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/subfolder/index.ts(2,10): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. tests/cases/conformance/node/subfolder/index.ts(3,7): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. tests/cases/conformance/node/subfolder/index.ts(4,7): error TS2725: Class name cannot be 'Object' when targeting ES5 with module NodeNext. tests/cases/conformance/node/subfolder/index.ts(5,14): error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (4 errors) ==== // cjs format file function require() {} diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportAssertions(module=node12).errors.txt index e1c723d1dec84..0f457c7a4cab8 100644 --- a/tests/baselines/reference/nodeModulesImportAssertions(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=node12).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.ts(1,18): error TS7062: JSON imports are experimental in ES module mode imports. tests/cases/conformance/node/index.ts(1,35): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. tests/cases/conformance/node/otherc.cts(1,35): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. @@ -5,6 +6,7 @@ tests/cases/conformance/node/otherc.cts(2,22): error TS7062: JSON imports are ex tests/cases/conformance/node/otherc.cts(2,40): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (2 errors) ==== import json from "./package.json" assert { type: "json" }; ~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportAssertions(module=nodenext).errors.txt index 29dbcb839f52b..33d4f5c935f19 100644 --- a/tests/baselines/reference/nodeModulesImportAssertions(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=nodenext).errors.txt @@ -1,8 +1,10 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.ts(1,18): error TS7062: JSON imports are experimental in ES module mode imports. tests/cases/conformance/node/otherc.cts(1,35): error TS2836: Import assertions are not allowed on statements that transpile to commonjs 'require' calls. tests/cases/conformance/node/otherc.cts(2,22): error TS7062: JSON imports are experimental in ES module mode imports. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (1 errors) ==== import json from "./package.json" assert { type: "json" }; ~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/nodeModulesImportAssignments(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportAssignments(module=node12).errors.txt new file mode 100644 index 0000000000000..ec6c73c744365 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssignments(module=node12).errors.txt @@ -0,0 +1,33 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== + // cjs format file + import fs = require("fs"); + fs.readFile; + export import fs2 = require("fs"); +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import fs = require("fs"); + fs.readFile; + export import fs2 = require("fs"); +==== tests/cases/conformance/node/file.ts (0 errors) ==== + // esm format file + const __require = null; + const _createRequire = null; + import fs = require("fs"); + fs.readFile; + export import fs2 = require("fs"); +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/types.d.ts (0 errors) ==== + declare module "fs"; \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAssignments(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportAssignments(module=nodenext).errors.txt new file mode 100644 index 0000000000000..f8707fc47cadd --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssignments(module=nodenext).errors.txt @@ -0,0 +1,33 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== + // cjs format file + import fs = require("fs"); + fs.readFile; + export import fs2 = require("fs"); +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import fs = require("fs"); + fs.readFile; + export import fs2 = require("fs"); +==== tests/cases/conformance/node/file.ts (0 errors) ==== + // esm format file + const __require = null; + const _createRequire = null; + import fs = require("fs"); + fs.readFile; + export import fs2 = require("fs"); +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/types.d.ts (0 errors) ==== + declare module "fs"; \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).errors.txt index b4ae0ff6fb045..bac486719aece 100644 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/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'. tests/cases/conformance/node/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'. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== // cjs format file import {default as _fs} from "fs"; diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=nodenext).errors.txt index b4ae0ff6fb045..dc364b05c051d 100644 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=nodenext).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/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'. tests/cases/conformance/node/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'. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== // cjs format file import {default as _fs} from "fs"; diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).errors.txt index d2f62391af269..2db57f30ec318 100644 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/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'. tests/cases/conformance/node/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'. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== // cjs format file export * from "fs"; diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=nodenext).errors.txt index d2f62391af269..1511c223387a7 100644 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=nodenext).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/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'. tests/cases/conformance/node/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'. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== // cjs format file export * from "fs"; diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).errors.txt index d511944f39332..c2a21b09ca71d 100644 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/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'. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (1 errors) ==== // cjs format file export {default} from "fs"; diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=nodenext).errors.txt index d511944f39332..498404a144699 100644 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=nodenext).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/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'. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (1 errors) ==== // cjs format file export {default} from "fs"; diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportMeta(module=node12).errors.txt index 27f6e3c9e281e..7dd0bfeefb29b 100644 --- a/tests/baselines/reference/nodeModulesImportMeta(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesImportMeta(module=node12).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/subfolder/index.ts(2,11): error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (1 errors) ==== // cjs format file const x = import.meta.url; diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportMeta(module=nodenext).errors.txt index 27f6e3c9e281e..4cc54b950c290 100644 --- a/tests/baselines/reference/nodeModulesImportMeta(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesImportMeta(module=nodenext).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/subfolder/index.ts(2,11): error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (1 errors) ==== // cjs format file const x = import.meta.url; diff --git a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node12).errors.txt new file mode 100644 index 0000000000000..ebcb81c6bc947 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node12).errors.txt @@ -0,0 +1,26 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import * as type from "#type"; + type; +==== tests/cases/conformance/node/index.mts (0 errors) ==== + // esm format file + import * as type from "#type"; + type; +==== tests/cases/conformance/node/index.cts (0 errors) ==== + // esm format file + import * as type from "#type"; + type; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.cjs", + "imports": { + "#type": "package" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=nodenext).errors.txt new file mode 100644 index 0000000000000..e21a068b3c672 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=nodenext).errors.txt @@ -0,0 +1,26 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import * as type from "#type"; + type; +==== tests/cases/conformance/node/index.mts (0 errors) ==== + // esm format file + import * as type from "#type"; + type; +==== tests/cases/conformance/node/index.cts (0 errors) ==== + // esm format file + import * as type from "#type"; + type; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.cjs", + "imports": { + "#type": "package" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).errors.txt index c73a7a7885f63..17f2eecd0073f 100644 --- a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).errors.txt @@ -1,8 +1,10 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(2,23): error TS2307: Cannot find module '#type' or its corresponding type declarations. tests/cases/conformance/node/index.mts(2,23): error TS2307: Cannot find module '#type' or its corresponding type declarations. tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module '#type' or its corresponding type declarations. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (1 errors) ==== // esm format file import * as type from "#type"; diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=nodenext).errors.txt index c73a7a7885f63..215e26f4e1521 100644 --- a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=nodenext).errors.txt @@ -1,8 +1,10 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(2,23): error TS2307: Cannot find module '#type' or its corresponding type declarations. tests/cases/conformance/node/index.mts(2,23): error TS2307: Cannot find module '#type' or its corresponding type declarations. tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module '#type' or its corresponding type declarations. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (1 errors) ==== // esm format file import * as type from "#type"; diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesPackageExports(module=node12).errors.txt index 464db33f319b0..a39e6f516db90 100644 --- a/tests/baselines/reference/nodeModulesPackageExports(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesPackageExports(module=node12).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -6,6 +7,7 @@ tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesPackageExports(module=nodenext).errors.txt index 464db33f319b0..ad74f5842973c 100644 --- a/tests/baselines/reference/nodeModulesPackageExports(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesPackageExports(module=nodenext).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -6,6 +7,7 @@ tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesPackageImports(module=node12).errors.txt index cc174f1eb7e26..7aff2b0375b18 100644 --- a/tests/baselines/reference/nodeModulesPackageImports(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node12).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(3,22): error TS1471: Module '#mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(4,23): error TS1471: Module '#type' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjs from "#cjs"; diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).errors.txt index cc174f1eb7e26..31e0f9c1803f7 100644 --- a/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesPackageImports(module=nodenext).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(3,22): error TS1471: Module '#mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(4,23): error TS1471: Module '#type' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjs from "#cjs"; diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).errors.txt index 0dc3774d5ef60..276021919f57e 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(3,23): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjsi from "inner/cjs/index"; diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesPackagePatternExports(module=nodenext).errors.txt index 0dc3774d5ef60..3130115da3d87 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExports(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=nodenext).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(3,23): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjsi from "inner/cjs/index"; diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).errors.txt b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).errors.txt index 6c400a3f69c84..6e4d3074e44ee 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).errors.txt @@ -1,3 +1,4 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(2,23): error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. tests/cases/conformance/node/index.cts(3,23): error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. tests/cases/conformance/node/index.cts(4,24): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. @@ -18,6 +19,7 @@ tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS2307: tests/cases/conformance/node/node_modules/inner/index.d.ts(4,23): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (3 errors) ==== // esm format file import * as cjsi from "inner/cjs/index.cjs"; diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).errors.txt index 9aa041ab4186a..50c54d38db265 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(3,23): error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjsi from "inner/cjs/index.cjs"; diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).errors.txt b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).errors.txt index 4200a11e7baf9..4acb7957f9d3f 100644 --- a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.mts(1,17): error TS7062: JSON imports are experimental in ES module mode imports. tests/cases/conformance/node/index.mts(3,21): error TS7062: JSON imports are experimental in ES module mode imports. tests/cases/conformance/node/index.ts(1,17): error TS7062: JSON imports are experimental in ES module mode imports. tests/cases/conformance/node/index.ts(3,21): error TS7062: JSON imports are experimental in ES module mode imports. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (2 errors) ==== import pkg from "./package.json" ~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesResolveJsonModule(module=nodenext).errors.txt index 4200a11e7baf9..259d088600e06 100644 --- a/tests/baselines/reference/nodeModulesResolveJsonModule(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesResolveJsonModule(module=nodenext).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.mts(1,17): error TS7062: JSON imports are experimental in ES module mode imports. tests/cases/conformance/node/index.mts(3,21): error TS7062: JSON imports are experimental in ES module mode imports. tests/cases/conformance/node/index.ts(1,17): error TS7062: JSON imports are experimental in ES module mode imports. tests/cases/conformance/node/index.ts(3,21): error TS7062: JSON imports are experimental in ES module mode imports. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (2 errors) ==== import pkg from "./package.json" ~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).errors.txt b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).errors.txt index 012ef390621c9..96d207b2e8743 100644 --- a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).errors.txt @@ -1,8 +1,10 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/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 synchronously. Use dynamic import instead. tests/cases/conformance/node/subfolder/index.ts(2,17): error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/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 synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== // cjs format file import {h} from "../index.js"; diff --git a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=nodenext).errors.txt index 012ef390621c9..0f0fde4973d22 100644 --- a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=nodenext).errors.txt @@ -1,8 +1,10 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/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 synchronously. Use dynamic import instead. tests/cases/conformance/node/subfolder/index.ts(2,17): error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/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 synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== // cjs format file import {h} from "../index.js"; diff --git a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).errors.txt b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).errors.txt index 12596b85ab232..fb895f674e90b 100644 --- a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).errors.txt +++ b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).errors.txt @@ -1,9 +1,11 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.ts(2,11): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. tests/cases/conformance/node/index.ts(4,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. tests/cases/conformance/node/subfolder/index.ts(2,11): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. tests/cases/conformance/node/subfolder/index.ts(4,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== // cjs format file const x = await 1; diff --git a/tests/baselines/reference/nodeModulesTopLevelAwait(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesTopLevelAwait(module=nodenext).errors.txt index 140c9f2c32cde..0a9f41ae75ac8 100644 --- a/tests/baselines/reference/nodeModulesTopLevelAwait(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesTopLevelAwait(module=nodenext).errors.txt @@ -1,7 +1,9 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/subfolder/index.ts(2,11): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. tests/cases/conformance/node/subfolder/index.ts(4,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== // cjs format file const x = await 1; diff --git a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node12).errors.txt new file mode 100644 index 0000000000000..8ba6113014332 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node12).errors.txt @@ -0,0 +1,54 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import * as mod from "inner"; + mod.correctVersionApplied; + +==== tests/cases/conformance/node/index.mts (0 errors) ==== + // esm format file + import * as mod from "inner"; + mod.correctVersionApplied; + +==== tests/cases/conformance/node/index.cts (0 errors) ==== + // cjs format file + import * as mod from "inner"; + mod.correctVersionApplied; + +==== tests/cases/conformance/node/node_modules/inner/index.d.ts (0 errors) ==== + // cjs format file + export const noConditionsApplied = true; +==== tests/cases/conformance/node/node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + export const importConditionApplied = true; +==== tests/cases/conformance/node/node_modules/inner/index.d.cts (0 errors) ==== + // cjs format file + export const wrongConditionApplied = true; +==== tests/cases/conformance/node/node_modules/inner/old-types.d.ts (0 errors) ==== + export const noVersionApplied = true; +==== tests/cases/conformance/node/node_modules/inner/new-types.d.ts (0 errors) ==== + export const correctVersionApplied = true; +==== tests/cases/conformance/node/node_modules/inner/future-types.d.ts (0 errors) ==== + export const futureVersionApplied = true; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + } +==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== + { + "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" + }, + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=nodenext).errors.txt new file mode 100644 index 0000000000000..29651cb6b676e --- /dev/null +++ b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=nodenext).errors.txt @@ -0,0 +1,54 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import * as mod from "inner"; + mod.correctVersionApplied; + +==== tests/cases/conformance/node/index.mts (0 errors) ==== + // esm format file + import * as mod from "inner"; + mod.correctVersionApplied; + +==== tests/cases/conformance/node/index.cts (0 errors) ==== + // cjs format file + import * as mod from "inner"; + mod.correctVersionApplied; + +==== tests/cases/conformance/node/node_modules/inner/index.d.ts (0 errors) ==== + // cjs format file + export const noConditionsApplied = true; +==== tests/cases/conformance/node/node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + export const importConditionApplied = true; +==== tests/cases/conformance/node/node_modules/inner/index.d.cts (0 errors) ==== + // cjs format file + export const wrongConditionApplied = true; +==== tests/cases/conformance/node/node_modules/inner/old-types.d.ts (0 errors) ==== + export const noVersionApplied = true; +==== tests/cases/conformance/node/node_modules/inner/new-types.d.ts (0 errors) ==== + export const correctVersionApplied = true; +==== tests/cases/conformance/node/node_modules/inner/future-types.d.ts (0 errors) ==== + export const futureVersionApplied = true; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + } +==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== + { + "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" + }, + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodePackageSelfName(module=node12).errors.txt b/tests/baselines/reference/nodePackageSelfName(module=node12).errors.txt index c1573b8f51dd8..b503f31c3cf06 100644 --- a/tests/baselines/reference/nodePackageSelfName(module=node12).errors.txt +++ b/tests/baselines/reference/nodePackageSelfName(module=node12).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(2,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as self from "package"; diff --git a/tests/baselines/reference/nodePackageSelfName(module=nodenext).errors.txt b/tests/baselines/reference/nodePackageSelfName(module=nodenext).errors.txt index c1573b8f51dd8..7199d1995fd49 100644 --- a/tests/baselines/reference/nodePackageSelfName(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodePackageSelfName(module=nodenext).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(2,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as self from "package"; diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).errors.txt b/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).errors.txt index b2a9f313de779..cf59888faf0ff 100644 --- a/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).errors.txt +++ b/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(2,23): error TS1471: Module '@scope/package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as self from "@scope/package"; diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=nodenext).errors.txt b/tests/baselines/reference/nodePackageSelfNameScoped(module=nodenext).errors.txt index b2a9f313de779..d703447305f4d 100644 --- a/tests/baselines/reference/nodePackageSelfNameScoped(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodePackageSelfNameScoped(module=nodenext).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/conformance/node/index.cts(2,23): error TS1471: Module '@scope/package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as self from "@scope/package"; diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNext.errors.txt b/tests/baselines/reference/reactJsxReactResolvedNodeNext.errors.txt new file mode 100644 index 0000000000000..6d136a38a5208 --- /dev/null +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNext.errors.txt @@ -0,0 +1,22 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/compiler/file.tsx (0 errors) ==== + export const a =
; +==== tests/cases/compiler/node_modules/@types/react/package.json (0 errors) ==== + { + "name": "@types/react", + "version": "0.0.1", + "main": "", + "types": "index.d.ts", + } +==== tests/cases/compiler/node_modules/@types/react/index.d.ts (0 errors) ==== + declare namespace JSX { + interface IntrinsicElements { [x: string]: any; } + } +==== tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts (0 errors) ==== + import './'; +==== tests/cases/compiler/node_modules/@types/react/jsx-dev-runtime.d.ts (0 errors) ==== + import './'; + \ No newline at end of file diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNext.types b/tests/baselines/reference/reactJsxReactResolvedNodeNext.types index 882cac56efcb5..f9646db4c3ab8 100644 --- a/tests/baselines/reference/reactJsxReactResolvedNodeNext.types +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNext.types @@ -1,7 +1,7 @@ === tests/cases/compiler/file.tsx === export const a =
; ->a : error ->
: error +>a : any +>
: any >div : any >div : any diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.errors.txt b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.errors.txt new file mode 100644 index 0000000000000..6ad2252d8bc44 --- /dev/null +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.errors.txt @@ -0,0 +1,30 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + + +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. +==== tests/cases/compiler/package.json (0 errors) ==== + { + "type": "module" + } +==== tests/cases/compiler/file.tsx (0 errors) ==== + export const a =
; +==== tests/cases/compiler/node_modules/@types/react/package.json (0 errors) ==== + { + "name": "@types/react", + "version": "0.0.1", + "main": "", + "types": "index.d.ts", + "exports": { + "./*.js": "./*.js", + "./*": "./*.js" + } + } +==== tests/cases/compiler/node_modules/@types/react/index.d.ts (0 errors) ==== + declare namespace JSX { + interface IntrinsicElements { [x: string]: any; } + } +==== tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts (0 errors) ==== + import './'; +==== tests/cases/compiler/node_modules/@types/react/jsx-dev-runtime.d.ts (0 errors) ==== + import './'; + \ No newline at end of file diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.types b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.types index 882cac56efcb5..f9646db4c3ab8 100644 --- a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.types +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.types @@ -1,7 +1,7 @@ === tests/cases/compiler/file.tsx === export const a =
; ->a : error ->
: error +>a : any +>
: any >div : any >div : any diff --git a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).errors.txt b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).errors.txt index 179a40218dc53..a01176d7372a1 100644 --- a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).errors.txt +++ b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/compiler/usage.ts(1,23): error TS2688: Cannot find type definition file for 'pkg'. +!!! error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/compiler/node_modules/pkg/index.d.ts (0 errors) ==== interface GlobalThing { a: number } ==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== diff --git a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=nodenext).errors.txt b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=nodenext).errors.txt index 179a40218dc53..0c618edad1b67 100644 --- a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=nodenext).errors.txt +++ b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=nodenext).errors.txt @@ -1,6 +1,8 @@ +error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. tests/cases/compiler/usage.ts(1,23): error TS2688: Cannot find type definition file for 'pkg'. +!!! error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. ==== tests/cases/compiler/node_modules/pkg/index.d.ts (0 errors) ==== interface GlobalThing { a: number } ==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== diff --git a/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-build/synthesized-module-specifiers-across-projects-resolve-correctly.js b/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-build/synthesized-module-specifiers-across-projects-resolve-correctly.js index 254c7cdef4174..c58ec9a710c7b 100644 --- a/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-build/synthesized-module-specifiers-across-projects-resolve-correctly.js +++ b/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-build/synthesized-module-specifiers-across-projects-resolve-correctly.js @@ -16,51 +16,23 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } //// [/src/src-dogs/dog.ts] -import { DogConfig } from 'src-types'; -import { DOG_CONFIG } from './dogconfig.js'; - -export abstract class Dog { - - public static getCapabilities(): DogConfig { - return DOG_CONFIG; - } -} //// [/src/src-dogs/dogconfig.ts] -import { DogConfig } from 'src-types'; - -export const DOG_CONFIG: DogConfig = { - name: 'Default dog', -}; //// [/src/src-dogs/index.ts] -export * from 'src-types'; -export * from './lassie/lassiedog.js'; //// [/src/src-dogs/lassie/lassieconfig.ts] -import { DogConfig } from 'src-types'; - -export const LASSIE_CONFIG: DogConfig = { name: 'Lassie' }; //// [/src/src-dogs/lassie/lassiedog.ts] -import { Dog } from '../dog.js'; -import { LASSIE_CONFIG } from './lassieconfig.js'; - -export class LassieDog extends Dog { - protected static getDogConfig = () => LASSIE_CONFIG; -} //// [/src/src-dogs/node_modules] symlink(/src) //// [/src/src-dogs/package.json] -{ - "type": "module", - "exports": "./index.js" -} + //// [/src/src-dogs/tsconfig.json] { @@ -122,284 +94,15 @@ Output:: [12:00:00 AM] Building project '/src/src-types/tsconfig.json'... -[12:00:00 AM] Project 'src/src-dogs/tsconfig.json' is out of date because output file 'src/src-dogs/dog.js' does not exist - -[12:00:00 AM] Building project '/src/src-dogs/tsconfig.json'... +error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. -exitCode:: ExitStatus.Success - - -//// [/src/src-dogs/dog.d.ts] -import { DogConfig } from 'src-types'; -export declare abstract class Dog { - static getCapabilities(): DogConfig; -} - - -//// [/src/src-dogs/dog.js] -import { DOG_CONFIG } from './dogconfig.js'; -export class Dog { - static getCapabilities() { - return DOG_CONFIG; - } -} +[12:00:00 AM] Project 'src/src-dogs/tsconfig.json' can't be built because its dependency 'src/src-types' has errors - -//// [/src/src-dogs/dogconfig.d.ts] -import { DogConfig } from 'src-types'; -export declare const DOG_CONFIG: DogConfig; - - -//// [/src/src-dogs/dogconfig.js] -export const DOG_CONFIG = { - name: 'Default dog', -}; - - -//// [/src/src-dogs/index.d.ts] -export * from 'src-types'; -export * from './lassie/lassiedog.js'; - - -//// [/src/src-dogs/index.js] -export * from 'src-types'; -export * from './lassie/lassiedog.js'; - - -//// [/src/src-dogs/lassie/lassieconfig.d.ts] -import { DogConfig } from 'src-types'; -export declare const LASSIE_CONFIG: DogConfig; - - -//// [/src/src-dogs/lassie/lassieconfig.js] -export const LASSIE_CONFIG = { name: 'Lassie' }; - - -//// [/src/src-dogs/lassie/lassiedog.d.ts] -import { Dog } from '../dog.js'; -export declare class LassieDog extends Dog { - protected static getDogConfig: () => import("../index.js").DogConfig; -} - - -//// [/src/src-dogs/lassie/lassiedog.js] -import { Dog } from '../dog.js'; -import { LASSIE_CONFIG } from './lassieconfig.js'; -export class LassieDog extends Dog { -} -LassieDog.getDogConfig = () => LASSIE_CONFIG; +[12:00:00 AM] Skipping build of project '/src/src-dogs/tsconfig.json' because its dependency '/src/src-types' has errors -//// [/src/src-dogs/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.es2020.full.d.ts","../src-types/dogconfig.d.ts","../src-types/index.d.ts","./dogconfig.ts","./dog.ts","./lassie/lassieconfig.ts","./lassie/lassiedog.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},"-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n","-5608794531-export * from './dogconfig.js';\r\n","1966273863-import { DogConfig } from 'src-types';\n\nexport const DOG_CONFIG: DogConfig = {\n name: 'Default dog',\n};\n","6091345804-import { DogConfig } from 'src-types';\nimport { DOG_CONFIG } from './dogconfig.js';\n\nexport abstract class Dog {\n\n public static getCapabilities(): DogConfig {\n return DOG_CONFIG;\n }\n}\n","4440579024-import { DogConfig } from 'src-types';\n\nexport const LASSIE_CONFIG: DogConfig = { name: 'Lassie' };\n","-32303727812-import { Dog } from '../dog.js';\nimport { LASSIE_CONFIG } from './lassieconfig.js';\n\nexport class LassieDog extends Dog {\n protected static getDogConfig = () => LASSIE_CONFIG;\n}\n","-15974991320-export * from 'src-types';\nexport * from './lassie/lassiedog.js';\n"],"options":{"composite":true,"declaration":true,"module":100},"fileIdsList":[[3,4],[3],[3,7],[5,6],[2]],"referencedMap":[[5,1],[4,2],[8,3],[6,2],[7,4],[3,5]],"exportedModulesMap":[[5,1],[4,2],[8,3],[6,2],[7,4],[3,5]],"semanticDiagnosticsPerFile":[1,5,4,8,6,7,2,3]},"version":"FakeTSVersion"} - -//// [/src/src-dogs/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../lib/lib.es2020.full.d.ts", - "../src-types/dogconfig.d.ts", - "../src-types/index.d.ts", - "./dogconfig.ts", - "./dog.ts", - "./lassie/lassieconfig.ts", - "./lassie/lassiedog.ts", - "./index.ts" - ], - "fileNamesList": [ - [ - "../src-types/index.d.ts", - "./dogconfig.ts" - ], - [ - "../src-types/index.d.ts" - ], - [ - "../src-types/index.d.ts", - "./lassie/lassiedog.ts" - ], - [ - "./dog.ts", - "./lassie/lassieconfig.ts" - ], - [ - "../src-types/dogconfig.d.ts" - ] - ], - "fileInfos": { - "../../lib/lib.es2020.full.d.ts": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "../src-types/dogconfig.d.ts": { - "version": "-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n", - "signature": "-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n" - }, - "../src-types/index.d.ts": { - "version": "-5608794531-export * from './dogconfig.js';\r\n", - "signature": "-5608794531-export * from './dogconfig.js';\r\n" - }, - "./dogconfig.ts": { - "version": "1966273863-import { DogConfig } from 'src-types';\n\nexport const DOG_CONFIG: DogConfig = {\n name: 'Default dog',\n};\n", - "signature": "1966273863-import { DogConfig } from 'src-types';\n\nexport const DOG_CONFIG: DogConfig = {\n name: 'Default dog',\n};\n" - }, - "./dog.ts": { - "version": "6091345804-import { DogConfig } from 'src-types';\nimport { DOG_CONFIG } from './dogconfig.js';\n\nexport abstract class Dog {\n\n public static getCapabilities(): DogConfig {\n return DOG_CONFIG;\n }\n}\n", - "signature": "6091345804-import { DogConfig } from 'src-types';\nimport { DOG_CONFIG } from './dogconfig.js';\n\nexport abstract class Dog {\n\n public static getCapabilities(): DogConfig {\n return DOG_CONFIG;\n }\n}\n" - }, - "./lassie/lassieconfig.ts": { - "version": "4440579024-import { DogConfig } from 'src-types';\n\nexport const LASSIE_CONFIG: DogConfig = { name: 'Lassie' };\n", - "signature": "4440579024-import { DogConfig } from 'src-types';\n\nexport const LASSIE_CONFIG: DogConfig = { name: 'Lassie' };\n" - }, - "./lassie/lassiedog.ts": { - "version": "-32303727812-import { Dog } from '../dog.js';\nimport { LASSIE_CONFIG } from './lassieconfig.js';\n\nexport class LassieDog extends Dog {\n protected static getDogConfig = () => LASSIE_CONFIG;\n}\n", - "signature": "-32303727812-import { Dog } from '../dog.js';\nimport { LASSIE_CONFIG } from './lassieconfig.js';\n\nexport class LassieDog extends Dog {\n protected static getDogConfig = () => LASSIE_CONFIG;\n}\n" - }, - "./index.ts": { - "version": "-15974991320-export * from 'src-types';\nexport * from './lassie/lassiedog.js';\n", - "signature": "-15974991320-export * from 'src-types';\nexport * from './lassie/lassiedog.js';\n" - } - }, - "options": { - "composite": true, - "declaration": true, - "module": 100 - }, - "referencedMap": { - "./dog.ts": [ - "../src-types/index.d.ts", - "./dogconfig.ts" - ], - "./dogconfig.ts": [ - "../src-types/index.d.ts" - ], - "./index.ts": [ - "../src-types/index.d.ts", - "./lassie/lassiedog.ts" - ], - "./lassie/lassieconfig.ts": [ - "../src-types/index.d.ts" - ], - "./lassie/lassiedog.ts": [ - "./dog.ts", - "./lassie/lassieconfig.ts" - ], - "../src-types/index.d.ts": [ - "../src-types/dogconfig.d.ts" - ] - }, - "exportedModulesMap": { - "./dog.ts": [ - "../src-types/index.d.ts", - "./dogconfig.ts" - ], - "./dogconfig.ts": [ - "../src-types/index.d.ts" - ], - "./index.ts": [ - "../src-types/index.d.ts", - "./lassie/lassiedog.ts" - ], - "./lassie/lassieconfig.ts": [ - "../src-types/index.d.ts" - ], - "./lassie/lassiedog.ts": [ - "./dog.ts", - "./lassie/lassieconfig.ts" - ], - "../src-types/index.d.ts": [ - "../src-types/dogconfig.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.es2020.full.d.ts", - "./dog.ts", - "./dogconfig.ts", - "./index.ts", - "./lassie/lassieconfig.ts", - "./lassie/lassiedog.ts", - "../src-types/dogconfig.d.ts", - "../src-types/index.d.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1802 -} - -//// [/src/src-types/dogconfig.d.ts] -export interface DogConfig { - name: string; -} - - -//// [/src/src-types/dogconfig.js] -export {}; - - -//// [/src/src-types/index.d.ts] -export * from './dogconfig.js'; - - -//// [/src/src-types/index.js] -export * from './dogconfig.js'; - - -//// [/src/src-types/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.es2020.full.d.ts","./dogconfig.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},"-5575793279-export interface DogConfig {\n name: string;\n}","-6189272282-export * from './dogconfig.js';"],"options":{"composite":true,"declaration":true,"module":100},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} - -//// [/src/src-types/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../lib/lib.es2020.full.d.ts", - "./dogconfig.ts", - "./index.ts" - ], - "fileNamesList": [ - [ - "./dogconfig.ts" - ] - ], - "fileInfos": { - "../../lib/lib.es2020.full.d.ts": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "./dogconfig.ts": { - "version": "-5575793279-export interface DogConfig {\n name: string;\n}", - "signature": "-5575793279-export interface DogConfig {\n name: string;\n}" - }, - "./index.ts": { - "version": "-6189272282-export * from './dogconfig.js';", - "signature": "-6189272282-export * from './dogconfig.js';" - } - }, - "options": { - "composite": true, - "declaration": true, - "module": 100 - }, - "referencedMap": { - "./index.ts": [ - "./dogconfig.ts" - ] - }, - "exportedModulesMap": { - "./index.ts": [ - "./dogconfig.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.es2020.full.d.ts", - "./dogconfig.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion", - "size": 829 -} +Found 1 error. +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/watchMode/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js b/tests/baselines/reference/tsbuild/watchMode/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js index bb84fc7c82f8f..09c8dde1bdf73 100644 --- a/tests/baselines/reference/tsbuild/watchMode/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js +++ b/tests/baselines/reference/tsbuild/watchMode/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js @@ -60,46 +60,16 @@ File '/user/username/projects/myproject/packages/pkg2/const.cts' exist - use it File '/a/lib/package.json' does not exist. File '/a/package.json' does not exist. File '/package.json' does not exist. -[12:01:00 AM] Project 'packages/pkg1/tsconfig.json' is out of date because output file 'packages/pkg1/build/index.js' does not exist +packages/pkg2/tsconfig.json:1:64 - error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. -[12:01:01 AM] Building project '/user/username/projects/myproject/packages/pkg1/tsconfig.json'... +1 {"compilerOptions":{"composite":true,"outDir":"build","module":"node12"}} +   ~~~~~~~~ -Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package.json'. -'package.json' does not have a 'typesVersions' field. -======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== -Module resolution kind is not specified, using 'Node12'. -File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. -Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. -Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. -Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. -'package.json' does not have a 'typesVersions' field. -'package.json' does not have a 'typings' field. -'package.json' does not have a 'types' field. -'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts' exist - use it as a name resolution result. -Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts', result '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. -======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.ts' with Package ID 'pkg2/build/index.d.ts@1.0.0'. ======== -File '/user/username/projects/myproject/packages/pkg2/build/package.json' does not exist. -File '/user/username/projects/myproject/packages/pkg2/package.json' exists according to earlier cached lookups. -======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== -Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. -Module resolution kind is not specified, using 'Node12'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. -File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. -File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. -======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/const.d.cts'. ======== -File '/a/lib/package.json' does not exist according to earlier cached lookups. -File '/a/package.json' does not exist according to earlier cached lookups. -File '/package.json' does not exist according to earlier cached lookups. -[12:01:07 AM] Found 0 errors. Watching for file changes. +[12:00:45 AM] Project 'packages/pkg1/tsconfig.json' can't be built because its dependency 'packages/pkg2' has errors + +[12:00:46 AM] Skipping build of project '/user/username/projects/myproject/packages/pkg1/tsconfig.json' because its dependency '/user/username/projects/myproject/packages/pkg2' has errors + +[12:00:47 AM] Found 1 error. Watching for file changes. @@ -111,36 +81,9 @@ Program files:: /user/username/projects/myproject/packages/pkg2/const.cts /user/username/projects/myproject/packages/pkg2/index.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.es2020.full.d.ts -/user/username/projects/myproject/packages/pkg2/const.cts -/user/username/projects/myproject/packages/pkg2/index.ts - -Shape signatures in builder refreshed for:: -/a/lib/lib.es2020.full.d.ts (used version) -/user/username/projects/myproject/packages/pkg2/const.cts (used version) -/user/username/projects/myproject/packages/pkg2/index.ts (used version) - -Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] -Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} -Program structureReused: Not -Program files:: -/a/lib/lib.es2020.full.d.ts -/user/username/projects/myproject/packages/pkg2/build/const.d.cts -/user/username/projects/myproject/packages/pkg2/build/index.d.ts -/user/username/projects/myproject/packages/pkg1/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.es2020.full.d.ts -/user/username/projects/myproject/packages/pkg2/build/const.d.cts -/user/username/projects/myproject/packages/pkg2/build/index.d.ts -/user/username/projects/myproject/packages/pkg1/index.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/a/lib/lib.es2020.full.d.ts (used version) -/user/username/projects/myproject/packages/pkg2/build/const.d.cts (used version) -/user/username/projects/myproject/packages/pkg2/build/index.d.ts (used version) -/user/username/projects/myproject/packages/pkg1/index.ts (used version) +No shapes updated in the builder:: WatchedFiles:: /user/username/projects/myproject/packages/pkg2/tsconfig.json: @@ -151,24 +94,16 @@ WatchedFiles:: {"fileName":"/user/username/projects/myproject/packages/pkg2/index.ts","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/package.json: {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} - {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} /a/lib/package.json: {"fileName":"/a/lib/package.json","pollingInterval":250} - {"fileName":"/a/lib/package.json","pollingInterval":250} /a/package.json: {"fileName":"/a/package.json","pollingInterval":250} - {"fileName":"/a/package.json","pollingInterval":250} /package.json: {"fileName":"/package.json","pollingInterval":250} - {"fileName":"/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/tsconfig.json: {"fileName":"/user/username/projects/myproject/packages/pkg1/tsconfig.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/index.ts: {"fileName":"/user/username/projects/myproject/packages/pkg1/index.ts","pollingInterval":250} -/user/username/projects/myproject/packages/pkg1/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg1/package.json","pollingInterval":250} -/user/username/projects/myproject/packages/pkg2/build/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg2/build/package.json","pollingInterval":250} FsWatches:: @@ -180,84 +115,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/myproject/packages/pkg2/build/const.cjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); - - -//// [/user/username/projects/myproject/packages/pkg2/build/const.d.cts] -export declare type TheNum = 42; - - -//// [/user/username/projects/myproject/packages/pkg2/build/index.js] -export {}; - - -//// [/user/username/projects/myproject/packages/pkg2/build/index.d.ts] -export type { TheNum } from './const.cjs'; - - -//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../../a/lib/lib.es2020.full.d.ts","../const.cts","../index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},"-11202312776-export type TheNum = 42;","-9668872159-export type { TheNum } from './const.cjs';"],"options":{"composite":true,"module":100,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} - -//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../../../../../a/lib/lib.es2020.full.d.ts", - "../const.cts", - "../index.ts" - ], - "fileNamesList": [ - [ - "../const.cts" - ] - ], - "fileInfos": { - "../../../../../../../a/lib/lib.es2020.full.d.ts": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "../const.cts": { - "version": "-11202312776-export type TheNum = 42;", - "signature": "-11202312776-export type TheNum = 42;" - }, - "../index.ts": { - "version": "-9668872159-export type { TheNum } from './const.cjs';", - "signature": "-9668872159-export type { TheNum } from './const.cjs';" - } - }, - "options": { - "composite": true, - "module": 100, - "outDir": "./" - }, - "referencedMap": { - "../index.ts": [ - "../const.cts" - ] - }, - "exportedModulesMap": { - "../index.ts": [ - "../const.cts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../../../../../../a/lib/lib.es2020.full.d.ts", - "../const.cts", - "../index.ts" - ] - }, - "version": "FakeTSVersion", - "size": 826 -} - -//// [/user/username/projects/myproject/packages/pkg1/build/index.js] -export const theNum = 42; - - Change:: reports import errors after change to package file @@ -267,78 +124,6 @@ Input:: Output:: ->> Screen clear -[12:01:11 AM] File change detected. Starting incremental compilation... - -[12:01:12 AM] Project 'packages/pkg1/tsconfig.json' is out of date because oldest output 'packages/pkg1/build/index.js' is older than newest input 'packages/pkg2' - -[12:01:13 AM] Building project '/user/username/projects/myproject/packages/pkg1/tsconfig.json'... - -Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package.json'. -'package.json' does not have a 'typesVersions' field. -======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== -Module resolution kind is not specified, using 'Node12'. -File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. -Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. -Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. -Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. -'package.json' does not have a 'typesVersions' field. -File '/user/username/projects/myproject/node_modules/pkg2.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. -'package.json' does not have a 'typings' field. -'package.json' does not have a 'types' field. -'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.d.ts' does not exist. -File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts' exist - use it as a name resolution result. -Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts', result '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. -======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.ts' with Package ID 'pkg2/build/index.d.ts@1.0.0'. ======== -File '/user/username/projects/myproject/packages/pkg2/build/package.json' does not exist. -Found 'package.json' at '/user/username/projects/myproject/packages/pkg2/package.json'. -'package.json' does not have a 'typesVersions' field. -======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== -Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. -Module resolution kind is not specified, using 'Node12'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. -File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. -File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. -======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/const.d.cts'. ======== -File '/a/lib/package.json' does not exist. -File '/a/package.json' does not exist. -File '/package.json' does not exist. -packages/pkg1/index.ts:1:29 - error TS1471: Module 'pkg2' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - -1 import type { TheNum } from 'pkg2' -   ~~~~~~ - -[12:01:14 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] -Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} -Program structureReused: Not -Program files:: -/a/lib/lib.es2020.full.d.ts -/user/username/projects/myproject/packages/pkg2/build/const.d.cts -/user/username/projects/myproject/packages/pkg2/build/index.d.ts -/user/username/projects/myproject/packages/pkg1/index.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/packages/pkg1/index.ts - -Shape signatures in builder refreshed for:: -/user/username/projects/myproject/packages/pkg1/index.ts (computed .d.ts) WatchedFiles:: /user/username/projects/myproject/packages/pkg2/tsconfig.json: @@ -349,24 +134,16 @@ WatchedFiles:: {"fileName":"/user/username/projects/myproject/packages/pkg2/index.ts","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/package.json: {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} - {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} /a/lib/package.json: {"fileName":"/a/lib/package.json","pollingInterval":250} - {"fileName":"/a/lib/package.json","pollingInterval":250} /a/package.json: {"fileName":"/a/package.json","pollingInterval":250} - {"fileName":"/a/package.json","pollingInterval":250} /package.json: {"fileName":"/package.json","pollingInterval":250} - {"fileName":"/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/tsconfig.json: {"fileName":"/user/username/projects/myproject/packages/pkg1/tsconfig.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/index.ts: {"fileName":"/user/username/projects/myproject/packages/pkg1/index.ts","pollingInterval":250} -/user/username/projects/myproject/packages/pkg1/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg1/package.json","pollingInterval":250} -/user/username/projects/myproject/packages/pkg2/build/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg2/build/package.json","pollingInterval":250} FsWatches:: @@ -387,67 +164,6 @@ Input:: Output:: ->> Screen clear -[12:01:18 AM] File change detected. Starting incremental compilation... - -[12:01:19 AM] Project 'packages/pkg1/tsconfig.json' is out of date because oldest output 'packages/pkg1/build/index.js' is older than newest input 'packages/pkg2' - -[12:01:20 AM] Building project '/user/username/projects/myproject/packages/pkg1/tsconfig.json'... - -Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package.json'. -'package.json' does not have a 'typesVersions' field. -======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== -Module resolution kind is not specified, using 'Node12'. -File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. -Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. -Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. -Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. -'package.json' does not have a 'typesVersions' field. -'package.json' does not have a 'typings' field. -'package.json' does not have a 'types' field. -'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts' exist - use it as a name resolution result. -Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts', result '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. -======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.ts' with Package ID 'pkg2/build/index.d.ts@1.0.0'. ======== -File '/user/username/projects/myproject/packages/pkg2/build/package.json' does not exist. -Found 'package.json' at '/user/username/projects/myproject/packages/pkg2/package.json'. -'package.json' does not have a 'typesVersions' field. -======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== -Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. -Module resolution kind is not specified, using 'Node12'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. -File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. -File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. -======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/const.d.cts'. ======== -File '/a/lib/package.json' does not exist. -File '/a/package.json' does not exist. -File '/package.json' does not exist. -[12:01:24 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] -Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} -Program structureReused: Not -Program files:: -/a/lib/lib.es2020.full.d.ts -/user/username/projects/myproject/packages/pkg2/build/const.d.cts -/user/username/projects/myproject/packages/pkg2/build/index.d.ts -/user/username/projects/myproject/packages/pkg1/index.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/packages/pkg1/index.ts - -Shape signatures in builder refreshed for:: -/user/username/projects/myproject/packages/pkg1/index.ts (computed .d.ts) WatchedFiles:: /user/username/projects/myproject/packages/pkg2/tsconfig.json: @@ -458,24 +174,16 @@ WatchedFiles:: {"fileName":"/user/username/projects/myproject/packages/pkg2/index.ts","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/package.json: {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} - {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} /a/lib/package.json: {"fileName":"/a/lib/package.json","pollingInterval":250} - {"fileName":"/a/lib/package.json","pollingInterval":250} /a/package.json: {"fileName":"/a/package.json","pollingInterval":250} - {"fileName":"/a/package.json","pollingInterval":250} /package.json: {"fileName":"/package.json","pollingInterval":250} - {"fileName":"/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/tsconfig.json: {"fileName":"/user/username/projects/myproject/packages/pkg1/tsconfig.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/index.ts: {"fileName":"/user/username/projects/myproject/packages/pkg1/index.ts","pollingInterval":250} -/user/username/projects/myproject/packages/pkg1/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg1/package.json","pollingInterval":250} -/user/username/projects/myproject/packages/pkg2/build/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg2/build/package.json","pollingInterval":250} FsWatches:: @@ -487,7 +195,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/myproject/packages/pkg1/build/index.js] file written with same contents Change:: reports import errors after change to package file @@ -497,78 +204,6 @@ Input:: Output:: ->> Screen clear -[12:01:28 AM] File change detected. Starting incremental compilation... - -[12:01:29 AM] Project 'packages/pkg1/tsconfig.json' is out of date because oldest output 'packages/pkg1/build/index.js' is older than newest input 'packages/pkg2' - -[12:01:30 AM] Building project '/user/username/projects/myproject/packages/pkg1/tsconfig.json'... - -Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package.json'. -'package.json' does not have a 'typesVersions' field. -======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== -Module resolution kind is not specified, using 'Node12'. -File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. -Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. -Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. -Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. -'package.json' does not have a 'typesVersions' field. -File '/user/username/projects/myproject/node_modules/pkg2.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. -'package.json' does not have a 'typings' field. -'package.json' does not have a 'types' field. -'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.d.ts' does not exist. -File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts' exist - use it as a name resolution result. -Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts', result '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. -======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.ts' with Package ID 'pkg2/build/index.d.ts@1.0.0'. ======== -File '/user/username/projects/myproject/packages/pkg2/build/package.json' does not exist. -Found 'package.json' at '/user/username/projects/myproject/packages/pkg2/package.json'. -'package.json' does not have a 'typesVersions' field. -======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== -Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. -Module resolution kind is not specified, using 'Node12'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. -File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. -File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. -======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/const.d.cts'. ======== -File '/a/lib/package.json' does not exist. -File '/a/package.json' does not exist. -File '/package.json' does not exist. -packages/pkg1/index.ts:1:29 - error TS1471: Module 'pkg2' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - -1 import type { TheNum } from 'pkg2' -   ~~~~~~ - -[12:01:31 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] -Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} -Program structureReused: Not -Program files:: -/a/lib/lib.es2020.full.d.ts -/user/username/projects/myproject/packages/pkg2/build/const.d.cts -/user/username/projects/myproject/packages/pkg2/build/index.d.ts -/user/username/projects/myproject/packages/pkg1/index.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/packages/pkg1/index.ts - -Shape signatures in builder refreshed for:: -/user/username/projects/myproject/packages/pkg1/index.ts (computed .d.ts) WatchedFiles:: /user/username/projects/myproject/packages/pkg2/tsconfig.json: @@ -579,24 +214,16 @@ WatchedFiles:: {"fileName":"/user/username/projects/myproject/packages/pkg2/index.ts","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/package.json: {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} - {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} /a/lib/package.json: {"fileName":"/a/lib/package.json","pollingInterval":250} - {"fileName":"/a/lib/package.json","pollingInterval":250} /a/package.json: {"fileName":"/a/package.json","pollingInterval":250} - {"fileName":"/a/package.json","pollingInterval":250} /package.json: {"fileName":"/package.json","pollingInterval":250} - {"fileName":"/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/tsconfig.json: {"fileName":"/user/username/projects/myproject/packages/pkg1/tsconfig.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/index.ts: {"fileName":"/user/username/projects/myproject/packages/pkg1/index.ts","pollingInterval":250} -/user/username/projects/myproject/packages/pkg1/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg1/package.json","pollingInterval":250} -/user/username/projects/myproject/packages/pkg2/build/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg2/build/package.json","pollingInterval":250} FsWatches:: @@ -622,11 +249,11 @@ export type { TheNum } from './const.cjs'; Output:: >> Screen clear -[12:01:38 AM] File change detected. Starting incremental compilation... +[12:01:03 AM] File change detected. Starting incremental compilation... -[12:01:39 AM] Project 'packages/pkg2/tsconfig.json' is out of date because oldest output 'packages/pkg2/build/const.cjs' is older than newest input 'packages/pkg2/index.cts' +[12:01:04 AM] Project 'packages/pkg2/tsconfig.json' is out of date because output file 'packages/pkg2/build/const.cjs' does not exist -[12:01:40 AM] Building project '/user/username/projects/myproject/packages/pkg2/tsconfig.json'... +[12:01:05 AM] Building project '/user/username/projects/myproject/packages/pkg2/tsconfig.json'... ======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/index.cts'. ======== Module resolution kind is not specified, using 'Node12'. @@ -640,7 +267,12 @@ File '/user/username/projects/myproject/packages/pkg2/const.cts' exist - use it File '/a/lib/package.json' does not exist. File '/a/package.json' does not exist. File '/package.json' does not exist. -[12:01:49 AM] Updating unchanged output timestamps of project '/user/username/projects/myproject/packages/pkg2/tsconfig.json'... +packages/pkg2/tsconfig.json:1:64 - error TS4124: Compiler option 'module' of value 'node12' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + +1 {"compilerOptions":{"composite":true,"outDir":"build","module":"node12"}} +   ~~~~~~~~ + +[12:01:06 AM] Found 1 error. Watching for file changes. @@ -652,11 +284,9 @@ Program files:: /user/username/projects/myproject/packages/pkg2/const.cts /user/username/projects/myproject/packages/pkg2/index.cts -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/packages/pkg2/index.cts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/user/username/projects/myproject/packages/pkg2/index.cts (computed .d.ts) +No shapes updated in the builder:: WatchedFiles:: /user/username/projects/myproject/packages/pkg2/tsconfig.json: @@ -665,24 +295,16 @@ WatchedFiles:: {"fileName":"/user/username/projects/myproject/packages/pkg2/const.cts","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/package.json: {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} - {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} /a/lib/package.json: {"fileName":"/a/lib/package.json","pollingInterval":250} - {"fileName":"/a/lib/package.json","pollingInterval":250} /a/package.json: {"fileName":"/a/package.json","pollingInterval":250} - {"fileName":"/a/package.json","pollingInterval":250} /package.json: {"fileName":"/package.json","pollingInterval":250} - {"fileName":"/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/tsconfig.json: {"fileName":"/user/username/projects/myproject/packages/pkg1/tsconfig.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/index.ts: {"fileName":"/user/username/projects/myproject/packages/pkg1/index.ts","pollingInterval":250} -/user/username/projects/myproject/packages/pkg1/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg1/package.json","pollingInterval":250} -/user/username/projects/myproject/packages/pkg2/build/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg2/build/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/index.cts: {"fileName":"/user/username/projects/myproject/packages/pkg2/index.cts","pollingInterval":250} @@ -696,72 +318,3 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/myproject/packages/pkg2/build/const.cjs] file changed its modified time -//// [/user/username/projects/myproject/packages/pkg2/build/const.d.cts] file changed its modified time -//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../../a/lib/lib.es2020.full.d.ts","../const.cts","../index.cts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},"-11202312776-export type TheNum = 42;",{"version":"-9668872159-export type { TheNum } from './const.cjs';","signature":"-9835135925-export type { TheNum } from './const.cjs';\n","impliedFormat":1}],"options":{"composite":true,"module":100,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} - -//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../../../../../a/lib/lib.es2020.full.d.ts", - "../const.cts", - "../index.cts" - ], - "fileNamesList": [ - [ - "../const.cts" - ] - ], - "fileInfos": { - "../../../../../../../a/lib/lib.es2020.full.d.ts": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "../const.cts": { - "version": "-11202312776-export type TheNum = 42;", - "signature": "-11202312776-export type TheNum = 42;" - }, - "../index.cts": { - "version": "-9668872159-export type { TheNum } from './const.cjs';", - "signature": "-9835135925-export type { TheNum } from './const.cjs';\n", - "impliedFormat": 1 - } - }, - "options": { - "composite": true, - "module": 100, - "outDir": "./" - }, - "referencedMap": { - "../index.cts": [ - "../const.cts" - ] - }, - "exportedModulesMap": { - "../index.cts": [ - "../const.cts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../../../../../../a/lib/lib.es2020.full.d.ts", - "../const.cts", - "../index.cts" - ] - }, - "version": "FakeTSVersion", - "size": 928 -} - -//// [/user/username/projects/myproject/packages/pkg2/build/index.cjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); - - -//// [/user/username/projects/myproject/packages/pkg2/build/index.d.cts] -export type { TheNum } from './const.cjs'; - - diff --git a/tests/baselines/reference/tscWatch/nodenext watch emit/esm-mode-file-is-edited.js b/tests/baselines/reference/tscWatch/nodenext watch emit/esm-mode-file-is-edited.js index bad3c2f405f98..605b59c4f8abe 100644 --- a/tests/baselines/reference/tscWatch/nodenext watch emit/esm-mode-file-is-edited.js +++ b/tests/baselines/reference/tscWatch/nodenext watch emit/esm-mode-file-is-edited.js @@ -32,7 +32,12 @@ Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... -[12:00:27 AM] Found 0 errors. Watching for file changes. +project/tsconfig.json:1:62 - error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + +1 {"compilerOptions":{"strict":true,"target":"es2020","module":"nodenext","moduleResolution":"nodenext","outDir":"../dist"}} +   ~~~~~~~~~~ + +[12:00:27 AM] Found 1 error. Watching for file changes. @@ -44,10 +49,7 @@ Program files:: /project/src/deps.d.ts /project/src/index.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.es2020.full.d.ts -/project/src/deps.d.ts -/project/src/index.ts +No cached semantic diagnostics in the builder:: Shape signatures in builder refreshed for:: /a/lib/lib.es2020.full.d.ts (used version) @@ -102,7 +104,12 @@ Output:: >> Screen clear [12:00:30 AM] File change detected. Starting incremental compilation... -[12:00:34 AM] Found 0 errors. Watching for file changes. +project/tsconfig.json:1:62 - error TS4124: Compiler option 'module' of value 'nodenext' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. + +1 {"compilerOptions":{"strict":true,"target":"es2020","module":"nodenext","moduleResolution":"nodenext","outDir":"../dist"}} +   ~~~~~~~~~~ + +[12:00:34 AM] Found 1 error. Watching for file changes. @@ -114,8 +121,7 @@ Program files:: /project/src/deps.d.ts /project/src/index.ts -Semantic diagnostics in builder refreshed for:: -/project/src/index.ts +No cached semantic diagnostics in the builder:: Shape signatures in builder refreshed for:: /project/src/index.ts (computed .d.ts)