Files
tsgo/testdata/baselines/reference/tsc/declarationEmit/reports-dts-generation-errors-with-incremental.js

255 lines
12 KiB
TypeScript

currentDirectory::/home/src/workspaces/project
useCaseSensitiveFileNames::true
Input::
//// [/home/src/workspaces/project/index.ts] *new*
import ky from 'ky';
export const api = ky.extend({});
//// [/home/src/workspaces/project/node_modules/ky/distribution/index.d.ts] *new*
type KyInstance = {
extend(options: Record<string,unknown>): KyInstance;
}
declare const ky: KyInstance;
export default ky;
//// [/home/src/workspaces/project/node_modules/ky/package.json] *new*
{
"name": "ky",
"type": "module",
"main": "./distribution/index.js"
}
//// [/home/src/workspaces/project/package.json] *new*
{
"type": "module"
}
//// [/home/src/workspaces/project/tsconfig.json] *new*
{
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext",
"composite": true,
"incremental": true,
"declaration": true,
"skipLibCheck": true,
"skipDefaultLibCheck": true,
},
}
tsgo --explainFiles --listEmittedFiles
ExitStatus:: DiagnosticsPresent_OutputsSkipped
Output::
index.ts:2:14 - error TS4023: Exported variable 'api' has or is using name 'KyInstance' from external module "/home/src/workspaces/project/node_modules/ky/distribution/index" but cannot be named.
2 export const api = ky.extend({});
   ~~~
TSFILE: /home/src/workspaces/project/index.js
TSFILE: /home/src/workspaces/project/tsconfig.tsbuildinfo
../../tslibs/TS/Lib/lib.es2025.full.d.ts
Default library for target 'ES2025'
node_modules/ky/distribution/index.d.ts
Imported via 'ky' from file 'index.ts'
File is ECMAScript module because 'node_modules/ky/package.json' has field "type" with value "module"
index.ts
Matched by default include pattern '**/*'
File is ECMAScript module because 'package.json' has field "type" with value "module"
Found 1 error in index.ts:2
//// [/home/src/tslibs/TS/Lib/lib.es2025.full.d.ts] *Lib*
/// <reference no-default-lib="true"/>
interface Boolean {}
interface Function {}
interface CallableFunction {}
interface NewableFunction {}
interface IArguments {}
interface Number { toExponential: any; }
interface Object {}
interface RegExp {}
interface String { charAt: any; }
interface Array<T> { length: number; [n: number]: T; }
interface ReadonlyArray<T> {}
interface SymbolConstructor {
(desc?: string | number): symbol;
for(name: string): symbol;
readonly toStringTag: symbol;
}
declare var Symbol: SymbolConstructor;
interface Symbol {
readonly [Symbol.toStringTag]: string;
}
declare const console: { log(msg: any): void; };
//// [/home/src/workspaces/project/index.js] *new*
import ky from 'ky';
export const api = ky.extend({});
//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new*
{"version":"FakeTSVersion","root":[3],"packageJsons":["./node_modules/ky/package.json","./package.json"],"missingPackageJsons":["./node_modules/ky/distribution/package.json"],"fileNames":["lib.es2025.full.d.ts","./node_modules/ky/distribution/index.d.ts","./index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record<string,unknown>): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;","impliedNodeFormat":99},{"version":"0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"composite":true,"declaration":true,"module":199,"skipLibCheck":true,"skipDefaultLibCheck":true},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"pos":34,"end":37,"code":4023,"category":1,"messageKey":"Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023","messageArgs":["api","KyInstance","\"/home/src/workspaces/project/node_modules/ky/distribution/index\""]}]]],"emitSignatures":[3]}
//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new*
{
"version": "FakeTSVersion",
"root": [
{
"files": [
"./index.ts"
],
"original": 3
}
],
"packageJsons": [
"./node_modules/ky/package.json",
"./package.json"
],
"missingPackageJsons": [
"./node_modules/ky/distribution/package.json"
],
"fileNames": [
"lib.es2025.full.d.ts",
"./node_modules/ky/distribution/index.d.ts",
"./index.ts"
],
"fileInfos": [
{
"fileName": "lib.es2025.full.d.ts",
"version": "8859c12c614ce56ba9a18e58384a198f-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
"signature": "8859c12c614ce56ba9a18e58384a198f-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
"affectsGlobalScope": true,
"impliedNodeFormat": "CommonJS",
"original": {
"version": "8859c12c614ce56ba9a18e58384a198f-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
"affectsGlobalScope": true,
"impliedNodeFormat": 1
}
},
{
"fileName": "./node_modules/ky/distribution/index.d.ts",
"version": "b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record<string,unknown>): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;",
"signature": "b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record<string,unknown>): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;",
"impliedNodeFormat": "ESNext",
"original": {
"version": "b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record<string,unknown>): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;",
"impliedNodeFormat": 99
}
},
{
"fileName": "./index.ts",
"version": "0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});",
"signature": "0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});",
"impliedNodeFormat": "ESNext",
"original": {
"version": "0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});",
"impliedNodeFormat": 99
}
}
],
"fileIdsList": [
[
"./node_modules/ky/distribution/index.d.ts"
]
],
"options": {
"composite": true,
"declaration": true,
"module": 199,
"skipLibCheck": true,
"skipDefaultLibCheck": true
},
"referencedMap": {
"./index.ts": [
"./node_modules/ky/distribution/index.d.ts"
]
},
"emitDiagnosticsPerFile": [
[
"./index.ts",
[
{
"pos": 34,
"end": 37,
"code": 4023,
"category": 1,
"messageKey": "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023",
"messageArgs": [
"api",
"KyInstance",
"\"/home/src/workspaces/project/node_modules/ky/distribution/index\""
]
}
]
]
],
"emitSignatures": [
{
"file": "./index.ts",
"original": 3
}
],
"size": 1843
}
tsconfig.json::
SemanticDiagnostics::
*refresh* /home/src/tslibs/TS/Lib/lib.es2025.full.d.ts
*refresh* /home/src/workspaces/project/node_modules/ky/distribution/index.d.ts
*refresh* /home/src/workspaces/project/index.ts
Signatures::
Edit [0]:: no change
tsgo --explainFiles --listEmittedFiles
ExitStatus:: DiagnosticsPresent_OutputsSkipped
Output::
index.ts:2:14 - error TS4023: Exported variable 'api' has or is using name 'KyInstance' from external module "/home/src/workspaces/project/node_modules/ky/distribution/index" but cannot be named.
2 export const api = ky.extend({});
   ~~~
