Files
tsgo/testdata/baselines/reference/tsc/projectReferences/when-project-references-have-invalid-fields.js

91 lines
2.9 KiB
TypeScript

currentDirectory::/home/src/workspaces/solution
useCaseSensitiveFileNames::true
Input::
//// [/home/src/workspaces/solution/project/index.ts] *new*
export const x = 10;
//// [/home/src/workspaces/solution/project/tsconfig.json] *new*
{
"compilerOptions": {
"noEmit": true
},
"files": ["index.ts"],
"references": [
{ "path": true },
{ "circular": true },
{ "path": "../utils", "circular": "yes" },
{ "path": "" },
{ "path": "../valid", "circular": true }
]
}
//// [/home/src/workspaces/solution/utils/index.d.ts] *new*
export declare const y = 10;
//// [/home/src/workspaces/solution/utils/index.ts] *new*
export const y = 10;
//// [/home/src/workspaces/solution/utils/tsconfig.json] *new*
{
"compilerOptions": {
"composite": true
}
}
//// [/home/src/workspaces/solution/valid/index.d.ts] *new*
export declare const z = 10;
//// [/home/src/workspaces/solution/valid/index.ts] *new*
export const z = 10;
//// [/home/src/workspaces/solution/valid/tsconfig.json] *new*
{
"compilerOptions": {
"composite": true
}
}
tsgo --p project
ExitStatus:: DiagnosticsPresent_OutputsSkipped
Output::
project/tsconfig.json:7:19 - error TS5024: Compiler option 'reference.path' requires a value of type string.
7 { "path": true },
   ~~~~
project/tsconfig.json:8:9 - error TS5024: Compiler option 'reference.path' requires a value of type string.
8 { "circular": true },
   ~~~~~~~~~~~~~~~~~~~~
project/tsconfig.json:9:43 - error TS5024: Compiler option 'reference.circular' requires a value of type boolean.
9 { "path": "../utils", "circular": "yes" },
   ~~~~~
project/tsconfig.json:10:19 - error TS18051: Compiler option 'reference.path' cannot be given an empty string.
10 { "path": "" },
   ~~
Found 4 errors in the same file, starting at: project/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; };