diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ee86ae50306c7..1702380305510 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4883,6 +4883,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { (isLiteralImportTypeNode(location) ? location : undefined)?.argument.literal; const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat; const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions); + const moduleKind = getEmitModuleKind(compilerOptions); const resolvedModule = getResolvedModule(currentSourceFile, moduleReference, mode); const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile); const sourceFile = resolvedModule @@ -4914,7 +4915,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) { errorOnImplicitAnyModule(/*isError*/ false, errorNode, currentSourceFile, mode, resolvedModule, moduleReference); } - if (moduleResolutionKind === ModuleResolutionKind.Node16 || moduleResolutionKind === ModuleResolutionKind.NodeNext) { + if (ModuleKind.Node16 <= moduleKind && moduleKind <= ModuleKind.NodeNext) { const isSyncImport = (currentSourceFile.impliedNodeFormat === ModuleKind.CommonJS && !findAncestor(location, isImportCall)) || !!findAncestor(location, isImportEqualsDeclaration); const overrideClauseHost = findAncestor(location, l => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l)) as ImportTypeNode | ImportDeclaration | ExportDeclaration | undefined; const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? overrideClauseHost.assertions?.assertClause : overrideClauseHost?.assertClause; diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 436fb04ef2bcf..c2bf3bb69c657 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -1310,7 +1310,7 @@ export interface CreateSourceFileOptions { /** * 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; /** diff --git a/src/compiler/program.ts b/src/compiler/program.ts index a61e46e356529..29ead379c8b95 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -883,7 +883,7 @@ export function isExclusivelyTypeOnlyImportOrExport(decl: ImportDeclaration | Ex * 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 @@ -1315,9 +1315,9 @@ export function getImpliedNodeFormatForFileWorker( host: ModuleResolutionHost, options: CompilerOptions, ) { - switch (getEmitModuleResolutionKind(options)) { - case ModuleResolutionKind.Node16: - case ModuleResolutionKind.NodeNext: + switch (getEmitModuleKind(options)) { + case ModuleKind.Node16: + case ModuleKind.NodeNext: return fileExtensionIsOneOf(fileName, [Extension.Dmts, Extension.Mts, Extension.Mjs]) ? ModuleKind.ESNext : fileExtensionIsOneOf(fileName, [Extension.Dcts, Extension.Cts, Extension.Cjs]) ? ModuleKind.CommonJS : fileExtensionIsOneOf(fileName, [Extension.Dts, Extension.Ts, Extension.Tsx, Extension.Js, Extension.Jsx]) ? lookupFromPackageJson() : diff --git a/src/testRunner/unittests/helpers/node10Result.ts b/src/testRunner/unittests/helpers/node10Result.ts index 5961d211f3f94..aa3e0b2581f35 100644 --- a/src/testRunner/unittests/helpers/node10Result.ts +++ b/src/testRunner/unittests/helpers/node10Result.ts @@ -70,8 +70,10 @@ export function getFsContentsForNode10Result(): FsContents { import { foo2 } from "foo2"; import { bar2 } from "bar2"; `, + "/lib/lib.es2022.full.d.ts": libFile.content, "/home/src/projects/project/tsconfig.json": JSON.stringify({ compilerOptions: { + module: "node16", moduleResolution: "node16", traceResolution: true, incremental: true, @@ -80,6 +82,6 @@ export function getFsContentsForNode10Result(): FsContents { }, files: ["index.mts"] }), - [libFile.path]: libFile.content, + [libFile.path.replace("lib.d.ts", "lib.es2022.full.d.ts")]: 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 da9db45871b84..635ad80aff0e1 100644 --- a/src/testRunner/unittests/tscWatch/forceConsistentCasingInFileNames.ts +++ b/src/testRunner/unittests/tscWatch/forceConsistentCasingInFileNames.ts @@ -295,12 +295,13 @@ a;b; }), "/Users/name/projects/web/tsconfig.json": JSON.stringify({ compilerOptions: { + module: "nodenext", moduleResolution: "nodenext", forceConsistentCasingInFileNames: true, traceResolution: true, } }), - [libFile.path]: libFile.content, + [libFile.path.replace("lib.d.ts", "lib.esnext.full.d.ts")]: libFile.content, }, { currentDirectory: "/Users/name/projects/web" }), }); diff --git a/src/testRunner/unittests/tscWatch/moduleResolution.ts b/src/testRunner/unittests/tscWatch/moduleResolution.ts index 2512116a46ab1..88d9fd45f8292 100644 --- a/src/testRunner/unittests/tscWatch/moduleResolution.ts +++ b/src/testRunner/unittests/tscWatch/moduleResolution.ts @@ -89,6 +89,7 @@ describe("unittests:: tsc-watch:: moduleResolution", () => { path: `/user/username/projects/myproject/tsconfig.json`, content: JSON.stringify({ compilerOptions: { + module: "nodenext", moduleResolution: "nodenext", outDir: "./dist", declaration: true, @@ -123,7 +124,10 @@ describe("unittests:: tsc-watch:: moduleResolution", () => { export function thing(): void {} ` }, - libFile + { + ...libFile, + path: libFile.path.replace("lib.d.ts", "lib.esnext.full.d.ts") + } ], { currentDirectory: "/user/username/projects/myproject" }), commandLineArgs: ["-w", "--traceResolution"], edits: [{ @@ -282,7 +286,7 @@ describe("unittests:: tsc-watch:: moduleResolution", () => { { path: `/user/username/projects/myproject/tsconfig.json`, content: JSON.stringify({ - compilerOptions: { moduleResolution: "node16" }, + compilerOptions: { target: "es5", module: "node16", moduleResolution: "node16" }, }) }, { @@ -352,7 +356,7 @@ describe("unittests:: tsc-watch:: moduleResolution", () => { { path: `/user/username/projects/myproject/tsconfig.json`, content: JSON.stringify({ - compilerOptions: { moduleResolution: "node16" }, + compilerOptions: { module: "node16", moduleResolution: "node16" }, }) }, { @@ -422,7 +426,10 @@ describe("unittests:: tsc-watch:: moduleResolution", () => { path: `/user/username/projects/myproject/node_modules/@types/pkg2/index.d.ts`, content: `export const x = 10;` }, - libFile + { + ...libFile, + path: libFile.path.replace("lib.d.ts", "lib.es2022.full.d.ts"), + } ], { currentDirectory: "/user/username/projects/myproject" }), commandLineArgs: ["-w", "--traceResolution"], edits: [ @@ -538,4 +545,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 eff2717fe15a8..b5a333ac28e3b 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 3f78e1ae29a4d..15d11d57631eb 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 71d5b10190e58..9168133fccc6c 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 6d14798319a36..7b710c26e3c5f 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 8baa069a5920c..0000000000000 --- 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 c128b9f0ec8ab..0000000000000 --- 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 958728c943deb..0000000000000 --- 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 c867a2883059b..deacfeb131b9f 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 a6d17c4961116..ce5ba5363fe18 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 8aacbdd1b7439..0000000000000 --- 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 3b67cb241a583..0000000000000 --- 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 6293f22afb8e8..00bab93c4a854 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 d76bd3acd7fb6..a006d7840c307 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 0f97e5e2de642..0000000000000 --- 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 19475675a566b..e57c0f2575603 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 0668d695d63e3..4c01090dad8e1 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 1ee77d07b8fd0..6b605e7ac2545 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 7fa0a30235cf2..fe904ca69530b 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 5536e41466a25..ae64bd457c45c 100644 --- a/tests/baselines/reference/tsc/moduleResolution/node10Result.js +++ b/tests/baselines/reference/tsc/moduleResolution/node10Result.js @@ -1,6 +1,6 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: -//// [/a/lib/lib.d.ts] +//// [/a/lib/lib.es2022.full.d.ts] /// interface Boolean {} interface Function {} @@ -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":{"module":"node16","moduleResolution":"node16","traceResolution":true,"incremental":true,"strict":true,"types":[]},"files":["index.mts"]} //// [/lib/lib.d.ts] /// @@ -154,6 +154,19 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +//// [/lib/lib.es2022.full.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + Output:: @@ -326,43 +339,56 @@ 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: {"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 +/lib/lib.es2022.full.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 -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/lib/lib.es2022.full.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) +/lib/lib.es2022.full.d.ts (used version) /home/src/projects/project/node_modules/foo2/index.d.ts (used version) /home/src/projects/project/node_modules/@types/bar2/index.d.ts (used version) /home/src/projects/project/index.mts (used version) //// [/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.es2022.full.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},"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] { "program": { "fileNames": [ - "../../../../lib/lib.d.ts", + "../../../../lib/lib.es2022.full.d.ts", "./node_modules/foo2/index.d.ts", "./node_modules/@types/bar2/index.d.ts", "./index.mts" @@ -374,14 +400,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); ] ], "fileInfos": { - "../../../../lib/lib.d.ts": { + "../../../../lib/lib.es2022.full.d.ts": { "original": { - "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; };", + "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": "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; };", - "signature": "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; };", + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", "affectsGlobalScope": true, "impliedFormat": "commonjs" }, @@ -420,6 +446,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); ] ], "options": { + "module": 100, "strict": true }, "referencedMap": { @@ -433,10 +460,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.es2022.full.d.ts" + ] }, "version": "FakeTSVersion", - "size": 1118 + "size": 1744 } @@ -629,22 +706,32 @@ 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: {"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 +/lib/lib.es2022.full.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 -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -852,22 +939,32 @@ 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: {"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 +/lib/lib.es2022.full.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 -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -1064,22 +1161,32 @@ 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. -Found 1 error. +2 import { bar } from "bar"; +   ~~~~~ + + +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: {"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 +/lib/lib.es2022.full.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 -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -1263,22 +1370,32 @@ 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: {"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 +/lib/lib.es2022.full.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 -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -1434,23 +1551,29 @@ 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: {"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 +/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/@types/bar/index.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 -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,13 +1582,13 @@ 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.es2022.full.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},"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] { "program": { "fileNames": [ - "../../../../lib/lib.d.ts", + "../../../../lib/lib.es2022.full.d.ts", "./node_modules/@types/bar/index.d.ts", "./node_modules/foo2/index.d.ts", "./node_modules/@types/bar2/index.d.ts", @@ -1479,14 +1602,14 @@ Shape signatures in builder refreshed for:: ] ], "fileInfos": { - "../../../../lib/lib.d.ts": { + "../../../../lib/lib.es2022.full.d.ts": { "original": { - "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; };", + "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": "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; };", - "signature": "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; };", + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", "affectsGlobalScope": true, "impliedFormat": "commonjs" }, @@ -1535,6 +1658,7 @@ Shape signatures in builder refreshed for:: ] ], "options": { + "module": 100, "strict": true }, "referencedMap": { @@ -1544,10 +1668,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.es2022.full.d.ts" + ] }, "version": "FakeTSVersion", - "size": 1271 + "size": 1580 } @@ -1675,24 +1830,21 @@ 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: {"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 +/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/foo/index.d.ts /home/src/projects/project/node_modules/@types/bar/index.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 -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,13 +1853,13 @@ 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.es2022.full.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},"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] { "program": { "fileNames": [ - "../../../../lib/lib.d.ts", + "../../../../lib/lib.es2022.full.d.ts", "./node_modules/foo/index.d.ts", "./node_modules/@types/bar/index.d.ts", "./node_modules/foo2/index.d.ts", @@ -1723,14 +1875,14 @@ Shape signatures in builder refreshed for:: ] ], "fileInfos": { - "../../../../lib/lib.d.ts": { + "../../../../lib/lib.es2022.full.d.ts": { "original": { - "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; };", + "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": "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; };", - "signature": "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; };", + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", "affectsGlobalScope": true, "impliedFormat": "commonjs" }, @@ -1788,6 +1940,7 @@ Shape signatures in builder refreshed for:: ] ], "options": { + "module": 100, "strict": true }, "referencedMap": { @@ -1798,10 +1951,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.es2022.full.d.ts" + ] }, "version": "FakeTSVersion", - "size": 1383 + "size": 1371 } @@ -1964,23 +2125,28 @@ 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: {"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 +/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/foo/index.d.ts /home/src/projects/project/node_modules/@types/bar/index.d.ts /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,13 +2154,13 @@ 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.es2022.full.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},"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] { "program": { "fileNames": [ - "../../../../lib/lib.d.ts", + "../../../../lib/lib.es2022.full.d.ts", "./node_modules/foo/index.d.ts", "./node_modules/@types/bar/index.d.ts", "./node_modules/foo2/index.d.ts", @@ -2008,14 +2174,14 @@ Shape signatures in builder refreshed for:: ] ], "fileInfos": { - "../../../../lib/lib.d.ts": { + "../../../../lib/lib.es2022.full.d.ts": { "original": { - "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; };", + "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": "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; };", - "signature": "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; };", + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", "affectsGlobalScope": true, "impliedFormat": "commonjs" }, @@ -2064,6 +2230,7 @@ Shape signatures in builder refreshed for:: ] ], "options": { + "module": 100, "strict": true }, "referencedMap": { @@ -2073,10 +2240,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.es2022.full.d.ts" + ] }, "version": "FakeTSVersion", - "size": 1262 + "size": 1575 } @@ -2269,22 +2467,33 @@ 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"; +   ~~~~~~ -Found 1 error. +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 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: {"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 +/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/foo/index.d.ts /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,13 +2501,13 @@ 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.es2022.full.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},"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] { "program": { "fileNames": [ - "../../../../lib/lib.d.ts", + "../../../../lib/lib.es2022.full.d.ts", "./node_modules/foo/index.d.ts", "./node_modules/@types/bar/index.d.ts", "./index.mts" @@ -2310,14 +2519,14 @@ Shape signatures in builder refreshed for:: ] ], "fileInfos": { - "../../../../lib/lib.d.ts": { + "../../../../lib/lib.es2022.full.d.ts": { "original": { - "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; };", + "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": "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; };", - "signature": "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; };", + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", "affectsGlobalScope": true, "impliedFormat": "commonjs" }, @@ -2357,6 +2566,7 @@ Shape signatures in builder refreshed for:: ] ], "options": { + "module": 100, "strict": true }, "referencedMap": { @@ -2365,10 +2575,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.es2022.full.d.ts" + ] }, "version": "FakeTSVersion", - "size": 1148 + "size": 1781 } @@ -2561,22 +2821,32 @@ 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: {"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 +/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/foo/index.d.ts /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,22 +3054,32 @@ 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"; +   ~~~~~~ -Found 1 error. +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 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: {"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 +/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/foo/index.d.ts /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,22 +3276,32 @@ 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: {"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 +/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/foo/index.d.ts /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,22 +3485,32 @@ 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: {"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 +/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/foo/index.d.ts /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 4f912ea478d4a..319c2c17b1690 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/with-nodeNext-resolution.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/with-nodeNext-resolution.js @@ -13,9 +13,9 @@ 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":{"module":"nodenext","moduleResolution":"nodenext","forceConsistentCasingInFileNames":true,"traceResolution":true}} -//// [/a/lib/lib.d.ts] +//// [/a/lib/lib.esnext.full.d.ts] /// interface Boolean {} interface Function {} @@ -83,10 +83,8 @@ 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' +../../../../a/lib/lib.esnext.full.d.ts + Default library for target 'esnext' node_modules/@types/yargs/index.d.ts Imported via "yargs" from file 'src/bin.ts' with packageId 'yargs/index.d.ts@17.0.12' Entry point for implicit type library 'yargs' with packageId 'yargs/index.d.ts@17.0.12' @@ -94,22 +92,25 @@ 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: {"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 +/a/lib/lib.esnext.full.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.esnext.full.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) +/a/lib/lib.esnext.full.d.ts (used version) /users/name/projects/web/node_modules/@types/yargs/index.d.ts (used version) /users/name/projects/web/src/bin.ts (used version) @@ -124,7 +125,7 @@ PolledWatches:: {"pollingInterval":2000} FsWatches:: -/a/lib/lib.d.ts: *new* +/a/lib/lib.esnext.full.d.ts: *new* {} /users/name/projects: *new* {} diff --git a/tests/baselines/reference/tscWatch/moduleResolution/diagnostics-from-cache.js b/tests/baselines/reference/tscWatch/moduleResolution/diagnostics-from-cache.js index 33407bef21833..849445e987fd3 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":{"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"}}} @@ -16,7 +16,7 @@ export function thing(): void {} export function thing(): void {} -//// [/a/lib/lib.d.ts] +//// [/a/lib/lib.esnext.full.d.ts] /// interface Boolean {} interface Function {} @@ -54,24 +54,22 @@ 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: {"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 +/a/lib/lib.esnext.full.d.ts /user/username/projects/myproject/index.ts /user/username/projects/myproject/index2.ts No cached semantic diagnostics in the builder:: Shape signatures in builder refreshed for:: -/a/lib/lib.d.ts (used version) +/a/lib/lib.esnext.full.d.ts (used version) /user/username/projects/myproject/index.ts (computed .d.ts during emit) /user/username/projects/myproject/index2.ts (computed .d.ts during emit) @@ -82,7 +80,7 @@ PolledWatches:: {"pollingInterval":500} FsWatches:: -/a/lib/lib.d.ts: *new* +/a/lib/lib.esnext.full.d.ts: *new* {} /user/username/projects/myproject/index.ts: *new* {} @@ -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,17 +151,15 @@ 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: {"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 +/a/lib/lib.esnext.full.d.ts /user/username/projects/myproject/index.ts /user/username/projects/myproject/index2.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 d74aab3dd6dfe..5e27cd1e3a4a3 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":{"target":"es5","module":"node16","moduleResolution":"node16"}} //// [/user/username/projects/myproject/index.ts] import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; @@ -131,14 +131,17 @@ 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'. +index.ts:2:39 - error TS2307: Cannot find module 'pkg1' or its corresponding type declarations. + +2 import type { RequireInterface } from "pkg1" assert { "resolution-mode": "require" }; +   ~~~~~~ [12:00:44 AM] Found 1 error. 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: {"target":1,"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 @@ -146,7 +149,11 @@ Program files:: /user/username/projects/myproject/node_modules/pkg/import.d.ts /user/username/projects/myproject/index.ts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/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 Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) @@ -275,14 +282,17 @@ 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'. +index.ts:2:39 - error TS2307: Cannot find module 'pkg1' or its corresponding type declarations. + +2 import type { RequireInterface } from "pkg1" assert { "resolution-mode": "require" }; +   ~~~~~~ [12:00:54 AM] Found 1 error. 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: {"target":1,"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 @@ -290,7 +300,9 @@ Program files:: /user/username/projects/myproject/a.ts /user/username/projects/myproject/index.ts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/index.ts Shape signatures in builder refreshed for:: /user/username/projects/myproject/a.ts (computed .d.ts) diff --git a/tests/baselines/reference/tscWatch/moduleResolution/node10Result.js b/tests/baselines/reference/tscWatch/moduleResolution/node10Result.js index 648ac07f65d86..b0e37abbf52b4 100644 --- a/tests/baselines/reference/tscWatch/moduleResolution/node10Result.js +++ b/tests/baselines/reference/tscWatch/moduleResolution/node10Result.js @@ -123,10 +123,23 @@ import { foo2 } from "foo2"; import { bar2 } from "bar2"; +//// [/lib/lib.es2022.full.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + //// [/home/src/projects/project/tsconfig.json] -{"compilerOptions":{"moduleResolution":"node16","traceResolution":true,"incremental":true,"strict":true,"types":[]},"files":["index.mts"]} +{"compilerOptions":{"module":"node16","moduleResolution":"node16","traceResolution":true,"incremental":true,"strict":true,"types":[]},"files":["index.mts"]} -//// [/a/lib/lib.d.ts] +//// [/a/lib/lib.es2022.full.d.ts] /// interface Boolean {} interface Function {} @@ -142,14 +155,14 @@ interface Array { length: number; [n: number]: T; } /a/lib/tsc.js -w --extendedDiagnostics Output:: -[12:01:13 AM] Starting compilation in watch mode... +[12:01:17 AM] Starting compilation in watch mode... Current directory: /home/src/projects/project CaseSensitiveFileNames: false FileWatcher:: Added:: WatchInfo: /home/src/projects/project/tsconfig.json 2000 undefined Config file 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: {"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'. @@ -322,7 +335,7 @@ FileWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules/@types/ 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. -FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 undefined Source file +FileWatcher:: Added:: WatchInfo: /a/lib/lib.es2022.full.d.ts 250 undefined Source file DirectoryWatcher:: Added:: WatchInfo: /home/src/projects 0 undefined Failed Lookup Locations Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects 0 undefined Failed Lookup Locations DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules 1 undefined Failed Lookup Locations @@ -343,9 +356,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. + +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 1 error. Watching for file changes. +[12:01:22 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,18 +376,22 @@ 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: {"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 +/a/lib/lib.es2022.full.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 -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.es2022.full.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) +/a/lib/lib.es2022.full.d.ts (used version) /home/src/projects/project/node_modules/foo2/index.d.ts (used version) /home/src/projects/project/node_modules/@types/bar2/index.d.ts (used version) /home/src/projects/project/index.mts (used version) @@ -374,7 +401,7 @@ PolledWatches:: {"pollingInterval":500} FsWatches:: -/a/lib/lib.d.ts: *new* +/a/lib/lib.es2022.full.d.ts: *new* {} /home/src/projects: *new* {} @@ -408,18 +435,17 @@ 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.es2022.full.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},"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] { "program": { "fileNames": [ - "../../../../a/lib/lib.d.ts", + "../../../../a/lib/lib.es2022.full.d.ts", "./node_modules/foo2/index.d.ts", "./node_modules/@types/bar2/index.d.ts", "./index.mts" @@ -431,7 +457,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); ] ], "fileInfos": { - "../../../../a/lib/lib.d.ts": { + "../../../../a/lib/lib.es2022.full.d.ts": { "original": { "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, @@ -477,6 +503,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); ] ], "options": { + "module": 100, "strict": true }, "referencedMap": { @@ -490,10 +517,60 @@ Object.defineProperty(exports, "__esModule", { value: true }); "./node_modules/foo2/index.d.ts", "./node_modules/@types/bar2/index.d.ts" ] - } + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.es2022.full.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": 1746 } @@ -515,11 +592,11 @@ Scheduling invalidateFailedLookup, Cancelled earlier one Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/node_modules/@types/bar/index.d.ts :: WatchInfo: /home/src/projects/project/node_modules 1 undefined Failed Lookup Locations Scheduling update Synchronizing program -[12:01:22 AM] File change detected. Starting incremental compilation... +[12:01:26 AM] File change detected. Starting incremental compilation... 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: {"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,22 +690,32 @@ 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"; +   ~~~~~ + +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';` -[12:01:23 AM] Found 1 error. Watching for file changes. +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: {"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 +/a/lib/lib.es2022.full.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 -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -653,11 +740,11 @@ Scheduling invalidateFailedLookup Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/node_modules/foo/index.d.ts :: WatchInfo: /home/src/projects/project/node_modules 1 undefined Failed Lookup Locations Scheduling update Synchronizing program -[12:01:26 AM] File change detected. Starting incremental compilation... +[12:01:30 AM] File change detected. Starting incremental compilation... 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: {"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,22 +819,32 @@ 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';` + +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';` -[12:01:27 AM] Found 1 error. Watching for file changes. +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: {"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 +/a/lib/lib.es2022.full.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 -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -774,11 +871,11 @@ Scheduling invalidateFailedLookup Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/node_modules/@types/bar/index.d.ts :: WatchInfo: /home/src/projects/project/node_modules 1 undefined Failed Lookup Locations Scheduling update Synchronizing program -[12:01:30 AM] File change detected. Starting incremental compilation... +[12:01:34 AM] File change detected. Starting incremental compilation... 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: {"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,22 +956,32 @@ 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';` + +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 1 error. Watching for file changes. +[12:01:35 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: {"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 +/a/lib/lib.es2022.full.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 -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -901,11 +1008,11 @@ Scheduling invalidateFailedLookup Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/node_modules/foo/index.d.ts :: WatchInfo: /home/src/projects/project/node_modules 1 undefined Failed Lookup Locations Scheduling update Synchronizing program -[12:01:35 AM] File change detected. Starting incremental compilation... +[12:01:39 AM] File change detected. Starting incremental compilation... 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: {"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,22 +1074,32 @@ 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:40 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: {"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 +/a/lib/lib.es2022.full.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 -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: No shapes updated in the builder:: @@ -1019,11 +1136,11 @@ Scheduling invalidateFailedLookup Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/project/node_modules/@types/bar/package.json 1:: WatchInfo: /home/src/projects/project/node_modules/@types/bar/package.json 2000 undefined File location affecting resolution Scheduling update Synchronizing program -[12:01:40 AM] File change detected. Starting incremental compilation... +[12:01:44 AM] File change detected. Starting incremental compilation... 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: {"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,23 +1185,29 @@ 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. +[12:01:51 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: {"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 +/a/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/@types/bar/index.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 -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) @@ -1095,7 +1218,7 @@ PolledWatches:: {"pollingInterval":500} FsWatches:: -/a/lib/lib.d.ts: +/a/lib/lib.es2022.full.d.ts: {} /home/src/projects: {} @@ -1132,13 +1255,13 @@ 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.es2022.full.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},"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] { "program": { "fileNames": [ - "../../../../a/lib/lib.d.ts", + "../../../../a/lib/lib.es2022.full.d.ts", "./node_modules/@types/bar/index.d.ts", "./node_modules/foo2/index.d.ts", "./node_modules/@types/bar2/index.d.ts", @@ -1152,7 +1275,7 @@ exitCode:: ExitStatus.undefined ] ], "fileInfos": { - "../../../../a/lib/lib.d.ts": { + "../../../../a/lib/lib.es2022.full.d.ts": { "original": { "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, @@ -1208,6 +1331,7 @@ exitCode:: ExitStatus.undefined ] ], "options": { + "module": 100, "strict": true }, "referencedMap": { @@ -1217,10 +1341,41 @@ exitCode:: ExitStatus.undefined "./node_modules/@types/bar2/index.d.ts" ] }, - "exportedModulesMap": {} + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.es2022.full.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": 1582 } @@ -1256,11 +1411,11 @@ Scheduling invalidateFailedLookup Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/project/node_modules/foo/package.json 1:: WatchInfo: /home/src/projects/project/node_modules/foo/package.json 2000 undefined File location affecting resolution Scheduling update Synchronizing program -[12:01:55 AM] File change detected. Starting incremental compilation... +[12:01:59 AM] File change detected. Starting incremental compilation... 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: {"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,24 +1454,24 @@ 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:06 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: {"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 +/a/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/foo/index.d.ts /home/src/projects/project/node_modules/@types/bar/index.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 -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) @@ -1327,7 +1482,7 @@ PolledWatches *deleted*:: {"pollingInterval":500} FsWatches:: -/a/lib/lib.d.ts: +/a/lib/lib.es2022.full.d.ts: {} /home/src/projects: {} @@ -1366,13 +1521,13 @@ 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.es2022.full.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},"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] { "program": { "fileNames": [ - "../../../../a/lib/lib.d.ts", + "../../../../a/lib/lib.es2022.full.d.ts", "./node_modules/foo/index.d.ts", "./node_modules/@types/bar/index.d.ts", "./node_modules/foo2/index.d.ts", @@ -1388,7 +1543,7 @@ exitCode:: ExitStatus.undefined ] ], "fileInfos": { - "../../../../a/lib/lib.d.ts": { + "../../../../a/lib/lib.es2022.full.d.ts": { "original": { "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, @@ -1453,6 +1608,7 @@ exitCode:: ExitStatus.undefined ] ], "options": { + "module": 100, "strict": true }, "referencedMap": { @@ -1463,10 +1619,18 @@ exitCode:: ExitStatus.undefined "./node_modules/@types/bar2/index.d.ts" ] }, - "exportedModulesMap": {} + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.es2022.full.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": 1373 } @@ -1499,11 +1663,11 @@ Scheduling invalidateFailedLookup Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/project/node_modules/@types/bar2/package.json 1:: WatchInfo: /home/src/projects/project/node_modules/@types/bar2/package.json 2000 undefined File location affecting resolution Scheduling update Synchronizing program -[12:02:09 AM] File change detected. Starting incremental compilation... +[12:02:13 AM] File change detected. Starting incremental compilation... 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: {"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,23 +1755,28 @@ 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. +[12:02:20 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: {"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 +/a/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/foo/index.d.ts /home/src/projects/project/node_modules/@types/bar/index.d.ts /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) @@ -1617,7 +1786,7 @@ PolledWatches:: {"pollingInterval":500} FsWatches:: -/a/lib/lib.d.ts: +/a/lib/lib.es2022.full.d.ts: {} /home/src/projects: {} @@ -1658,13 +1827,13 @@ 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.es2022.full.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},"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] { "program": { "fileNames": [ - "../../../../a/lib/lib.d.ts", + "../../../../a/lib/lib.es2022.full.d.ts", "./node_modules/foo/index.d.ts", "./node_modules/@types/bar/index.d.ts", "./node_modules/foo2/index.d.ts", @@ -1678,7 +1847,7 @@ exitCode:: ExitStatus.undefined ] ], "fileInfos": { - "../../../../a/lib/lib.d.ts": { + "../../../../a/lib/lib.es2022.full.d.ts": { "original": { "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, @@ -1734,6 +1903,7 @@ exitCode:: ExitStatus.undefined ] ], "options": { + "module": 100, "strict": true }, "referencedMap": { @@ -1743,10 +1913,41 @@ exitCode:: ExitStatus.undefined "./node_modules/foo2/index.d.ts" ] }, - "exportedModulesMap": {} + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.es2022.full.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": 1577 } @@ -1781,11 +1982,11 @@ Scheduling invalidateFailedLookup Elapsed:: *ms FileWatcher:: Triggered with /home/src/projects/project/node_modules/foo2/package.json 1:: WatchInfo: /home/src/projects/project/node_modules/foo2/package.json 2000 undefined File location affecting resolution Scheduling update Synchronizing program -[12:02:24 AM] File change detected. Starting incremental compilation... +[12:02:28 AM] File change detected. Starting incremental compilation... 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: {"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,22 +2050,33 @@ 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. + +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 1 error. Watching for file changes. +[12:02:35 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: {"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 +/a/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/foo/index.d.ts /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) @@ -1874,7 +2086,7 @@ PolledWatches:: {"pollingInterval":500} FsWatches:: -/a/lib/lib.d.ts: +/a/lib/lib.es2022.full.d.ts: {} /home/src/projects: {} @@ -1913,13 +2125,13 @@ 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.es2022.full.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},"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] { "program": { "fileNames": [ - "../../../../a/lib/lib.d.ts", + "../../../../a/lib/lib.es2022.full.d.ts", "./node_modules/foo/index.d.ts", "./node_modules/@types/bar/index.d.ts", "./index.mts" @@ -1931,7 +2143,7 @@ exitCode:: ExitStatus.undefined ] ], "fileInfos": { - "../../../../a/lib/lib.d.ts": { + "../../../../a/lib/lib.es2022.full.d.ts": { "original": { "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, @@ -1978,6 +2190,7 @@ exitCode:: ExitStatus.undefined ] ], "options": { + "module": 100, "strict": true }, "referencedMap": { @@ -1986,10 +2199,60 @@ exitCode:: ExitStatus.undefined "./node_modules/@types/bar/index.d.ts" ] }, - "exportedModulesMap": {} + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.es2022.full.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": 1783 } @@ -2011,11 +2274,11 @@ Scheduling invalidateFailedLookup Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/node_modules/@types/bar2/index.d.ts :: WatchInfo: /home/src/projects/project/node_modules 1 undefined Failed Lookup Locations Scheduling update Synchronizing program -[12:02:36 AM] File change detected. Starting incremental compilation... +[12:02:40 AM] File change detected. Starting incremental compilation... 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: {"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,22 +2372,32 @@ 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. + +3 import { foo2 } from "foo2"; +   ~~~~~~ -[12:02:37 AM] Found 1 error. Watching for file changes. +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: {"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 +/a/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/foo/index.d.ts /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:: @@ -2149,11 +2422,11 @@ Scheduling invalidateFailedLookup Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/node_modules/foo2/index.d.ts :: WatchInfo: /home/src/projects/project/node_modules 1 undefined Failed Lookup Locations Scheduling update Synchronizing program -[12:02:40 AM] File change detected. Starting incremental compilation... +[12:02:44 AM] File change detected. Starting incremental compilation... 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: {"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,22 +2501,32 @@ 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';` + +3 import { foo2 } from "foo2"; +   ~~~~~~ -[12:02:41 AM] Found 1 error. Watching for file changes. +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: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: {"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 +/a/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/foo/index.d.ts /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:: @@ -2270,11 +2553,11 @@ Scheduling invalidateFailedLookup Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/node_modules/@types/bar2/index.d.ts :: WatchInfo: /home/src/projects/project/node_modules 1 undefined Failed Lookup Locations Scheduling update Synchronizing program -[12:02:44 AM] File change detected. Starting incremental compilation... +[12:02:48 AM] File change detected. Starting incremental compilation... 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: {"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,22 +2638,32 @@ 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';` + +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. -[12:02:45 AM] Found 1 error. Watching for file changes. +4 import { bar2 } from "bar2"; +   ~~~~~~ + +[12:02:49 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: {"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 +/a/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/foo/index.d.ts /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:: @@ -2397,11 +2690,11 @@ Scheduling invalidateFailedLookup Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/node_modules/foo2/index.d.ts :: WatchInfo: /home/src/projects/project/node_modules 1 undefined Failed Lookup Locations Scheduling update Synchronizing program -[12:02:49 AM] File change detected. Starting incremental compilation... +[12:02:53 AM] File change detected. Starting incremental compilation... 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: {"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,22 +2756,32 @@ 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. + +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 1 error. Watching for file changes. +[12:02:54 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: {"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 +/a/lib/lib.es2022.full.d.ts /home/src/projects/project/node_modules/foo/index.d.ts /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 b8fd355498e41..e78fc3f6a432d 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] /// @@ -43,7 +43,7 @@ declare global { //// [/user/username/projects/myproject/node_modules/@types/pkg2/index.d.ts] export const x = 10; -//// [/a/lib/lib.d.ts] +//// [/a/lib/lib.es2022.full.d.ts] /// interface Boolean {} interface Function {} @@ -131,26 +131,39 @@ 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'. +index.ts:2:23 - error TS2688: Cannot find type definition file for 'pkg1'. -[12:00:50 AM] Found 1 error. Watching for file changes. +2 /// +   ~~~~ + +index.ts:3:41 - error TS2304: Cannot find name 'RequireInterface'. + +3 export interface LocalInterface extends RequireInterface {} +   ~~~~~~~~~~~~~~~~ + +[12:00:50 AM] Found 2 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 +/a/lib/lib.es2022.full.d.ts /user/username/projects/myproject/a.ts /user/username/projects/myproject/node_modules/pkg/import.d.ts /user/username/projects/myproject/index.ts /user/username/projects/myproject/node_modules/@types/pkg2/index.d.ts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.es2022.full.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/node_modules/pkg/import.d.ts +/user/username/projects/myproject/index.ts +/user/username/projects/myproject/node_modules/@types/pkg2/index.d.ts Shape signatures in builder refreshed for:: -/a/lib/lib.d.ts (used version) +/a/lib/lib.es2022.full.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) @@ -173,7 +186,7 @@ PolledWatches:: {"pollingInterval":2000} FsWatches:: -/a/lib/lib.d.ts: *new* +/a/lib/lib.es2022.full.d.ts: *new* {} /user/username/projects/myproject/a.ts: *new* {} @@ -296,23 +309,32 @@ 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'. +index.ts:2:23 - error TS2688: Cannot find type definition file for 'pkg1'. + +2 /// +   ~~~~ + +index.ts:3:41 - error TS2304: Cannot find name 'RequireInterface'. -[12:00:57 AM] Found 1 error. Watching for file changes. +3 export interface LocalInterface extends RequireInterface {} +   ~~~~~~~~~~~~~~~~ + +[12:00:57 AM] Found 2 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 +/a/lib/lib.es2022.full.d.ts /user/username/projects/myproject/node_modules/pkg/import.d.ts /user/username/projects/myproject/a.ts /user/username/projects/myproject/index.ts /user/username/projects/myproject/node_modules/@types/pkg2/index.d.ts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/a.ts Shape signatures in builder refreshed for:: /user/username/projects/myproject/a.ts (computed .d.ts) diff --git a/tests/baselines/reference/tsserver/moduleResolution/node10Result.js b/tests/baselines/reference/tsserver/moduleResolution/node10Result.js index 7c0dca9ec6f4c..e68a01cdc2251 100644 --- a/tests/baselines/reference/tsserver/moduleResolution/node10Result.js +++ b/tests/baselines/reference/tsserver/moduleResolution/node10Result.js @@ -124,10 +124,23 @@ import { foo2 } from "foo2"; import { bar2 } from "bar2"; +//// [/lib/lib.es2022.full.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + //// [/home/src/projects/project/tsconfig.json] -{"compilerOptions":{"moduleResolution":"node16","traceResolution":true,"incremental":true,"strict":true,"types":[]},"files":["index.mts"]} +{"compilerOptions":{"module":"node16","moduleResolution":"node16","traceResolution":true,"incremental":true,"strict":true,"types":[]},"files":["index.mts"]} -//// [/a/lib/lib.d.ts] +//// [/a/lib/lib.es2022.full.d.ts] /// interface Boolean {} interface Function {} @@ -169,6 +182,7 @@ Info seq [hh:mm:ss:mss] Config: /home/src/projects/project/tsconfig.json : { "/home/src/projects/project/index.mts" ], "options": { + "module": 100, "moduleResolution": 3, "traceResolution": true, "incremental": true, @@ -349,7 +363,7 @@ Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/@types/ba Info seq [hh:mm:ss:mss] File '/a/lib/package.json' does not exist. Info seq [hh:mm:ss:mss] File '/a/package.json' does not exist. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info +Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/lib/lib.es2022.full.d.ts 500 undefined WatchType: Closed Script info Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects 0 undefined Project: /home/src/projects/project/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects 0 undefined Project: /home/src/projects/project/tsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/node_modules 1 undefined Project: /home/src/projects/project/tsconfig.json WatchType: Failed Lookup Locations @@ -367,14 +381,14 @@ Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/projects/pro Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/project/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (4) - /a/lib/lib.d.ts Text-1 "/// \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; }" + /a/lib/lib.es2022.full.d.ts Text-1 "/// \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; }" /home/src/projects/project/node_modules/foo2/index.d.ts Text-1 "export declare const foo2: number;" /home/src/projects/project/node_modules/@types/bar2/index.d.ts Text-1 "export declare const bar2: number;" /home/src/projects/project/index.mts SVC-1-0 "import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n" - ../../../../a/lib/lib.d.ts - Default library for target 'es5' + ../../../../a/lib/lib.es2022.full.d.ts + Default library for target 'es2022' node_modules/foo2/index.d.ts Imported via "foo2" from file 'index.mts' with packageId 'foo2/index.d.ts@1.0.0' File is CommonJS module because 'node_modules/foo2/package.json' does not have field "type" @@ -418,6 +432,7 @@ Info seq [hh:mm:ss:mss] event: "deferredSize": 0 }, "compilerOptions": { + "module": "node16", "moduleResolution": "node16", "traceResolution": true, "incremental": true, @@ -449,13 +464,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) @@ -476,7 +485,7 @@ PolledWatches:: {"pollingInterval":500} FsWatches:: -/a/lib/lib.d.ts: *new* +/a/lib/lib.es2022.full.d.ts: *new* {} /home/src/projects: *new* {} @@ -803,7 +812,7 @@ Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlie Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/project/tsconfig.json Version: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (4) - /a/lib/lib.d.ts Text-1 "/// \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; }" + /a/lib/lib.es2022.full.d.ts Text-1 "/// \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; }" /home/src/projects/project/node_modules/foo2/index.d.ts Text-1 "export declare const foo2: number;" /home/src/projects/project/node_modules/@types/bar2/index.d.ts Text-1 "export declare const bar2: number;" /home/src/projects/project/index.mts SVC-1-0 "import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n" @@ -947,7 +956,7 @@ Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlie Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/project/tsconfig.json Version: 3 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (4) - /a/lib/lib.d.ts Text-1 "/// \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; }" + /a/lib/lib.es2022.full.d.ts Text-1 "/// \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; }" /home/src/projects/project/node_modules/foo2/index.d.ts Text-1 "export declare const foo2: number;" /home/src/projects/project/node_modules/@types/bar2/index.d.ts Text-1 "export declare const bar2: number;" /home/src/projects/project/index.mts SVC-1-0 "import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n" @@ -1179,7 +1188,7 @@ Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlie Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/project/tsconfig.json Version: 4 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (4) - /a/lib/lib.d.ts Text-1 "/// \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; }" + /a/lib/lib.es2022.full.d.ts Text-1 "/// \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; }" /home/src/projects/project/node_modules/foo2/index.d.ts Text-1 "export declare const foo2: number;" /home/src/projects/project/node_modules/@types/bar2/index.d.ts Text-1 "export declare const bar2: number;" /home/src/projects/project/index.mts SVC-1-0 "import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n" @@ -1392,7 +1401,7 @@ Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlie Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/project/tsconfig.json Version: 5 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (4) - /a/lib/lib.d.ts Text-1 "/// \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; }" + /a/lib/lib.es2022.full.d.ts Text-1 "/// \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; }" /home/src/projects/project/node_modules/foo2/index.d.ts Text-1 "export declare const foo2: number;" /home/src/projects/project/node_modules/@types/bar2/index.d.ts Text-1 "export declare const bar2: number;" /home/src/projects/project/index.mts SVC-1-0 "import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n" @@ -1595,15 +1604,15 @@ Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlie Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/project/tsconfig.json Version: 6 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (5) - /a/lib/lib.d.ts Text-1 "/// \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; }" + /a/lib/lib.es2022.full.d.ts Text-1 "/// \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; }" /home/src/projects/project/node_modules/@types/bar/index.d.ts Text-1 "export declare const bar: number;" /home/src/projects/project/node_modules/foo2/index.d.ts Text-1 "export declare const foo2: number;" /home/src/projects/project/node_modules/@types/bar2/index.d.ts Text-1 "export declare const bar2: number;" /home/src/projects/project/index.mts SVC-1-0 "import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n" - ../../../../a/lib/lib.d.ts - Default library for target 'es5' + ../../../../a/lib/lib.es2022.full.d.ts + Default library for target 'es2022' node_modules/@types/bar/index.d.ts Imported via "bar" from file 'index.mts' with packageId '@types/bar/index.d.ts@1.0.0' File is CommonJS module because 'node_modules/@types/bar/package.json' does not have field "type" @@ -1797,7 +1806,7 @@ Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /ho Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/project/tsconfig.json Version: 7 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (6) - /a/lib/lib.d.ts Text-1 "/// \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; }" + /a/lib/lib.es2022.full.d.ts Text-1 "/// \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; }" /home/src/projects/project/node_modules/foo/index.d.ts Text-1 "export declare const foo: number;" /home/src/projects/project/node_modules/@types/bar/index.d.ts Text-1 "export declare const bar: number;" /home/src/projects/project/node_modules/foo2/index.d.ts Text-1 "export declare const foo2: number;" @@ -1805,8 +1814,8 @@ Info seq [hh:mm:ss:mss] Files (6) /home/src/projects/project/index.mts SVC-1-0 "import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n" - ../../../../a/lib/lib.d.ts - Default library for target 'es5' + ../../../../a/lib/lib.es2022.full.d.ts + Default library for target 'es2022' node_modules/foo/index.d.ts Imported via "foo" from file 'index.mts' with packageId 'foo/index.d.ts@1.0.0' File is CommonJS module because 'node_modules/foo/package.json' does not have field "type" @@ -1841,7 +1850,7 @@ PolledWatches *deleted*:: {"pollingInterval":500} FsWatches:: -/a/lib/lib.d.ts: +/a/lib/lib.es2022.full.d.ts: {} /home/src/projects: {} @@ -2065,15 +2074,15 @@ Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /ho Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/project/tsconfig.json Version: 8 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (5) - /a/lib/lib.d.ts Text-1 "/// \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; }" + /a/lib/lib.es2022.full.d.ts Text-1 "/// \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; }" /home/src/projects/project/node_modules/foo/index.d.ts Text-1 "export declare const foo: number;" /home/src/projects/project/node_modules/@types/bar/index.d.ts Text-1 "export declare const bar: number;" /home/src/projects/project/node_modules/foo2/index.d.ts Text-1 "export declare const foo2: number;" /home/src/projects/project/index.mts SVC-1-0 "import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n" - ../../../../a/lib/lib.d.ts - Default library for target 'es5' + ../../../../a/lib/lib.es2022.full.d.ts + Default library for target 'es2022' node_modules/foo/index.d.ts Imported via "foo" from file 'index.mts' with packageId 'foo/index.d.ts@1.0.0' File is CommonJS module because 'node_modules/foo/package.json' does not have field "type" @@ -2105,7 +2114,7 @@ PolledWatches:: {"pollingInterval":500} FsWatches:: -/a/lib/lib.d.ts: +/a/lib/lib.es2022.full.d.ts: {} /home/src/projects: {} @@ -2321,14 +2330,14 @@ Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlie Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/project/tsconfig.json Version: 9 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (4) - /a/lib/lib.d.ts Text-1 "/// \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; }" + /a/lib/lib.es2022.full.d.ts Text-1 "/// \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; }" /home/src/projects/project/node_modules/foo/index.d.ts Text-1 "export declare const foo: number;" /home/src/projects/project/node_modules/@types/bar/index.d.ts Text-1 "export declare const bar: number;" /home/src/projects/project/index.mts SVC-1-0 "import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n" - ../../../../a/lib/lib.d.ts - Default library for target 'es5' + ../../../../a/lib/lib.es2022.full.d.ts + Default library for target 'es2022' node_modules/foo/index.d.ts Imported via "foo" from file 'index.mts' with packageId 'foo/index.d.ts@1.0.0' File is CommonJS module because 'node_modules/foo/package.json' does not have field "type" @@ -2576,7 +2585,7 @@ Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlie Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/project/tsconfig.json Version: 10 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (4) - /a/lib/lib.d.ts Text-1 "/// \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; }" + /a/lib/lib.es2022.full.d.ts Text-1 "/// \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; }" /home/src/projects/project/node_modules/foo/index.d.ts Text-1 "export declare const foo: number;" /home/src/projects/project/node_modules/@types/bar/index.d.ts Text-1 "export declare const bar: number;" /home/src/projects/project/index.mts SVC-1-0 "import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n" @@ -2800,7 +2809,7 @@ Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlie Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/project/tsconfig.json Version: 11 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (4) - /a/lib/lib.d.ts Text-1 "/// \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; }" + /a/lib/lib.es2022.full.d.ts Text-1 "/// \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; }" /home/src/projects/project/node_modules/foo/index.d.ts Text-1 "export declare const foo: number;" /home/src/projects/project/node_modules/@types/bar/index.d.ts Text-1 "export declare const bar: number;" /home/src/projects/project/index.mts SVC-1-0 "import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n" @@ -3032,7 +3041,7 @@ Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlie Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/project/tsconfig.json Version: 12 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (4) - /a/lib/lib.d.ts Text-1 "/// \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; }" + /a/lib/lib.es2022.full.d.ts Text-1 "/// \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; }" /home/src/projects/project/node_modules/foo/index.d.ts Text-1 "export declare const foo: number;" /home/src/projects/project/node_modules/@types/bar/index.d.ts Text-1 "export declare const bar: number;" /home/src/projects/project/index.mts SVC-1-0 "import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n" @@ -3245,7 +3254,7 @@ Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlie Info seq [hh:mm:ss:mss] Finishing updateGraphWorker: Project: /home/src/projects/project/tsconfig.json Version: 13 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms Info seq [hh:mm:ss:mss] Project '/home/src/projects/project/tsconfig.json' (Configured) Info seq [hh:mm:ss:mss] Files (4) - /a/lib/lib.d.ts Text-1 "/// \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; }" + /a/lib/lib.es2022.full.d.ts Text-1 "/// \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; }" /home/src/projects/project/node_modules/foo/index.d.ts Text-1 "export declare const foo: number;" /home/src/projects/project/node_modules/@types/bar/index.d.ts Text-1 "export declare const bar: number;" /home/src/projects/project/index.mts SVC-1-0 "import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";\n" diff --git a/tests/cases/compiler/moduleExportNonStructured.ts b/tests/cases/compiler/moduleExportNonStructured.ts index 756f948570a86..05ee764f54c17 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 c22c4fe3312cf..ce9afc7cdae96 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 2bbe7a540715d..7096e8afab178 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 d9a1d480b8ef3..788106d5da4a4 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 8d5804c1fd010..e0082179b821b 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 d01bb47a75ca8..19ff270f30e2d 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 852dccb95ca37..6779ebd8a5031 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", //// } ////}