Files
tsgo/testdata/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js

20 KiB

currentDirectory::/home/src/workspaces/project
useCaseSensitiveFileNames::true
Input::
//// [/home/src/workspaces/project/a.ts] *new*
export function foo() { }
//// [/home/src/workspaces/project/b.ts] *new*
export function bar() { }
//// [/home/src/workspaces/project/tsconfig.json] *new*
{
"compilerOptions": {
"composite": true,
},
"files": [
"a.ts"
"b.ts"
]
}
 
tsgo --b
ExitStatus:: DiagnosticsPresent_OutputsGenerated
Output::
tsconfig.json:7:9 - error TS1005: ',' expected.
 
7 "b.ts"
~~~~~~
 
 
Found 1 error in tsconfig.json:7
 
//// [/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/a.d.ts] *new*
export declare function foo(): void;
 
//// [/home/src/workspaces/project/a.js] *new*
export function foo() { }
 
//// [/home/src/workspaces/project/b.d.ts] *new*
export declare function bar(): void;
 
//// [/home/src/workspaces/project/b.js] *new*
export function bar() { }
 
//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new*
{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.es2025.full.d.ts","./a.ts","./b.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":"b8af959ef8294c415b0415508643e446-export function foo() { }","signature":"7ffb4ea6089b1a385965a214ba412941-export declare function foo(): void;\n","impliedNodeFormat":1},{"version":"492f7ec5be310332dc7e2ef503772d24-export function bar() { }","signature":"2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./b.d.ts"}
//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new*
{
"version": "FakeTSVersion",
"errors": true,
"root": [
{
"files": [
"./a.ts",
"./b.ts"
],
"original": [
2,
3
]
}
],
"fileNames": [
"lib.es2025.full.d.ts",
"./a.ts",
"./b.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": "./a.ts",
"version": "b8af959ef8294c415b0415508643e446-export function foo() { }",
"signature": "7ffb4ea6089b1a385965a214ba412941-export declare function foo(): void;\n",
"impliedNodeFormat": "CommonJS",
"original": {
"version": "b8af959ef8294c415b0415508643e446-export function foo() { }",
"signature": "7ffb4ea6089b1a385965a214ba412941-export declare function foo(): void;\n",
"impliedNodeFormat": 1
}
},
{
"fileName": "./b.ts",
"version": "492f7ec5be310332dc7e2ef503772d24-export function bar() { }",
"signature": "2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n",
"impliedNodeFormat": "CommonJS",
"original": {
"version": "492f7ec5be310332dc7e2ef503772d24-export function bar() { }",
"signature": "2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n",
"impliedNodeFormat": 1
}
}
],
"options": {
"composite": true
},
"latestChangedDtsFile": "./b.d.ts",
"size": 1320
}
 
tsconfig.json::
SemanticDiagnostics::
*refresh* /home/src/tslibs/TS/Lib/lib.es2025.full.d.ts
*refresh* /home/src/workspaces/project/a.ts
*refresh* /home/src/workspaces/project/b.ts
Signatures::
(stored at emit) /home/src/workspaces/project/a.ts
(stored at emit) /home/src/workspaces/project/b.ts
 
 
Edit [0]:: reports syntax errors after change to config file
//// [/home/src/workspaces/project/tsconfig.json] *modified*
{
"compilerOptions": {
"composite": true, "declaration": true
},
"files": [
"a.ts"
"b.ts"
]
}
 
tsgo --b
ExitStatus:: DiagnosticsPresent_OutputsGenerated
Output::
tsconfig.json:7:9 - error TS1005: ',' expected.
 
7 "b.ts"
~~~~~~
 
 
Found 1 error in tsconfig.json:7
 
 
tsconfig.json::
SemanticDiagnostics::
Signatures::
 
 
Edit [1]:: reports syntax errors after change to ts file
//// [/home/src/workspaces/project/a.ts] *modified*
export function foo() { }export function fooBar() { }
 
tsgo --b
ExitStatus:: DiagnosticsPresent_OutputsGenerated
Output::
tsconfig.json:7:9 - error TS1005: ',' expected.
 
7 "b.ts"
~~~~~~
 
 
Found 1 error in tsconfig.json:7
 
//// [/home/src/workspaces/project/a.d.ts] *modified*
export declare function foo(): void;
export declare function fooBar(): void;
 
//// [/home/src/workspaces/project/a.js] *modified*
export function foo() { }
export function fooBar() { }
 