../../tslibs/TS/Lib/lib.es2025.full.d.ts
Default library for target 'ES2025'
node_modules/ky/distribution/index.d.ts
Imported via 'ky' from file 'index.ts'
File is ECMAScript module because 'node_modules/ky/package.json' has field "type" with value "module"
index.ts
Matched by default include pattern '**/*'
File is ECMAScript module because 'package.json' has field "type" with value "module"
Found 1 error in index.ts:2
tsconfig.json::
SemanticDiagnostics::
Signatures::
Edit [1]:: build -b
tsgo -b --explainFiles --listEmittedFiles --v
ExitStatus:: DiagnosticsPresent_OutputsSkipped
Output::
[HH:MM:SS AM] Projects in this build:
* tsconfig.json
[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors.
[HH:MM:SS AM] Building project 'tsconfig.json'...
index.ts:2:14 - error TS4023: Exported variable 'api' has or is using name 'KyInstance' from external module "/home/src/workspaces/project/node_modules/ky/distribution/index" but cannot be named.
2 export const api = ky.extend({});
   ~~~
../../tslibs/TS/Lib/lib.es2025.full.d.ts
Default library for target 'ES2025'
node_modules/ky/distribution/index.d.ts
Imported via 'ky' from file 'index.ts'
File is ECMAScript module because 'node_modules/ky/package.json' has field "type" with value "module"
index.ts
Matched by default include pattern '**/*'
File is ECMAScript module because 'package.json' has field "type" with value "module"
Found 1 error in index.ts:2
tsconfig.json::
SemanticDiagnostics::
Signatures::