diff --git a/src/testRunner/unittests/helpers/node10Result.ts b/src/testRunner/unittests/helpers/node10Result.ts index 5961d211f3f..132a3b26c1c 100644 --- a/src/testRunner/unittests/helpers/node10Result.ts +++ b/src/testRunner/unittests/helpers/node10Result.ts @@ -72,6 +72,8 @@ export function getFsContentsForNode10Result(): FsContents { `, "/home/src/projects/project/tsconfig.json": JSON.stringify({ compilerOptions: { + target: "es5", + module: "node16", moduleResolution: "node16", traceResolution: true, incremental: true, @@ -82,4 +84,4 @@ export function getFsContentsForNode10Result(): FsContents { }), [libFile.path]: libFile.content, }; -} \ No newline at end of file +} diff --git a/src/testRunner/unittests/tscWatch/forceConsistentCasingInFileNames.ts b/src/testRunner/unittests/tscWatch/forceConsistentCasingInFileNames.ts index da9db45871b..9eb0a025deb 100644 --- a/src/testRunner/unittests/tscWatch/forceConsistentCasingInFileNames.ts +++ b/src/testRunner/unittests/tscWatch/forceConsistentCasingInFileNames.ts @@ -295,6 +295,8 @@ a;b; }), "/Users/name/projects/web/tsconfig.json": JSON.stringify({ compilerOptions: { + target: "es5", + module: "nodenext", moduleResolution: "nodenext", forceConsistentCasingInFileNames: true, traceResolution: true, diff --git a/src/testRunner/unittests/tscWatch/moduleResolution.ts b/src/testRunner/unittests/tscWatch/moduleResolution.ts index 2512116a46a..6c38a0b14d2 100644 --- a/src/testRunner/unittests/tscWatch/moduleResolution.ts +++ b/src/testRunner/unittests/tscWatch/moduleResolution.ts @@ -89,6 +89,8 @@ describe("unittests:: tsc-watch:: moduleResolution", () => { path: `/user/username/projects/myproject/tsconfig.json`, content: JSON.stringify({ compilerOptions: { + target: "es5", + module: "nodenext", moduleResolution: "nodenext", outDir: "./dist", declaration: true, @@ -282,7 +284,7 @@ describe("unittests:: tsc-watch:: moduleResolution", () => { { path: `/user/username/projects/myproject/tsconfig.json`, content: JSON.stringify({ - compilerOptions: { moduleResolution: "node16" }, + compilerOptions: { module: "node16", moduleResolution: "node16" }, }) }, { @@ -352,7 +354,7 @@ describe("unittests:: tsc-watch:: moduleResolution", () => { { path: `/user/username/projects/myproject/tsconfig.json`, content: JSON.stringify({ - compilerOptions: { moduleResolution: "node16" }, + compilerOptions: { module: "node16", moduleResolution: "node16" }, }) }, { @@ -538,4 +540,4 @@ describe("unittests:: tsc-watch:: moduleResolution", () => { }, ] }); -}); \ No newline at end of file +}); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index eff2717fe15..b5a333ac28e 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -9191,7 +9191,7 @@ declare namespace ts { /** * Controls the format the file is detected as - this can be derived from only the path * and files on disk, but needs to be done with a module resolution cache in scope to be performant. - * This is usually `undefined` for compilations that do not have `moduleResolution` values of `node16` or `nodenext`. + * This is usually `undefined` for compilations that do not have `module` values of `node16` or `nodenext`. */ impliedNodeFormat?: ResolutionMode; /** @@ -9504,7 +9504,7 @@ declare namespace ts { * Calculates the final resolution mode for a given module reference node. This is generally the explicitly provided resolution mode, if * one exists, or the mode of the containing source file. (Excepting import=require, which is always commonjs, and dynamic import, which is always esm). * Notably, this function always returns `undefined` if the containing file has an `undefined` `impliedNodeFormat` - this field is only set when - * `moduleResolution` is `node16`+. + * `module` is `node16`+. * @param file The file the import or import-like reference is contained within * @param usage The module reference string * @returns The final resolution mode of the import diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 3f78e1ae29a..15d11d57631 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -5138,7 +5138,7 @@ declare namespace ts { /** * Controls the format the file is detected as - this can be derived from only the path * and files on disk, but needs to be done with a module resolution cache in scope to be performant. - * This is usually `undefined` for compilations that do not have `moduleResolution` values of `node16` or `nodenext`. + * This is usually `undefined` for compilations that do not have `module` values of `node16` or `nodenext`. */ impliedNodeFormat?: ResolutionMode; /** @@ -5451,7 +5451,7 @@ declare namespace ts { * Calculates the final resolution mode for a given module reference node. This is generally the explicitly provided resolution mode, if * one exists, or the mode of the containing source file. (Excepting import=require, which is always commonjs, and dynamic import, which is always esm). * Notably, this function always returns `undefined` if the containing file has an `undefined` `impliedNodeFormat` - this field is only set when - * `moduleResolution` is `node16`+. + * `module` is `node16`+. * @param file The file the import or import-like reference is contained within * @param usage The module reference string * @returns The final resolution mode of the import diff --git a/tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=bundler).errors.txt b/tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=bundler).errors.txt index 71d5b10190e..9168133fccc 100644 --- a/tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=bundler).errors.txt +++ b/tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=bundler).errors.txt @@ -1,7 +1,9 @@ error TS5095: Option 'bundler' can only be used when 'module' is set to 'es2015' or later. +error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. !!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'es2015' or later. +!!! error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. ==== /node_modules/dep/package.json (0 errors) ==== // This documents bug https://github.com/microsoft/TypeScript/issues/50762. diff --git a/tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=bundler).trace.json b/tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=bundler).trace.json index 6d14798319a..7b710c26e3c 100644 --- a/tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=bundler).trace.json +++ b/tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=bundler).trace.json @@ -1,11 +1,13 @@ [ + "File '/node_modules/dep/dist/package.json' does not exist.", + "Found 'package.json' at '/node_modules/dep/package.json'.", "======== Resolving module 'dep' from '/index.mts'. ========", "Explicitly specified module resolution kind: 'Bundler'.", "Resolving in CJS mode with conditions 'import', 'types'.", "File '/package.json' does not exist.", "Loading module 'dep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", - "Found 'package.json' at '/node_modules/dep/package.json'.", + "File '/node_modules/dep/package.json' exists according to earlier cached lookups.", "Entering conditional exports.", "Matched 'exports' condition 'import'.", "Using 'exports' subpath '.' with target './dist/index.mjs'.", @@ -21,6 +23,8 @@ "Exiting conditional exports.", "Resolving real path for '/node_modules/dep/dist/index.d.ts', result '/node_modules/dep/dist/index.d.ts'.", "======== Module name 'dep' was successfully resolved to '/node_modules/dep/dist/index.d.ts' with Package ID 'dep/dist/index.d.ts@1.0.0'. ========", + "File '/.ts/package.json' does not exist.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -33,6 +37,8 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es5' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-decorators' from '/.src/__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -45,6 +51,8 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-decorators' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-decorators/legacy' from '/.src/__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -57,6 +65,8 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -69,6 +79,8 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-dom' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-webworker/importscripts' from '/.src/__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -81,6 +93,8 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-scripthost' from '/.src/__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -92,5 +106,7 @@ "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: JavaScript.", "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", - "======== Module name '@typescript/lib-scripthost' was not resolved. ========" + "======== Module name '@typescript/lib-scripthost' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=node16).errors.txt b/tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=node16).errors.txt deleted file mode 100644 index 8baa069a592..00000000000 --- a/tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=node16).errors.txt +++ /dev/null @@ -1,31 +0,0 @@ -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. - - -!!! error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. -==== /node_modules/dep/package.json (0 errors) ==== - // This documents bug https://github.com/microsoft/TypeScript/issues/50762. - - { - "name": "dep", - "version": "1.0.0", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts", - } - } - } - -==== /node_modules/dep/dist/index.d.ts (0 errors) ==== - export {}; - -==== /node_modules/dep/dist/index.mjs (0 errors) ==== - export {}; - -==== /index.mts (0 errors) ==== - import {} from "dep"; - // Should be an untyped resolution to dep/dist/index.mjs, - // but the first search is only for TS files, and when - // there's no dist/index.d.mts, it continues looking for - // matching conditions and resolves via `types`. \ No newline at end of file diff --git a/tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=nodenext).errors.txt b/tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=nodenext).errors.txt deleted file mode 100644 index c128b9f0ec8..00000000000 --- a/tests/baselines/reference/conditionalExportsResolutionFallback(moduleresolution=nodenext).errors.txt +++ /dev/null @@ -1,31 +0,0 @@ -error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. - - -!!! error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. -==== /node_modules/dep/package.json (0 errors) ==== - // This documents bug https://github.com/microsoft/TypeScript/issues/50762. - - { - "name": "dep", - "version": "1.0.0", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts", - } - } - } - -==== /node_modules/dep/dist/index.d.ts (0 errors) ==== - export {}; - -==== /node_modules/dep/dist/index.mjs (0 errors) ==== - export {}; - -==== /index.mts (0 errors) ==== - import {} from "dep"; - // Should be an untyped resolution to dep/dist/index.mjs, - // but the first search is only for TS files, and when - // there's no dist/index.d.mts, it continues looking for - // matching conditions and resolves via `types`. \ No newline at end of file diff --git a/tests/baselines/reference/moduleExportNonStructured.errors.txt b/tests/baselines/reference/moduleExportNonStructured.errors.txt deleted file mode 100644 index 958728c943d..00000000000 --- a/tests/baselines/reference/moduleExportNonStructured.errors.txt +++ /dev/null @@ -1,36 +0,0 @@ -error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. - - -!!! error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. -==== package.json (0 errors) ==== - { - "name": "test", - "version": "1.0.0", - "description": "", - "type": "module", - "module": "index.mjs" - } - -==== index.mts (0 errors) ==== - import * as exportAny from "./exportAny.cjs"; - import * as exportUnknown from "./exportUnknown.cjs"; - import * as exportSymbol from "./exportSymbol.cjs"; - - import type * as exportAnyType from "./exportAny.cjs"; - import type * as exportUnknownType from "./exportUnknown.cjs"; - import type * as exportSymbolType from "./exportSymbol.cjs"; - -==== exportAny.d.cts (0 errors) ==== - declare const __: any; - export = __; - - -==== exportUnknown.d.cts (0 errors) ==== - declare const __: unknown; - export = __; - - -==== exportSymbol.d.cts (0 errors) ==== - declare const __: symbol; - export = __; - \ No newline at end of file diff --git a/tests/baselines/reference/nestedPackageJsonRedirect(moduleresolution=bundler).errors.txt b/tests/baselines/reference/nestedPackageJsonRedirect(moduleresolution=bundler).errors.txt index c867a288305..deacfeb131b 100644 --- a/tests/baselines/reference/nestedPackageJsonRedirect(moduleresolution=bundler).errors.txt +++ b/tests/baselines/reference/nestedPackageJsonRedirect(moduleresolution=bundler).errors.txt @@ -1,7 +1,9 @@ error TS5095: Option 'bundler' can only be used when 'module' is set to 'es2015' or later. +error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. !!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'es2015' or later. +!!! error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. ==== /node_modules/@restart/hooks/package.json (0 errors) ==== { "name": "@restart/hooks", diff --git a/tests/baselines/reference/nestedPackageJsonRedirect(moduleresolution=bundler).trace.json b/tests/baselines/reference/nestedPackageJsonRedirect(moduleresolution=bundler).trace.json index a6d17c49611..ce5ba5363fe 100644 --- a/tests/baselines/reference/nestedPackageJsonRedirect(moduleresolution=bundler).trace.json +++ b/tests/baselines/reference/nestedPackageJsonRedirect(moduleresolution=bundler).trace.json @@ -1,12 +1,15 @@ [ + "File '/node_modules/@restart/hooks/esm/package.json' does not exist.", + "Found 'package.json' at '/node_modules/@restart/hooks/package.json'.", + "File '/package.json' does not exist.", "======== Resolving module '@restart/hooks/useMergedRefs' from '/main.ts'. ========", "Explicitly specified module resolution kind: 'Bundler'.", "Resolving in CJS mode with conditions 'import', 'types'.", - "File '/package.json' does not exist.", + "File '/package.json' does not exist according to earlier cached lookups.", "Loading module '@restart/hooks/useMergedRefs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/@restart/hooks/useMergedRefs/package.json'.", - "Found 'package.json' at '/node_modules/@restart/hooks/package.json'.", + "File '/node_modules/@restart/hooks/package.json' exists according to earlier cached lookups.", "File '/node_modules/@restart/hooks/useMergedRefs.ts' does not exist.", "File '/node_modules/@restart/hooks/useMergedRefs.tsx' does not exist.", "File '/node_modules/@restart/hooks/useMergedRefs.d.ts' does not exist.", @@ -16,6 +19,8 @@ "File '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts' exists - use it as a name resolution result.", "Resolving real path for '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts', result '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts'.", "======== Module name '@restart/hooks/useMergedRefs' was successfully resolved to '/node_modules/@restart/hooks/esm/useMergedRefs.d.ts'. ========", + "File '/.ts/package.json' does not exist.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -28,6 +33,8 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es5' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-decorators' from '/.src/__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -40,6 +47,8 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-decorators' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-decorators/legacy' from '/.src/__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -52,6 +61,8 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -64,6 +75,8 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-dom' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-webworker/importscripts' from '/.src/__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -76,6 +89,8 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-scripthost' from '/.src/__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -87,5 +102,7 @@ "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: JavaScript.", "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", - "======== Module name '@typescript/lib-scripthost' was not resolved. ========" + "======== Module name '@typescript/lib-scripthost' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/nestedPackageJsonRedirect(moduleresolution=node16).errors.txt b/tests/baselines/reference/nestedPackageJsonRedirect(moduleresolution=node16).errors.txt deleted file mode 100644 index 8aacbdd1b74..00000000000 --- a/tests/baselines/reference/nestedPackageJsonRedirect(moduleresolution=node16).errors.txt +++ /dev/null @@ -1,28 +0,0 @@ -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. - - -!!! error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. -==== /node_modules/@restart/hooks/package.json (0 errors) ==== - { - "name": "@restart/hooks", - "version": "0.3.25", - "main": "cjs/index.js", - "types": "cjs/index.d.ts", - "module": "esm/index.js" - } - -==== /node_modules/@restart/hooks/useMergedRefs/package.json (0 errors) ==== - { - "name": "@restart/hooks/useMergedRefs", - "private": true, - "main": "../cjs/useMergedRefs.js", - "module": "../esm/useMergedRefs.js", - "types": "../esm/useMergedRefs.d.ts" - } - -==== /node_modules/@restart/hooks/esm/useMergedRefs.d.ts (0 errors) ==== - export {}; - -==== /main.ts (0 errors) ==== - import {} from "@restart/hooks/useMergedRefs"; - \ No newline at end of file diff --git a/tests/baselines/reference/nestedPackageJsonRedirect(moduleresolution=nodenext).errors.txt b/tests/baselines/reference/nestedPackageJsonRedirect(moduleresolution=nodenext).errors.txt deleted file mode 100644 index 3b67cb241a5..00000000000 --- a/tests/baselines/reference/nestedPackageJsonRedirect(moduleresolution=nodenext).errors.txt +++ /dev/null @@ -1,28 +0,0 @@ -error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. - - -!!! error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. -==== /node_modules/@restart/hooks/package.json (0 errors) ==== - { - "name": "@restart/hooks", - "version": "0.3.25", - "main": "cjs/index.js", - "types": "cjs/index.d.ts", - "module": "esm/index.js" - } - -==== /node_modules/@restart/hooks/useMergedRefs/package.json (0 errors) ==== - { - "name": "@restart/hooks/useMergedRefs", - "private": true, - "main": "../cjs/useMergedRefs.js", - "module": "../esm/useMergedRefs.js", - "types": "../esm/useMergedRefs.d.ts" - } - -==== /node_modules/@restart/hooks/esm/useMergedRefs.d.ts (0 errors) ==== - export {}; - -==== /main.ts (0 errors) ==== - import {} from "@restart/hooks/useMergedRefs"; - \ No newline at end of file diff --git a/tests/baselines/reference/nodeNextModuleResolution1.errors.txt b/tests/baselines/reference/nodeNextModuleResolution1.errors.txt index 6293f22afb8..00bab93c4a8 100644 --- a/tests/baselines/reference/nodeNextModuleResolution1.errors.txt +++ b/tests/baselines/reference/nodeNextModuleResolution1.errors.txt @@ -1,8 +1,6 @@ -error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. /a/b/c/d/e/app.ts(1,17): error TS2307: Cannot find module 'foo' or its corresponding type declarations. -!!! error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. ==== /a/node_modules/foo.d.ts (0 errors) ==== export declare let x: number diff --git a/tests/baselines/reference/nodeNextModuleResolution1.js b/tests/baselines/reference/nodeNextModuleResolution1.js index d76bd3acd7f..a006d7840c3 100644 --- a/tests/baselines/reference/nodeNextModuleResolution1.js +++ b/tests/baselines/reference/nodeNextModuleResolution1.js @@ -15,5 +15,4 @@ import {x} from "foo"; //// [app.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +export {}; diff --git a/tests/baselines/reference/nodeNextModuleResolution2.errors.txt b/tests/baselines/reference/nodeNextModuleResolution2.errors.txt deleted file mode 100644 index 0f97e5e2de6..00000000000 --- a/tests/baselines/reference/nodeNextModuleResolution2.errors.txt +++ /dev/null @@ -1,18 +0,0 @@ -error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. - - -!!! error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. -==== /a/node_modules/foo/index.d.ts (0 errors) ==== - export declare let x: number -==== /a/node_modules/foo/package.json (0 errors) ==== - { - "name": "foo", - "type": "module", - "exports": { - ".": "./index.d.ts" - } - } - -==== /a/b/c/d/e/app.mts (0 errors) ==== - import {x} from "foo"; - \ No newline at end of file diff --git a/tests/baselines/reference/nodeNextModuleResolution2.js b/tests/baselines/reference/nodeNextModuleResolution2.js index 19475675a56..e57c0f25756 100644 --- a/tests/baselines/reference/nodeNextModuleResolution2.js +++ b/tests/baselines/reference/nodeNextModuleResolution2.js @@ -16,5 +16,4 @@ import {x} from "foo"; //// [app.mjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +export {}; diff --git a/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).errors.txt b/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).errors.txt index 0668d695d63..4c01090dad8 100644 --- a/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).errors.txt +++ b/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).errors.txt @@ -1,4 +1,5 @@ error TS5095: Option 'bundler' can only be used when 'module' is set to 'es2015' or later. +error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node16'. error TS6504: File '/node_modules/bar/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? The file is in the program because: Root file specified for compilation @@ -18,6 +19,7 @@ error TS6504: File '/node_modules/foo/index.mjs' is a JavaScript file. Did you m !!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'es2015' or later. +!!! error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node16'. !!! error TS6504: File '/node_modules/bar/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? !!! error TS6504: The file is in the program because: !!! error TS6504: Root file specified for compilation diff --git a/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).trace.json b/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).trace.json index 1ee77d07b8f..6b605e7ac25 100644 --- a/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).trace.json +++ b/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).trace.json @@ -1,11 +1,13 @@ [ + "Found 'package.json' at '/node_modules/foo/package.json'.", + "Found 'package.json' at '/node_modules/@types/bar/package.json'.", "======== Resolving module 'foo' from '/index.mts'. ========", "Explicitly specified module resolution kind: 'Bundler'.", "Resolving in CJS mode with conditions 'import', 'types'.", "File '/package.json' does not exist.", "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.", "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", - "Found 'package.json' at '/node_modules/foo/package.json'.", + "File '/node_modules/foo/package.json' exists according to earlier cached lookups.", "Entering conditional exports.", "Matched 'exports' condition 'import'.", "Using 'exports' subpath '.' with target './index.mjs'.", @@ -55,7 +57,7 @@ "Failed to resolve under condition 'import'.", "Saw non-matching condition 'require'.", "Exiting conditional exports.", - "Found 'package.json' at '/node_modules/@types/bar/package.json'.", + "File '/node_modules/@types/bar/package.json' exists according to earlier cached lookups.", "Entering conditional exports.", "Saw non-matching condition 'require'.", "Exiting conditional exports.", @@ -111,6 +113,8 @@ "File '/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result.", "Resolving real path for '/node_modules/@types/bar/index.d.ts', result '/node_modules/@types/bar/index.d.ts'.", "======== Type reference directive 'bar' was successfully resolved to '/node_modules/@types/bar/index.d.ts' with Package ID '@types/bar/index.d.ts@1.0.0', primary: true. ========", + "File '/.ts/package.json' does not exist.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -123,6 +127,8 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-es5' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-decorators' from '/.src/__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -135,6 +141,8 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-decorators' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-decorators/legacy' from '/.src/__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -146,6 +154,8 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -158,6 +168,8 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-dom' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-webworker/importscripts' from '/.src/__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -169,6 +181,8 @@ "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", "======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", "======== Resolving module '@typescript/lib-scripthost' from '/.src/__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========", "Explicitly specified module resolution kind: 'Node10'.", "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -180,5 +194,7 @@ "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: JavaScript.", "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", - "======== Module name '@typescript/lib-scripthost' was not resolved. ========" + "======== Module name '@typescript/lib-scripthost' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).errors.txt b/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).errors.txt index 7fa0a30235c..fe904ca6953 100644 --- a/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).errors.txt +++ b/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).errors.txt @@ -1,4 +1,3 @@ -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. error TS6504: File '/node_modules/bar/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? The file is in the program because: Root file specified for compilation @@ -17,7 +16,6 @@ error TS6504: File '/node_modules/foo/index.mjs' is a JavaScript file. Did you m There are types at '/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. -!!! error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. !!! error TS6504: File '/node_modules/bar/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? !!! error TS6504: The file is in the program because: !!! error TS6504: Root file specified for compilation diff --git a/tests/baselines/reference/tsc/moduleResolution/node10Result.js b/tests/baselines/reference/tsc/moduleResolution/node10Result.js index 5536e41466a..dc9b4ea37f7 100644 --- a/tests/baselines/reference/tsc/moduleResolution/node10Result.js +++ b/tests/baselines/reference/tsc/moduleResolution/node10Result.js @@ -137,7 +137,7 @@ export const foo2 = 1; } //// [/home/src/projects/project/tsconfig.json] -{"compilerOptions":{"moduleResolution":"node16","traceResolution":true,"incremental":true,"strict":true,"types":[]},"files":["index.mts"]} +{"compilerOptions":{"target":"es5","module":"node16","moduleResolution":"node16","traceResolution":true,"incremental":true,"strict":true,"types":[]},"files":["index.mts"]} //// [/lib/lib.d.ts] /// @@ -326,14 +326,24 @@ File '/home/src/projects/project/node_modules/foo2/package.json' exists accordin File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists according to earlier cached lookups. File '/lib/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +home/src/projects/project/index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. + +1 import { foo } from "foo"; +   ~~~~~ + +home/src/projects/project/index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. + +2 import { bar } from "bar"; +   ~~~~~ -Found 1 error. +Found 2 errors in the same file, starting at: home/src/projects/project/index.mts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: Not Program files:: /lib/lib.d.ts @@ -341,7 +351,11 @@ Program files:: /home/src/projects/project/node_modules/@types/bar2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/node_modules/foo2/index.d.ts +/home/src/projects/project/node_modules/@types/bar2/index.d.ts +/home/src/projects/project/index.mts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) @@ -351,12 +365,11 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/index.mjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +export {}; //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../lib/lib.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"fileInfos":[{"version":"3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedFormat":1},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-7439170493-export declare const bar2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","impliedFormat":99}],"root":[4],"options":{"strict":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../lib/lib.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"fileInfos":[{"version":"3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedFormat":1},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-7439170493-export declare const bar2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","impliedFormat":99}],"root":[4],"options":{"module":100,"strict":true,"target":1},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"file":"./index.mts","start":20,"length":5,"code":7016,"category":1,"messageText":{"messageText":"Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.","category":1,"code":7016,"next":[{"info":{"moduleReference":"foo","mode":99}}]}},{"file":"./index.mts","start":47,"length":5,"code":7016,"category":1,"messageText":{"messageText":"Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type.","category":1,"code":7016,"next":[{"info":{"moduleReference":"bar","mode":99}}]}}]],3,2,1]},"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -420,7 +433,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); ] ], "options": { - "strict": true + "module": 100, + "strict": true, + "target": 1 }, "referencedMap": { "./index.mts": [ @@ -433,10 +448,60 @@ Object.defineProperty(exports, "__esModule", { value: true }); "./node_modules/foo2/index.d.ts", "./node_modules/@types/bar2/index.d.ts" ] - } + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.mts", + [ + { + "file": "./index.mts", + "start": 20, + "length": 5, + "code": 7016, + "category": 1, + "messageText": { + "messageText": "Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.", + "category": 1, + "code": 7016, + "next": [ + { + "info": { + "moduleReference": "foo", + "mode": 99 + } + } + ] + } + }, + { + "file": "./index.mts", + "start": 47, + "length": 5, + "code": 7016, + "category": 1, + "messageText": { + "messageText": "Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type.", + "category": 1, + "code": 7016, + "next": [ + { + "info": { + "moduleReference": "bar", + "mode": 99 + } + } + ] + } + } + ] + ], + "./node_modules/@types/bar2/index.d.ts", + "./node_modules/foo2/index.d.ts", + "../../../../lib/lib.d.ts" + ] }, "version": "FakeTSVersion", - "size": 1118 + "size": 1823 } @@ -629,14 +694,24 @@ File '/home/src/projects/project/node_modules/foo2/package.json' exists accordin File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists according to earlier cached lookups. File '/lib/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +home/src/projects/project/index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. + +1 import { foo } from "foo"; +   ~~~~~ + +home/src/projects/project/index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/bar` if it exists or add a new declaration (.d.ts) file containing `declare module 'bar';` + +2 import { bar } from "bar"; +   ~~~~~ -Found 1 error. +Found 2 errors in the same file, starting at: home/src/projects/project/index.mts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: Not Program files:: /lib/lib.d.ts @@ -644,7 +719,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -852,14 +927,24 @@ File '/home/src/projects/project/node_modules/foo2/package.json' exists accordin File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists according to earlier cached lookups. File '/lib/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +home/src/projects/project/index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/foo` if it exists or add a new declaration (.d.ts) file containing `declare module 'foo';` + +1 import { foo } from "foo"; +   ~~~~~ + +home/src/projects/project/index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/bar` if it exists or add a new declaration (.d.ts) file containing `declare module 'bar';` + +2 import { bar } from "bar"; +   ~~~~~ -Found 1 error. +Found 2 errors in the same file, starting at: home/src/projects/project/index.mts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: Not Program files:: /lib/lib.d.ts @@ -867,7 +952,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -1064,14 +1149,24 @@ File '/home/src/projects/project/node_modules/foo2/package.json' exists accordin File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists according to earlier cached lookups. File '/lib/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +home/src/projects/project/index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/foo` if it exists or add a new declaration (.d.ts) file containing `declare module 'foo';` + +1 import { foo } from "foo"; +   ~~~~~ + +home/src/projects/project/index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. + +2 import { bar } from "bar"; +   ~~~~~ -Found 1 error. +Found 2 errors in the same file, starting at: home/src/projects/project/index.mts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: Not Program files:: /lib/lib.d.ts @@ -1079,7 +1174,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -1263,14 +1358,24 @@ File '/home/src/projects/project/node_modules/foo2/package.json' exists accordin File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists according to earlier cached lookups. File '/lib/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +home/src/projects/project/index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. + +1 import { foo } from "foo"; +   ~~~~~ + +home/src/projects/project/index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. + +2 import { bar } from "bar"; +   ~~~~~ -Found 1 error. +Found 2 errors in the same file, starting at: home/src/projects/project/index.mts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: Not Program files:: /lib/lib.d.ts @@ -1278,7 +1383,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -1434,14 +1539,18 @@ File '/home/src/projects/project/node_modules/foo2/package.json' exists accordin File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists according to earlier cached lookups. File '/lib/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +home/src/projects/project/index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. + +1 import { foo } from "foo"; +   ~~~~~ -Found 1 error. +Found 1 error in home/src/projects/project/index.mts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: Not Program files:: /lib/lib.d.ts @@ -1450,7 +1559,9 @@ Program files:: /home/src/projects/project/node_modules/@types/bar2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/node_modules/@types/bar/index.d.ts +/home/src/projects/project/index.mts Shape signatures in builder refreshed for:: /home/src/projects/project/node_modules/@types/bar/index.d.ts (used version) @@ -1459,7 +1570,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/index.mjs] file written with same contents //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../lib/lib.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"fileInfos":[{"version":"3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedFormat":1},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-7439170493-export declare const bar2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[5],"options":{"strict":true},"fileIdsList":[[2,3,4]],"referencedMap":[[5,1]],"exportedModulesMap":[]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../lib/lib.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"fileInfos":[{"version":"3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedFormat":1},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-7439170493-export declare const bar2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[5],"options":{"module":100,"strict":true,"target":1},"fileIdsList":[[2,3,4]],"referencedMap":[[5,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[[5,[{"file":"./index.mts","start":20,"length":5,"code":7016,"category":1,"messageText":{"messageText":"Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.","category":1,"code":7016,"next":[{"info":{"moduleReference":"foo","mode":99}}]}}]],2,4,3,1]},"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1535,7 +1646,9 @@ Shape signatures in builder refreshed for:: ] ], "options": { - "strict": true + "module": 100, + "strict": true, + "target": 1 }, "referencedMap": { "./index.mts": [ @@ -1544,10 +1657,41 @@ Shape signatures in builder refreshed for:: "./node_modules/@types/bar2/index.d.ts" ] }, - "exportedModulesMap": {} + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + [ + "./index.mts", + [ + { + "file": "./index.mts", + "start": 20, + "length": 5, + "code": 7016, + "category": 1, + "messageText": { + "messageText": "Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.", + "category": 1, + "code": 7016, + "next": [ + { + "info": { + "moduleReference": "foo", + "mode": 99 + } + } + ] + } + } + ] + ], + "./node_modules/@types/bar/index.d.ts", + "./node_modules/@types/bar2/index.d.ts", + "./node_modules/foo2/index.d.ts", + "../../../../lib/lib.d.ts" + ] }, "version": "FakeTSVersion", - "size": 1271 + "size": 1659 } @@ -1675,14 +1819,9 @@ File '/home/src/projects/project/node_modules/foo2/package.json' exists accordin File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists according to earlier cached lookups. File '/lib/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. - - -Found 1 error. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +exitCode:: ExitStatus.Success Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: Not Program files:: /lib/lib.d.ts @@ -1692,7 +1831,9 @@ Program files:: /home/src/projects/project/node_modules/@types/bar2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/node_modules/foo/index.d.ts +/home/src/projects/project/index.mts Shape signatures in builder refreshed for:: /home/src/projects/project/node_modules/foo/index.d.ts (used version) @@ -1701,7 +1842,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/index.mjs] file written with same contents //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../lib/lib.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"fileInfos":[{"version":"3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedFormat":1},{"version":"-5214938848-export declare const foo: number;","impliedFormat":1},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-7439170493-export declare const bar2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[6],"options":{"strict":true},"fileIdsList":[[2,3,4,5]],"referencedMap":[[6,1]],"exportedModulesMap":[]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../lib/lib.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"fileInfos":[{"version":"3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedFormat":1},{"version":"-5214938848-export declare const foo: number;","impliedFormat":1},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-7439170493-export declare const bar2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[6],"options":{"module":100,"strict":true,"target":1},"fileIdsList":[[2,3,4,5]],"referencedMap":[[6,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[6,3,5,2,4,1]},"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1788,7 +1929,9 @@ Shape signatures in builder refreshed for:: ] ], "options": { - "strict": true + "module": 100, + "strict": true, + "target": 1 }, "referencedMap": { "./index.mts": [ @@ -1798,10 +1941,18 @@ Shape signatures in builder refreshed for:: "./node_modules/@types/bar2/index.d.ts" ] }, - "exportedModulesMap": {} + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "./index.mts", + "./node_modules/@types/bar/index.d.ts", + "./node_modules/@types/bar2/index.d.ts", + "./node_modules/foo/index.d.ts", + "./node_modules/foo2/index.d.ts", + "../../../../lib/lib.d.ts" + ] }, "version": "FakeTSVersion", - "size": 1383 + "size": 1450 } @@ -1964,14 +2115,18 @@ File '/home/src/projects/project/node_modules/@types/bar/package.json' exists ac File '/home/src/projects/project/node_modules/foo2/package.json' exists according to earlier cached lookups. File '/lib/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +home/src/projects/project/index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + +4 import { bar2 } from "bar2"; +   ~~~~~~ -Found 1 error. +Found 1 error in home/src/projects/project/index.mts:4 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: Not Program files:: /lib/lib.d.ts @@ -1980,7 +2135,8 @@ Program files:: /home/src/projects/project/node_modules/foo2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/index.mts Shape signatures in builder refreshed for:: /home/src/projects/project/index.mts (computed .d.ts) @@ -1988,7 +2144,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/index.mjs] file written with same contents //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../lib/lib.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./index.mts"],"fileInfos":[{"version":"3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedFormat":1},{"version":"-5214938848-export declare const foo: number;","impliedFormat":1},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[5],"options":{"strict":true},"fileIdsList":[[2,3,4]],"referencedMap":[[5,1]],"exportedModulesMap":[]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../lib/lib.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./index.mts"],"fileInfos":[{"version":"3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedFormat":1},{"version":"-5214938848-export declare const foo: number;","impliedFormat":1},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[5],"options":{"module":100,"strict":true,"target":1},"fileIdsList":[[2,3,4]],"referencedMap":[[5,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[[5,[{"file":"./index.mts","start":104,"length":6,"code":7016,"category":1,"messageText":{"messageText":"Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.","category":1,"code":7016,"next":[{"info":{"moduleReference":"bar2","mode":99}}]}}]],3,2,4,1]},"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -2064,7 +2220,9 @@ Shape signatures in builder refreshed for:: ] ], "options": { - "strict": true + "module": 100, + "strict": true, + "target": 1 }, "referencedMap": { "./index.mts": [ @@ -2073,10 +2231,41 @@ Shape signatures in builder refreshed for:: "./node_modules/foo2/index.d.ts" ] }, - "exportedModulesMap": {} + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + [ + "./index.mts", + [ + { + "file": "./index.mts", + "start": 104, + "length": 6, + "code": 7016, + "category": 1, + "messageText": { + "messageText": "Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.", + "category": 1, + "code": 7016, + "next": [ + { + "info": { + "moduleReference": "bar2", + "mode": 99 + } + } + ] + } + } + ] + ], + "./node_modules/@types/bar/index.d.ts", + "./node_modules/foo/index.d.ts", + "./node_modules/foo2/index.d.ts", + "../../../../lib/lib.d.ts" + ] }, "version": "FakeTSVersion", - "size": 1262 + "size": 1654 } @@ -2269,14 +2458,24 @@ File '/home/src/projects/project/node_modules/foo/package.json' exists according File '/home/src/projects/project/node_modules/@types/bar/package.json' exists according to earlier cached lookups. File '/lib/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +home/src/projects/project/index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo2' library may need to update its package.json or typings. + +3 import { foo2 } from "foo2"; +   ~~~~~~ + +home/src/projects/project/index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + +4 import { bar2 } from "bar2"; +   ~~~~~~ -Found 1 error. +Found 2 errors in the same file, starting at: home/src/projects/project/index.mts:3 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: Not Program files:: /lib/lib.d.ts @@ -2284,7 +2483,8 @@ Program files:: /home/src/projects/project/node_modules/@types/bar/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/index.mts Shape signatures in builder refreshed for:: /home/src/projects/project/index.mts (computed .d.ts) @@ -2292,7 +2492,7 @@ Shape signatures in builder refreshed for:: //// [/home/src/projects/project/index.mjs] file written with same contents //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../lib/lib.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./index.mts"],"fileInfos":[{"version":"3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedFormat":1},{"version":"-5214938848-export declare const foo: number;","impliedFormat":1},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[4],"options":{"strict":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../lib/lib.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./index.mts"],"fileInfos":[{"version":"3858781397-/// \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; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedFormat":1},{"version":"-5214938848-export declare const foo: number;","impliedFormat":1},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[4],"options":{"module":100,"strict":true,"target":1},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[[4,[{"file":"./index.mts","start":75,"length":6,"code":7016,"category":1,"messageText":{"messageText":"Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type.","category":1,"code":7016,"next":[{"info":{"moduleReference":"foo2","mode":99}}]}},{"file":"./index.mts","start":104,"length":6,"code":7016,"category":1,"messageText":{"messageText":"Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.","category":1,"code":7016,"next":[{"info":{"moduleReference":"bar2","mode":99}}]}}]],3,2,1]},"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -2357,7 +2557,9 @@ Shape signatures in builder refreshed for:: ] ], "options": { - "strict": true + "module": 100, + "strict": true, + "target": 1 }, "referencedMap": { "./index.mts": [ @@ -2365,10 +2567,60 @@ Shape signatures in builder refreshed for:: "./node_modules/@types/bar/index.d.ts" ] }, - "exportedModulesMap": {} + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + [ + "./index.mts", + [ + { + "file": "./index.mts", + "start": 75, + "length": 6, + "code": 7016, + "category": 1, + "messageText": { + "messageText": "Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type.", + "category": 1, + "code": 7016, + "next": [ + { + "info": { + "moduleReference": "foo2", + "mode": 99 + } + } + ] + } + }, + { + "file": "./index.mts", + "start": 104, + "length": 6, + "code": 7016, + "category": 1, + "messageText": { + "messageText": "Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.", + "category": 1, + "code": 7016, + "next": [ + { + "info": { + "moduleReference": "bar2", + "mode": 99 + } + } + ] + } + } + ] + ], + "./node_modules/@types/bar/index.d.ts", + "./node_modules/foo/index.d.ts", + "../../../../lib/lib.d.ts" + ] }, "version": "FakeTSVersion", - "size": 1148 + "size": 1860 } @@ -2561,14 +2813,24 @@ File '/home/src/projects/project/node_modules/foo/package.json' exists according File '/home/src/projects/project/node_modules/@types/bar/package.json' exists according to earlier cached lookups. File '/lib/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +home/src/projects/project/index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo2' library may need to update its package.json or typings. + +3 import { foo2 } from "foo2"; +   ~~~~~~ + +home/src/projects/project/index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/bar2` if it exists or add a new declaration (.d.ts) file containing `declare module 'bar2';` + +4 import { bar2 } from "bar2"; +   ~~~~~~ -Found 1 error. +Found 2 errors in the same file, starting at: home/src/projects/project/index.mts:3 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: Not Program files:: /lib/lib.d.ts @@ -2576,7 +2838,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -2784,14 +3046,24 @@ File '/home/src/projects/project/node_modules/foo/package.json' exists according File '/home/src/projects/project/node_modules/@types/bar/package.json' exists according to earlier cached lookups. File '/lib/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +home/src/projects/project/index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/foo2` if it exists or add a new declaration (.d.ts) file containing `declare module 'foo2';` + +3 import { foo2 } from "foo2"; +   ~~~~~~ + +home/src/projects/project/index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/bar2` if it exists or add a new declaration (.d.ts) file containing `declare module 'bar2';` + +4 import { bar2 } from "bar2"; +   ~~~~~~ -Found 1 error. +Found 2 errors in the same file, starting at: home/src/projects/project/index.mts:3 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: Not Program files:: /lib/lib.d.ts @@ -2799,7 +3071,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -2996,14 +3268,24 @@ File '/home/src/projects/project/node_modules/foo/package.json' exists according File '/home/src/projects/project/node_modules/@types/bar/package.json' exists according to earlier cached lookups. File '/lib/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +home/src/projects/project/index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/foo2` if it exists or add a new declaration (.d.ts) file containing `declare module 'foo2';` + +3 import { foo2 } from "foo2"; +   ~~~~~~ + +home/src/projects/project/index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + +4 import { bar2 } from "bar2"; +   ~~~~~~ -Found 1 error. +Found 2 errors in the same file, starting at: home/src/projects/project/index.mts:3 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: Not Program files:: /lib/lib.d.ts @@ -3011,7 +3293,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -3195,14 +3477,24 @@ File '/home/src/projects/project/node_modules/foo/package.json' exists according File '/home/src/projects/project/node_modules/@types/bar/package.json' exists according to earlier cached lookups. File '/lib/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +home/src/projects/project/index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo2' library may need to update its package.json or typings. + +3 import { foo2 } from "foo2"; +   ~~~~~~ + +home/src/projects/project/index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + +4 import { bar2 } from "bar2"; +   ~~~~~~ -Found 1 error. +Found 2 errors in the same file, starting at: home/src/projects/project/index.mts:3 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"project":"/home/src/projects/project","configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: Not Program files:: /lib/lib.d.ts @@ -3210,7 +3502,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/with-nodeNext-resolution.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/with-nodeNext-resolution.js index 4f912ea478d..5ce4e93b9bb 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/with-nodeNext-resolution.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/with-nodeNext-resolution.js @@ -13,7 +13,7 @@ export function foo(): void; {"name":"yargs","version":"17.0.12","exports":{".":{"types":{"import":"./index.d.mts","default":"./index.d.ts"}}}} //// [/Users/name/projects/web/tsconfig.json] -{"compilerOptions":{"moduleResolution":"nodenext","forceConsistentCasingInFileNames":true,"traceResolution":true}} +{"compilerOptions":{"target":"es5","module":"nodenext","moduleResolution":"nodenext","forceConsistentCasingInFileNames":true,"traceResolution":true}} //// [/a/lib/lib.d.ts] /// @@ -83,8 +83,6 @@ Resolving real path for '/Users/name/projects/web/node_modules/@types/yargs/inde File '/a/lib/package.json' does not exist. File '/a/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. - ../../../../a/lib/lib.d.ts Default library for target 'es5' node_modules/@types/yargs/index.d.ts @@ -94,19 +92,22 @@ node_modules/@types/yargs/index.d.ts src/bin.ts Matched by default include pattern '**/*' File is CommonJS module because 'package.json' was not found -[12:00:38 AM] Found 1 error. Watching for file changes. +[12:00:38 AM] Found 0 errors. Watching for file changes. Program root files: ["/Users/name/projects/web/src/bin.ts"] -Program options: {"moduleResolution":99,"forceConsistentCasingInFileNames":true,"traceResolution":true,"watch":true,"explainFiles":true,"configFilePath":"/Users/name/projects/web/tsconfig.json"} +Program options: {"target":1,"module":199,"moduleResolution":99,"forceConsistentCasingInFileNames":true,"traceResolution":true,"watch":true,"explainFiles":true,"configFilePath":"/Users/name/projects/web/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts /Users/name/projects/web/node_modules/@types/yargs/index.d.ts /Users/name/projects/web/src/bin.ts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/Users/name/projects/web/node_modules/@types/yargs/index.d.ts +/Users/name/projects/web/src/bin.ts Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) diff --git a/tests/baselines/reference/tscWatch/moduleResolution/diagnostics-from-cache.js b/tests/baselines/reference/tscWatch/moduleResolution/diagnostics-from-cache.js index 33407bef218..36cca1f87df 100644 --- a/tests/baselines/reference/tscWatch/moduleResolution/diagnostics-from-cache.js +++ b/tests/baselines/reference/tscWatch/moduleResolution/diagnostics-from-cache.js @@ -1,7 +1,7 @@ currentDirectory:: /user/username/projects/myproject useCaseSensitiveFileNames: false Input:: //// [/user/username/projects/myproject/tsconfig.json] -{"compilerOptions":{"moduleResolution":"nodenext","outDir":"./dist","declaration":true,"declarationDir":"./types"}} +{"compilerOptions":{"target":"es5","module":"nodenext","moduleResolution":"nodenext","outDir":"./dist","declaration":true,"declarationDir":"./types"}} //// [/user/username/projects/myproject/package.json] {"name":"@this/package","type":"module","exports":{".":{"default":"./dist/index.js","types":"./types/index.d.ts"}}} @@ -54,14 +54,12 @@ File '/a/package.json' does not exist. File '/package.json' does not exist. error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file '/user/username/projects/myproject/package.json'. Supply the `rootDir` compiler option to disambiguate. -error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. - -[12:00:40 AM] Found 2 errors. Watching for file changes. +[12:00:40 AM] Found 1 error. Watching for file changes. Program root files: ["/user/username/projects/myproject/index.ts","/user/username/projects/myproject/index2.ts"] -Program options: {"moduleResolution":99,"outDir":"/user/username/projects/myproject/dist","declaration":true,"declarationDir":"/user/username/projects/myproject/types","watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"target":1,"module":199,"moduleResolution":99,"outDir":"/user/username/projects/myproject/dist","declaration":true,"declarationDir":"/user/username/projects/myproject/types","watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -100,13 +98,9 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/dist/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.thing = void 0; -var me = require("@this/package"); +import * as me from "@this/package"; me.thing(); -function thing() { } -exports.thing = thing; +export function thing() { } //// [/user/username/projects/myproject/types/index.d.ts] @@ -114,11 +108,7 @@ export declare function thing(): void; //// [/user/username/projects/myproject/dist/index2.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.thing = void 0; -function thing() { } -exports.thing = thing; +export function thing() { } //// [/user/username/projects/myproject/types/index2.d.ts] @@ -161,14 +151,12 @@ File '/a/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file '/user/username/projects/myproject/package.json'. Supply the `rootDir` compiler option to disambiguate. -error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. - -[12:00:50 AM] Found 2 errors. Watching for file changes. +[12:00:50 AM] Found 1 error. Watching for file changes. Program root files: ["/user/username/projects/myproject/index.ts","/user/username/projects/myproject/index2.ts"] -Program options: {"moduleResolution":99,"outDir":"/user/username/projects/myproject/dist","declaration":true,"declarationDir":"/user/username/projects/myproject/types","watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"target":1,"module":199,"moduleResolution":99,"outDir":"/user/username/projects/myproject/dist","declaration":true,"declarationDir":"/user/username/projects/myproject/types","watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: SafeModules Program files:: /a/lib/lib.d.ts diff --git a/tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-file-are-partially-used.js b/tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-file-are-partially-used.js index d74aab3dd6d..21d1e49bfe3 100644 --- a/tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-file-are-partially-used.js +++ b/tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-file-are-partially-used.js @@ -1,7 +1,7 @@ currentDirectory:: /user/username/projects/myproject useCaseSensitiveFileNames: false Input:: //// [/user/username/projects/myproject/tsconfig.json] -{"compilerOptions":{"moduleResolution":"node16"}} +{"compilerOptions":{"module":"node16","moduleResolution":"node16"}} //// [/user/username/projects/myproject/index.ts] import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; @@ -131,17 +131,34 @@ File '/user/username/projects/myproject/node_modules/pkg/package.json' exists ac File '/a/lib/package.json' does not exist. File '/a/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +error TS2318: Cannot find global type 'Array'. -[12:00:44 AM] Found 1 error. Watching for file changes. +error TS2318: Cannot find global type 'Boolean'. + +error TS2318: Cannot find global type 'Function'. + +error TS2318: Cannot find global type 'IArguments'. + +error TS2318: Cannot find global type 'Number'. + +error TS2318: Cannot find global type 'Object'. + +error TS2318: Cannot find global type 'RegExp'. + +error TS2318: Cannot find global type 'String'. + +error TS6053: File '/a/lib/lib.es2022.full.d.ts' not found. + The file is in the program because: + Default library for target 'es2022' + +[12:00:44 AM] Found 9 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/index.ts"] -Program options: {"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"module":100,"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: -/a/lib/lib.d.ts /user/username/projects/myproject/a.ts /user/username/projects/myproject/node_modules/pkg/import.d.ts /user/username/projects/myproject/index.ts @@ -149,12 +166,13 @@ Program files:: No cached semantic diagnostics in the builder:: Shape signatures in builder refreshed for:: -/a/lib/lib.d.ts (used version) /user/username/projects/myproject/a.ts (used version) -/user/username/projects/myproject/node_modules/pkg/import.d.ts (used version) /user/username/projects/myproject/index.ts (used version) +/user/username/projects/myproject/node_modules/pkg/import.d.ts (used version) PolledWatches:: +/a/lib/lib.es2022.full.d.ts: *new* + {"pollingInterval":500} /user/username/projects/myproject/node_modules/@types: *new* {"pollingInterval":500} /user/username/projects/myproject/package.json: *new* @@ -167,8 +185,6 @@ PolledWatches:: {"pollingInterval":2000} FsWatches:: -/a/lib/lib.d.ts: *new* - {} /user/username/projects: *new* {} /user/username/projects/myproject: *new* @@ -222,9 +238,6 @@ Output:: >> Screen clear [12:00:47 AM] File change detected. Starting incremental compilation... -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. File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. File '/user/username/projects/package.json' does not exist according to earlier cached lookups. File '/user/username/package.json' does not exist according to earlier cached lookups. @@ -275,17 +288,34 @@ Reusing resolution of module 'pkg1' from '/user/username/projects/myproject/inde 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. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +error TS2318: Cannot find global type 'Array'. -[12:00:54 AM] Found 1 error. Watching for file changes. +error TS2318: Cannot find global type 'Boolean'. + +error TS2318: Cannot find global type 'Function'. + +error TS2318: Cannot find global type 'IArguments'. + +error TS2318: Cannot find global type 'Number'. + +error TS2318: Cannot find global type 'Object'. + +error TS2318: Cannot find global type 'RegExp'. + +error TS2318: Cannot find global type 'String'. + +error TS6053: File '/a/lib/lib.es2022.full.d.ts' not found. + The file is in the program because: + Default library for target 'es2022' + +[12:00:54 AM] Found 9 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/index.ts"] -Program options: {"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"module":100,"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: SafeModules Program files:: -/a/lib/lib.d.ts /user/username/projects/myproject/node_modules/pkg/import.d.ts /user/username/projects/myproject/a.ts /user/username/projects/myproject/index.ts diff --git a/tests/baselines/reference/tscWatch/moduleResolution/node10Result.js b/tests/baselines/reference/tscWatch/moduleResolution/node10Result.js index 648ac07f65d..a6738fd67ea 100644 --- a/tests/baselines/reference/tscWatch/moduleResolution/node10Result.js +++ b/tests/baselines/reference/tscWatch/moduleResolution/node10Result.js @@ -124,7 +124,7 @@ import { bar2 } from "bar2"; //// [/home/src/projects/project/tsconfig.json] -{"compilerOptions":{"moduleResolution":"node16","traceResolution":true,"incremental":true,"strict":true,"types":[]},"files":["index.mts"]} +{"compilerOptions":{"target":"es5","module":"node16","moduleResolution":"node16","traceResolution":true,"incremental":true,"strict":true,"types":[]},"files":["index.mts"]} //// [/a/lib/lib.d.ts] /// @@ -149,7 +149,7 @@ FileWatcher:: Added:: WatchInfo: /home/src/projects/project/tsconfig.json 2000 u Synchronizing program CreatingProgramWith:: roots: ["/home/src/projects/project/index.mts"] - options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} + options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} FileWatcher:: Added:: WatchInfo: /home/src/projects/project/index.mts 250 undefined Source file ======== Resolving module 'foo' from '/home/src/projects/project/index.mts'. ======== Explicitly specified module resolution kind: 'Node16'. @@ -343,9 +343,19 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/index DirectoryWatcher:: Triggered with /home/src/projects/project/tsconfig.tsbuildinfo :: WatchInfo: /home/src/projects/project 0 undefined Failed Lookup Locations Scheduling invalidateFailedLookup, Cancelled earlier one Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/tsconfig.tsbuildinfo :: WatchInfo: /home/src/projects/project 0 undefined Failed Lookup Locations -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. -[12:01:18 AM] Found 1 error. Watching for file changes. +1 import { foo } from "foo"; +   ~~~~~ + +index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. + +2 import { bar } from "bar"; +   ~~~~~ + +[12:01:18 AM] Found 2 errors. Watching for file changes. DirectoryWatcher:: Triggered with /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt :: WatchInfo: /home/src/projects/project 0 undefined Failed Lookup Locations Scheduling invalidateFailedLookup, Cancelled earlier one @@ -353,7 +363,7 @@ Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/tscon Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: Not Program files:: /a/lib/lib.d.ts @@ -361,7 +371,11 @@ Program files:: /home/src/projects/project/node_modules/@types/bar2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/node_modules/foo2/index.d.ts +/home/src/projects/project/node_modules/@types/bar2/index.d.ts +/home/src/projects/project/index.mts Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) @@ -408,12 +422,11 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/home/src/projects/project/index.mjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +export {}; //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"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},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-7439170493-export declare const bar2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","impliedFormat":99}],"root":[4],"options":{"strict":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"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},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-7439170493-export declare const bar2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","impliedFormat":99}],"root":[4],"options":{"module":100,"strict":true,"target":1},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./index.mts","start":20,"length":5,"code":7016,"category":1,"messageText":{"messageText":"Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.","category":1,"code":7016,"next":[{"info":{"moduleReference":"foo","mode":99}}]}},{"file":"./index.mts","start":47,"length":5,"code":7016,"category":1,"messageText":{"messageText":"Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type.","category":1,"code":7016,"next":[{"info":{"moduleReference":"bar","mode":99}}]}}]],3,2]},"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -477,7 +490,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); ] ], "options": { - "strict": true + "module": 100, + "strict": true, + "target": 1 }, "referencedMap": { "./index.mts": [ @@ -490,10 +505,60 @@ Object.defineProperty(exports, "__esModule", { value: true }); "./node_modules/foo2/index.d.ts", "./node_modules/@types/bar2/index.d.ts" ] - } + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + [ + "./index.mts", + [ + { + "file": "./index.mts", + "start": 20, + "length": 5, + "code": 7016, + "category": 1, + "messageText": { + "messageText": "Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.", + "category": 1, + "code": 7016, + "next": [ + { + "info": { + "moduleReference": "foo", + "mode": 99 + } + } + ] + } + }, + { + "file": "./index.mts", + "start": 47, + "length": 5, + "code": 7016, + "category": 1, + "messageText": { + "messageText": "Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type.", + "category": 1, + "code": 7016, + "next": [ + { + "info": { + "moduleReference": "bar", + "mode": 99 + } + } + ] + } + } + ] + ], + "./node_modules/@types/bar2/index.d.ts", + "./node_modules/foo2/index.d.ts" + ] }, "version": "FakeTSVersion", - "size": 1040 + "size": 1745 } @@ -519,7 +584,7 @@ Synchronizing program CreatingProgramWith:: roots: ["/home/src/projects/project/index.mts"] - options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} + options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} 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. @@ -613,14 +678,24 @@ File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists a 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. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. -[12:01:23 AM] Found 1 error. Watching for file changes. +1 import { foo } from "foo"; +   ~~~~~ + +index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/bar` if it exists or add a new declaration (.d.ts) file containing `declare module 'bar';` + +2 import { bar } from "bar"; +   ~~~~~ + +[12:01:23 AM] Found 2 errors. Watching for file changes. Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: SafeModules Program files:: /a/lib/lib.d.ts @@ -628,7 +703,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -657,7 +732,7 @@ Synchronizing program CreatingProgramWith:: roots: ["/home/src/projects/project/index.mts"] - options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} + options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} 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. @@ -732,14 +807,24 @@ File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists a 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. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/foo` if it exists or add a new declaration (.d.ts) file containing `declare module 'foo';` -[12:01:27 AM] Found 1 error. Watching for file changes. +1 import { foo } from "foo"; +   ~~~~~ + +index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/bar` if it exists or add a new declaration (.d.ts) file containing `declare module 'bar';` + +2 import { bar } from "bar"; +   ~~~~~ + +[12:01:27 AM] Found 2 errors. Watching for file changes. Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: SafeModules Program files:: /a/lib/lib.d.ts @@ -747,7 +832,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -778,7 +863,7 @@ Synchronizing program CreatingProgramWith:: roots: ["/home/src/projects/project/index.mts"] - options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} + options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} 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. @@ -859,14 +944,24 @@ File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists a 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. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/foo` if it exists or add a new declaration (.d.ts) file containing `declare module 'foo';` -[12:01:31 AM] Found 1 error. Watching for file changes. +1 import { foo } from "foo"; +   ~~~~~ + +index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. + +2 import { bar } from "bar"; +   ~~~~~ + +[12:01:31 AM] Found 2 errors. Watching for file changes. Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: SafeModules Program files:: /a/lib/lib.d.ts @@ -874,7 +969,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -905,7 +1000,7 @@ Synchronizing program CreatingProgramWith:: roots: ["/home/src/projects/project/index.mts"] - options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} + options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} 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. @@ -967,14 +1062,24 @@ File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists a 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. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. -[12:01:36 AM] Found 1 error. Watching for file changes. +1 import { foo } from "foo"; +   ~~~~~ + +index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. + +2 import { bar } from "bar"; +   ~~~~~ + +[12:01:36 AM] Found 2 errors. Watching for file changes. Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: SafeModules Program files:: /a/lib/lib.d.ts @@ -982,7 +1087,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -1023,7 +1128,7 @@ Synchronizing program CreatingProgramWith:: roots: ["/home/src/projects/project/index.mts"] - options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} + options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} 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. @@ -1068,14 +1173,18 @@ File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists a 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. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. + +1 import { foo } from "foo"; +   ~~~~~ [12:01:47 AM] Found 1 error. Watching for file changes. Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: SafeModules Program files:: /a/lib/lib.d.ts @@ -1084,7 +1193,9 @@ Program files:: /home/src/projects/project/node_modules/@types/bar2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/node_modules/@types/bar/index.d.ts +/home/src/projects/project/index.mts Shape signatures in builder refreshed for:: /home/src/projects/project/node_modules/@types/bar/index.d.ts (used version) @@ -1132,7 +1243,7 @@ exitCode:: ExitStatus.undefined //// [/home/src/projects/project/index.mjs] file written with same contents //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"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},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-7439170493-export declare const bar2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[5],"options":{"strict":true},"fileIdsList":[[2,3,4]],"referencedMap":[[5,1]],"exportedModulesMap":[]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"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},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-7439170493-export declare const bar2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[5],"options":{"module":100,"strict":true,"target":1},"fileIdsList":[[2,3,4]],"referencedMap":[[5,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,[5,[{"file":"./index.mts","start":20,"length":5,"code":7016,"category":1,"messageText":{"messageText":"Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.","category":1,"code":7016,"next":[{"info":{"moduleReference":"foo","mode":99}}]}}]],2,4,3]},"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1208,7 +1319,9 @@ exitCode:: ExitStatus.undefined ] ], "options": { - "strict": true + "module": 100, + "strict": true, + "target": 1 }, "referencedMap": { "./index.mts": [ @@ -1217,10 +1330,41 @@ exitCode:: ExitStatus.undefined "./node_modules/@types/bar2/index.d.ts" ] }, - "exportedModulesMap": {} + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + [ + "./index.mts", + [ + { + "file": "./index.mts", + "start": 20, + "length": 5, + "code": 7016, + "category": 1, + "messageText": { + "messageText": "Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.", + "category": 1, + "code": 7016, + "next": [ + { + "info": { + "moduleReference": "foo", + "mode": 99 + } + } + ] + } + } + ] + ], + "./node_modules/@types/bar/index.d.ts", + "./node_modules/@types/bar2/index.d.ts", + "./node_modules/foo2/index.d.ts" + ] }, "version": "FakeTSVersion", - "size": 1193 + "size": 1581 } @@ -1260,7 +1404,7 @@ Synchronizing program CreatingProgramWith:: roots: ["/home/src/projects/project/index.mts"] - options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} + options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} 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. @@ -1299,14 +1443,12 @@ File '/a/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. DirectoryWatcher:: Close:: WatchInfo: /home/src/projects/node_modules 1 undefined Failed Lookup Locations Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /home/src/projects/node_modules 1 undefined Failed Lookup Locations -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. - -[12:02:02 AM] Found 1 error. Watching for file changes. +[12:02:02 AM] Found 0 errors. Watching for file changes. Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: SafeModules Program files:: /a/lib/lib.d.ts @@ -1316,7 +1458,9 @@ Program files:: /home/src/projects/project/node_modules/@types/bar2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/node_modules/foo/index.d.ts +/home/src/projects/project/index.mts Shape signatures in builder refreshed for:: /home/src/projects/project/node_modules/foo/index.d.ts (used version) @@ -1366,7 +1510,7 @@ exitCode:: ExitStatus.undefined //// [/home/src/projects/project/index.mjs] file written with same contents //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"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},{"version":"-5214938848-export declare const foo: number;","impliedFormat":1},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-7439170493-export declare const bar2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[6],"options":{"strict":true},"fileIdsList":[[2,3,4,5]],"referencedMap":[[6,1]],"exportedModulesMap":[]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"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},{"version":"-5214938848-export declare const foo: number;","impliedFormat":1},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-7439170493-export declare const bar2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[6],"options":{"module":100,"strict":true,"target":1},"fileIdsList":[[2,3,4,5]],"referencedMap":[[6,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,6,3,5,2,4]},"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1453,7 +1597,9 @@ exitCode:: ExitStatus.undefined ] ], "options": { - "strict": true + "module": 100, + "strict": true, + "target": 1 }, "referencedMap": { "./index.mts": [ @@ -1463,10 +1609,18 @@ exitCode:: ExitStatus.undefined "./node_modules/@types/bar2/index.d.ts" ] }, - "exportedModulesMap": {} + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./index.mts", + "./node_modules/@types/bar/index.d.ts", + "./node_modules/@types/bar2/index.d.ts", + "./node_modules/foo/index.d.ts", + "./node_modules/foo2/index.d.ts" + ] }, "version": "FakeTSVersion", - "size": 1305 + "size": 1372 } @@ -1503,7 +1657,7 @@ Synchronizing program CreatingProgramWith:: roots: ["/home/src/projects/project/index.mts"] - options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} + options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} 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. @@ -1591,14 +1745,18 @@ File '/package.json' does not exist according to earlier cached lookups. FileWatcher:: Close:: WatchInfo: /home/src/projects/project/node_modules/@types/bar2/index.d.ts 250 undefined Source file DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/node_modules 1 undefined Failed Lookup Locations Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/node_modules 1 undefined Failed Lookup Locations -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + +4 import { bar2 } from "bar2"; +   ~~~~~~ [12:02:16 AM] Found 1 error. Watching for file changes. Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: SafeModules Program files:: /a/lib/lib.d.ts @@ -1607,7 +1765,8 @@ Program files:: /home/src/projects/project/node_modules/foo2/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/index.mts Shape signatures in builder refreshed for:: /home/src/projects/project/index.mts (computed .d.ts) @@ -1658,7 +1817,7 @@ exitCode:: ExitStatus.undefined //// [/home/src/projects/project/index.mjs] file written with same contents //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./index.mts"],"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},{"version":"-5214938848-export declare const foo: number;","impliedFormat":1},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[5],"options":{"strict":true},"fileIdsList":[[2,3,4]],"referencedMap":[[5,1]],"exportedModulesMap":[]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./index.mts"],"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},{"version":"-5214938848-export declare const foo: number;","impliedFormat":1},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-1622383150-export declare const foo2: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[5],"options":{"module":100,"strict":true,"target":1},"fileIdsList":[[2,3,4]],"referencedMap":[[5,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,[5,[{"file":"./index.mts","start":104,"length":6,"code":7016,"category":1,"messageText":{"messageText":"Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.","category":1,"code":7016,"next":[{"info":{"moduleReference":"bar2","mode":99}}]}}]],3,2,4]},"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1734,7 +1893,9 @@ exitCode:: ExitStatus.undefined ] ], "options": { - "strict": true + "module": 100, + "strict": true, + "target": 1 }, "referencedMap": { "./index.mts": [ @@ -1743,10 +1904,41 @@ exitCode:: ExitStatus.undefined "./node_modules/foo2/index.d.ts" ] }, - "exportedModulesMap": {} + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + [ + "./index.mts", + [ + { + "file": "./index.mts", + "start": 104, + "length": 6, + "code": 7016, + "category": 1, + "messageText": { + "messageText": "Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.", + "category": 1, + "code": 7016, + "next": [ + { + "info": { + "moduleReference": "bar2", + "mode": 99 + } + } + ] + } + } + ] + ], + "./node_modules/@types/bar/index.d.ts", + "./node_modules/foo/index.d.ts", + "./node_modules/foo2/index.d.ts" + ] }, "version": "FakeTSVersion", - "size": 1184 + "size": 1576 } @@ -1785,7 +1977,7 @@ Synchronizing program CreatingProgramWith:: roots: ["/home/src/projects/project/index.mts"] - options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} + options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} 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. @@ -1849,14 +2041,24 @@ 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. FileWatcher:: Close:: WatchInfo: /home/src/projects/project/node_modules/foo2/index.d.ts 250 undefined Source file -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo2' library may need to update its package.json or typings. -[12:02:31 AM] Found 1 error. Watching for file changes. +3 import { foo2 } from "foo2"; +   ~~~~~~ + +index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + +4 import { bar2 } from "bar2"; +   ~~~~~~ + +[12:02:31 AM] Found 2 errors. Watching for file changes. Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: SafeModules Program files:: /a/lib/lib.d.ts @@ -1864,7 +2066,8 @@ Program files:: /home/src/projects/project/node_modules/@types/bar/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/index.mts Shape signatures in builder refreshed for:: /home/src/projects/project/index.mts (computed .d.ts) @@ -1913,7 +2116,7 @@ exitCode:: ExitStatus.undefined //// [/home/src/projects/project/index.mjs] file written with same contents //// [/home/src/projects/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./index.mts"],"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},{"version":"-5214938848-export declare const foo: number;","impliedFormat":1},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[4],"options":{"strict":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./index.mts"],"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},{"version":"-5214938848-export declare const foo: number;","impliedFormat":1},{"version":"-9556021903-export declare const bar: number;","impliedFormat":1},{"version":"-4806968175-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n","signature":"-3531856636-export {};\n","impliedFormat":99}],"root":[4],"options":{"module":100,"strict":true,"target":1},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./index.mts","start":75,"length":6,"code":7016,"category":1,"messageText":{"messageText":"Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type.","category":1,"code":7016,"next":[{"info":{"moduleReference":"foo2","mode":99}}]}},{"file":"./index.mts","start":104,"length":6,"code":7016,"category":1,"messageText":{"messageText":"Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.","category":1,"code":7016,"next":[{"info":{"moduleReference":"bar2","mode":99}}]}}]],3,2]},"version":"FakeTSVersion"} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1978,7 +2181,9 @@ exitCode:: ExitStatus.undefined ] ], "options": { - "strict": true + "module": 100, + "strict": true, + "target": 1 }, "referencedMap": { "./index.mts": [ @@ -1986,10 +2191,60 @@ exitCode:: ExitStatus.undefined "./node_modules/@types/bar/index.d.ts" ] }, - "exportedModulesMap": {} + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + [ + "./index.mts", + [ + { + "file": "./index.mts", + "start": 75, + "length": 6, + "code": 7016, + "category": 1, + "messageText": { + "messageText": "Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type.", + "category": 1, + "code": 7016, + "next": [ + { + "info": { + "moduleReference": "foo2", + "mode": 99 + } + } + ] + } + }, + { + "file": "./index.mts", + "start": 104, + "length": 6, + "code": 7016, + "category": 1, + "messageText": { + "messageText": "Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.", + "category": 1, + "code": 7016, + "next": [ + { + "info": { + "moduleReference": "bar2", + "mode": 99 + } + } + ] + } + } + ] + ], + "./node_modules/@types/bar/index.d.ts", + "./node_modules/foo/index.d.ts" + ] }, "version": "FakeTSVersion", - "size": 1070 + "size": 1782 } @@ -2015,7 +2270,7 @@ Synchronizing program CreatingProgramWith:: roots: ["/home/src/projects/project/index.mts"] - options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} + options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} 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. @@ -2109,14 +2364,24 @@ File '/home/src/projects/project/node_modules/@types/bar/package.json' exists ac 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. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo2' library may need to update its package.json or typings. -[12:02:37 AM] Found 1 error. Watching for file changes. +3 import { foo2 } from "foo2"; +   ~~~~~~ + +index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/bar2` if it exists or add a new declaration (.d.ts) file containing `declare module 'bar2';` + +4 import { bar2 } from "bar2"; +   ~~~~~~ + +[12:02:37 AM] Found 2 errors. Watching for file changes. Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: SafeModules Program files:: /a/lib/lib.d.ts @@ -2124,7 +2389,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -2153,7 +2418,7 @@ Synchronizing program CreatingProgramWith:: roots: ["/home/src/projects/project/index.mts"] - options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} + options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} 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. @@ -2228,14 +2493,24 @@ File '/home/src/projects/project/node_modules/@types/bar/package.json' exists ac 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. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/foo2` if it exists or add a new declaration (.d.ts) file containing `declare module 'foo2';` -[12:02:41 AM] Found 1 error. Watching for file changes. +3 import { foo2 } from "foo2"; +   ~~~~~~ + +index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/bar2` if it exists or add a new declaration (.d.ts) file containing `declare module 'bar2';` + +4 import { bar2 } from "bar2"; +   ~~~~~~ + +[12:02:41 AM] Found 2 errors. Watching for file changes. Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: SafeModules Program files:: /a/lib/lib.d.ts @@ -2243,7 +2518,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -2274,7 +2549,7 @@ Synchronizing program CreatingProgramWith:: roots: ["/home/src/projects/project/index.mts"] - options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} + options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} 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. @@ -2355,14 +2630,24 @@ File '/home/src/projects/project/node_modules/@types/bar/package.json' exists ac 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. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. + Try `npm i --save-dev @types/foo2` if it exists or add a new declaration (.d.ts) file containing `declare module 'foo2';` -[12:02:45 AM] Found 1 error. Watching for file changes. +3 import { foo2 } from "foo2"; +   ~~~~~~ + +index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + +4 import { bar2 } from "bar2"; +   ~~~~~~ + +[12:02:45 AM] Found 2 errors. Watching for file changes. Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: SafeModules Program files:: /a/lib/lib.d.ts @@ -2370,7 +2655,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -2401,7 +2686,7 @@ Synchronizing program CreatingProgramWith:: roots: ["/home/src/projects/project/index.mts"] - options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} + options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} 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. @@ -2463,14 +2748,24 @@ File '/home/src/projects/project/node_modules/@types/bar/package.json' exists ac 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. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo2' library may need to update its package.json or typings. -[12:02:50 AM] Found 1 error. Watching for file changes. +3 import { foo2 } from "foo2"; +   ~~~~~~ + +index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + +4 import { bar2 } from "bar2"; +   ~~~~~~ + +[12:02:50 AM] Found 2 errors. Watching for file changes. Program root files: ["/home/src/projects/project/index.mts"] -Program options: {"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} +Program options: {"target":1,"module":100,"moduleResolution":3,"traceResolution":true,"incremental":true,"strict":true,"types":[],"watch":true,"extendedDiagnostics":true,"configFilePath":"/home/src/projects/project/tsconfig.json"} Program structureReused: SafeModules Program files:: /a/lib/lib.d.ts @@ -2478,7 +2773,7 @@ Program files:: /home/src/projects/project/node_modules/@types/bar/index.d.ts /home/src/projects/project/index.mts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: diff --git a/tests/baselines/reference/tscWatch/moduleResolution/type-reference-resolutions-reuse.js b/tests/baselines/reference/tscWatch/moduleResolution/type-reference-resolutions-reuse.js index b8fd355498e..d7d19a11f78 100644 --- a/tests/baselines/reference/tscWatch/moduleResolution/type-reference-resolutions-reuse.js +++ b/tests/baselines/reference/tscWatch/moduleResolution/type-reference-resolutions-reuse.js @@ -1,7 +1,7 @@ currentDirectory:: /user/username/projects/myproject useCaseSensitiveFileNames: false Input:: //// [/user/username/projects/myproject/tsconfig.json] -{"compilerOptions":{"moduleResolution":"node16"}} +{"compilerOptions":{"module":"node16","moduleResolution":"node16"}} //// [/user/username/projects/myproject/index.ts] /// @@ -131,17 +131,34 @@ File '/package.json' does not exist according to earlier cached lookups. File '/a/lib/package.json' does not exist. File '/a/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +error TS2318: Cannot find global type 'Array'. -[12:00:50 AM] Found 1 error. Watching for file changes. +error TS2318: Cannot find global type 'Boolean'. + +error TS2318: Cannot find global type 'Function'. + +error TS2318: Cannot find global type 'IArguments'. + +error TS2318: Cannot find global type 'Number'. + +error TS2318: Cannot find global type 'Object'. + +error TS2318: Cannot find global type 'RegExp'. + +error TS2318: Cannot find global type 'String'. + +error TS6053: File '/a/lib/lib.es2022.full.d.ts' not found. + The file is in the program because: + Default library for target 'es2022' + +[12:00:50 AM] Found 9 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/index.ts"] -Program options: {"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"module":100,"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: Not Program files:: -/a/lib/lib.d.ts /user/username/projects/myproject/a.ts /user/username/projects/myproject/node_modules/pkg/import.d.ts /user/username/projects/myproject/index.ts @@ -150,13 +167,14 @@ Program files:: No cached semantic diagnostics in the builder:: Shape signatures in builder refreshed for:: -/a/lib/lib.d.ts (used version) /user/username/projects/myproject/a.ts (used version) /user/username/projects/myproject/node_modules/pkg/import.d.ts (used version) /user/username/projects/myproject/index.ts (used version) /user/username/projects/myproject/node_modules/@types/pkg2/index.d.ts (used version) PolledWatches:: +/a/lib/lib.es2022.full.d.ts: *new* + {"pollingInterval":500} /user/username/projects/myproject/node_modules/@types/package.json: *new* {"pollingInterval":2000} /user/username/projects/myproject/node_modules/@types/pkg2/package.json: *new* @@ -173,8 +191,6 @@ PolledWatches:: {"pollingInterval":2000} FsWatches:: -/a/lib/lib.d.ts: *new* - {} /user/username/projects/myproject/a.ts: *new* {} /user/username/projects/myproject/index.ts: *new* @@ -231,9 +247,6 @@ Output:: >> Screen clear [12:00:53 AM] File change detected. Starting incremental compilation... -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. File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. File '/user/username/projects/package.json' does not exist according to earlier cached lookups. File '/user/username/package.json' does not exist according to earlier cached lookups. @@ -296,17 +309,34 @@ File '/package.json' does not exist according to earlier cached lookups. 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. -error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +error TS2318: Cannot find global type 'Array'. -[12:00:57 AM] Found 1 error. Watching for file changes. +error TS2318: Cannot find global type 'Boolean'. + +error TS2318: Cannot find global type 'Function'. + +error TS2318: Cannot find global type 'IArguments'. + +error TS2318: Cannot find global type 'Number'. + +error TS2318: Cannot find global type 'Object'. + +error TS2318: Cannot find global type 'RegExp'. + +error TS2318: Cannot find global type 'String'. + +error TS6053: File '/a/lib/lib.es2022.full.d.ts' not found. + The file is in the program because: + Default library for target 'es2022' + +[12:00:57 AM] Found 9 errors. Watching for file changes. Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/index.ts"] -Program options: {"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program options: {"module":100,"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} Program structureReused: SafeModules Program files:: -/a/lib/lib.d.ts /user/username/projects/myproject/node_modules/pkg/import.d.ts /user/username/projects/myproject/a.ts /user/username/projects/myproject/index.ts diff --git a/tests/baselines/reference/tsserver/moduleResolution/node10Result.js b/tests/baselines/reference/tsserver/moduleResolution/node10Result.js index 7c0dca9ec6f..7d06d88bd42 100644 --- a/tests/baselines/reference/tsserver/moduleResolution/node10Result.js +++ b/tests/baselines/reference/tsserver/moduleResolution/node10Result.js @@ -125,7 +125,7 @@ import { bar2 } from "bar2"; //// [/home/src/projects/project/tsconfig.json] -{"compilerOptions":{"moduleResolution":"node16","traceResolution":true,"incremental":true,"strict":true,"types":[]},"files":["index.mts"]} +{"compilerOptions":{"target":"es5","module":"node16","moduleResolution":"node16","traceResolution":true,"incremental":true,"strict":true,"types":[]},"files":["index.mts"]} //// [/a/lib/lib.d.ts] /// @@ -169,6 +169,8 @@ Info seq [hh:mm:ss:mss] Config: /home/src/projects/project/tsconfig.json : { "/home/src/projects/project/index.mts" ], "options": { + "target": 1, + "module": 100, "moduleResolution": 3, "traceResolution": true, "incremental": true, @@ -418,6 +420,8 @@ Info seq [hh:mm:ss:mss] event: "deferredSize": 0 }, "compilerOptions": { + "target": "es5", + "module": "node16", "moduleResolution": "node16", "traceResolution": true, "incremental": true, @@ -449,13 +453,7 @@ Info seq [hh:mm:ss:mss] event: "body": { "triggerFile": "/home/src/projects/project/index.mts", "configFile": "/home/src/projects/project/tsconfig.json", - "diagnostics": [ - { - "text": "Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.", - "code": 5110, - "category": "error" - } - ] + "diagnostics": [] } } Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/tsconfig.json' (Configured) diff --git a/tests/cases/compiler/moduleExportNonStructured.ts b/tests/cases/compiler/moduleExportNonStructured.ts index 756f948570a..05ee764f54c 100644 --- a/tests/cases/compiler/moduleExportNonStructured.ts +++ b/tests/cases/compiler/moduleExportNonStructured.ts @@ -1,5 +1,5 @@ // @target: ESNext -// @module: ESNext +// @module: NodeNext // @moduleResolution: NodeNext // @strict: true diff --git a/tests/cases/compiler/nodeNextModuleResolution1.ts b/tests/cases/compiler/nodeNextModuleResolution1.ts index c22c4fe3312..ce9afc7cdae 100644 --- a/tests/cases/compiler/nodeNextModuleResolution1.ts +++ b/tests/cases/compiler/nodeNextModuleResolution1.ts @@ -1,3 +1,4 @@ +// @module: nodenext // @moduleResolution: nodenext // @traceResolution: true diff --git a/tests/cases/compiler/nodeNextModuleResolution2.ts b/tests/cases/compiler/nodeNextModuleResolution2.ts index 2bbe7a54071..7096e8afab1 100644 --- a/tests/cases/compiler/nodeNextModuleResolution2.ts +++ b/tests/cases/compiler/nodeNextModuleResolution2.ts @@ -1,3 +1,4 @@ +// @module: nodenext // @moduleResolution: nodenext // @traceResolution: true diff --git a/tests/cases/conformance/moduleResolution/conditionalExportsResolutionFallback.ts b/tests/cases/conformance/moduleResolution/conditionalExportsResolutionFallback.ts index d9a1d480b8e..788106d5da4 100644 --- a/tests/cases/conformance/moduleResolution/conditionalExportsResolutionFallback.ts +++ b/tests/cases/conformance/moduleResolution/conditionalExportsResolutionFallback.ts @@ -1,3 +1,4 @@ +// @module: nodenext // @moduleResolution: node16,nodenext,bundler // @traceResolution: true // @allowJs: true diff --git a/tests/cases/conformance/moduleResolution/nestedPackageJsonRedirect.ts b/tests/cases/conformance/moduleResolution/nestedPackageJsonRedirect.ts index 8d5804c1fd0..e0082179b82 100644 --- a/tests/cases/conformance/moduleResolution/nestedPackageJsonRedirect.ts +++ b/tests/cases/conformance/moduleResolution/nestedPackageJsonRedirect.ts @@ -1,3 +1,4 @@ +// @module: nodenext // @moduleResolution: node16,nodenext,bundler // @noEmit: true // @noTypesAndSymbols: true diff --git a/tests/cases/conformance/moduleResolution/resolvesWithoutExportsDiagnostic1.ts b/tests/cases/conformance/moduleResolution/resolvesWithoutExportsDiagnostic1.ts index d01bb47a75c..19ff270f30e 100644 --- a/tests/cases/conformance/moduleResolution/resolvesWithoutExportsDiagnostic1.ts +++ b/tests/cases/conformance/moduleResolution/resolvesWithoutExportsDiagnostic1.ts @@ -1,3 +1,4 @@ +// @module: node16 // @moduleResolution: bundler,node16 // @strict: true // @noTypesAndSymbols: true diff --git a/tests/cases/fourslash/moveToNewFile_importFileExtensions.ts b/tests/cases/fourslash/moveToNewFile_importFileExtensions.ts index 852dccb95ca..6779ebd8a50 100644 --- a/tests/cases/fourslash/moveToNewFile_importFileExtensions.ts +++ b/tests/cases/fourslash/moveToNewFile_importFileExtensions.ts @@ -3,6 +3,7 @@ // @Filename: /tsconfig.json ////{ //// "compilerOptions": { +//// "module": "Node16", //// "moduleResolution": "Node16", //// } ////}