//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.es2025.full.d.ts","./a.ts","./b.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":"12981c250647eb82bb45c5fb79732976-export function foo() { }export function fooBar() { }","signature":"f3ff291f5185ac75eeeb6de19fc28a01-export declare function foo(): void;\nexport declare function fooBar(): void;\n","impliedNodeFormat":1},{"version":"492f7ec5be310332dc7e2ef503772d24-export function bar() { }","signature":"2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"declaration":true},"latestChangedDtsFile":"./a.d.ts"}
//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
{
"version": "FakeTSVersion",
"errors": true,
"root": [
{
"files": [
"./a.ts",
"./b.ts"
],
"original": [
2,
3
]
}
],
"fileNames": [
"lib.es2025.full.d.ts",
"./a.ts",
"./b.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": "./a.ts",
"version": "12981c250647eb82bb45c5fb79732976-export function foo() { }export function fooBar() { }",
"signature": "f3ff291f5185ac75eeeb6de19fc28a01-export declare function foo(): void;\nexport declare function fooBar(): void;\n",
"impliedNodeFormat": "CommonJS",
"original": {
"version": "12981c250647eb82bb45c5fb79732976-export function foo() { }export function fooBar() { }",
"signature": "f3ff291f5185ac75eeeb6de19fc28a01-export declare function foo(): void;\nexport declare function fooBar(): void;\n",
"impliedNodeFormat": 1
}
},
{
"fileName": "./b.ts",
"version": "492f7ec5be310332dc7e2ef503772d24-export function bar() { }",
"signature": "2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n",
"impliedNodeFormat": "CommonJS",
"original": {
"version": "492f7ec5be310332dc7e2ef503772d24-export function bar() { }",
"signature": "2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n",
"impliedNodeFormat": 1
}
}
],
"options": {
"composite": true,
"declaration": true
},
"latestChangedDtsFile": "./a.d.ts",
"size": 1408
}
 
tsconfig.json::
SemanticDiagnostics::
*refresh* /home/src/workspaces/project/a.ts
Signatures::
(computed .d.ts) /home/src/workspaces/project/a.ts
 
 
Edit [2]:: no change
 
tsgo --b
ExitStatus:: DiagnosticsPresent_OutputsGenerated
Output::
tsconfig.json:7:9 - error TS1005: ',' expected.
 
7 "b.ts"
~~~~~~
 
 
Found 1 error in tsconfig.json:7
 
 
tsconfig.json::
SemanticDiagnostics::
Signatures::
 
 
Edit [3]:: builds after fixing config file errors
//// [/home/src/workspaces/project/tsconfig.json] *modified*
{
"compilerOptions": {
"composite": true, "declaration": true
},
"files": [
"a.ts",
"b.ts"
]
}
 
tsgo --b
ExitStatus:: Success
Output::
//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.es2025.full.d.ts","./a.ts","./b.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":"12981c250647eb82bb45c5fb79732976-export function foo() { }export function fooBar() { }","signature":"f3ff291f5185ac75eeeb6de19fc28a01-export declare function foo(): void;\nexport declare function fooBar(): void;\n","impliedNodeFormat":1},{"version":"492f7ec5be310332dc7e2ef503772d24-export function bar() { }","signature":"2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"declaration":true},"latestChangedDtsFile":"./a.d.ts"}
//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
{
"version": "FakeTSVersion",
"root": [
{
"files": [
"./a.ts",
"./b.ts"
],
"original": [
2,
3
]
}
],
"fileNames": [
"lib.es2025.full.d.ts",
"./a.ts",
"./b.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": "./a.ts",
"version": "12981c250647eb82bb45c5fb79732976-export function foo() { }export function fooBar() { }",
"signature": "f3ff291f5185ac75eeeb6de19fc28a01-export declare function foo(): void;\nexport declare function fooBar(): void;\n",
"impliedNodeFormat": "CommonJS",
"original": {
"version": "12981c250647eb82bb45c5fb79732976-export function foo() { }export function fooBar() { }",
"signature": "f3ff291f5185ac75eeeb6de19fc28a01-export declare function foo(): void;\nexport declare function fooBar(): void;\n",
"impliedNodeFormat": 1
}
},
{
"fileName": "./b.ts",
"version": "492f7ec5be310332dc7e2ef503772d24-export function bar() { }",
"signature": "2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n",
"impliedNodeFormat": "CommonJS",
"original": {
"version": "492f7ec5be310332dc7e2ef503772d24-export function bar() { }",
"signature": "2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n",
"impliedNodeFormat": 1
}
}
],
"options": {
"composite": true,
"declaration": true
},
"latestChangedDtsFile": "./a.d.ts",
"size": 1394
}
 
tsconfig.json::
SemanticDiagnostics::
Signatures::