Files
tsgo/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-declaration.js

6.3 KiB

currentDirectory::/user/username/projects/noEmitOnError
useCaseSensitiveFileNames::true
Input::
//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new*
export interface A {
name: string;
}
//// [/user/username/projects/noEmitOnError/src/main.ts] *new*
import { A } from "../shared/types/db";
const a: string = 10;
//// [/user/username/projects/noEmitOnError/src/other.ts] *new*
console.log("hi");
export { }
//// [/user/username/projects/noEmitOnError/tsconfig.json] *new*
{
"compilerOptions": {
"outDir": "./dev-build",
"declaration": true,
"incremental": false,
"noEmitOnError": true,
},
}
 
tsgo -b -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 output file 'dev-build/tsconfig.tsbuildinfo' does not exist
 
[HH:MM:SS AM] Building project 'tsconfig.json'...
 
src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'.
 
2 const a: string = 10;
~
 
 
Found 1 error in src/main.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; };
//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new*
{"version":"FakeTSVersion","root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"semanticErrors":true}
//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new*
{
"version": "FakeTSVersion",
"root": [
{
"files": [
"../shared/types/db.ts"
],
"original": "../shared/types/db.ts"
},
{
"files": [
"../src/main.ts"
],
"original": "../src/main.ts"
},
{
"files": [
"../src/other.ts"
],
"original": "../src/other.ts"
}
],
"size": 117,
"semanticErrors": true
}
 
tsconfig.json::
SemanticDiagnostics::
*refresh* /home/src/tslibs/TS/Lib/lib.es2025.full.d.ts
*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts
*refresh* /user/username/projects/noEmitOnError/src/main.ts
*refresh* /user/username/projects/noEmitOnError/src/other.ts
Signatures::
 
 
Edit [0]:: no change
 
tsgo -b -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 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors.
 
[HH:MM:SS AM] Building project 'tsconfig.json'...
 
src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'.
 
2 const a: string = 10;
~
 
 
Found 1 error in src/main.ts:2
 
//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *rewrite with same content*
//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content*
 
tsconfig.json::
SemanticDiagnostics::
*refresh* /home/src/tslibs/TS/Lib/lib.es2025.full.d.ts
*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts
*refresh* /user/username/projects/noEmitOnError/src/main.ts
*refresh* /user/username/projects/noEmitOnError/src/other.ts
Signatures::
 
 
Edit [1]:: Fix error
//// [/user/username/projects/noEmitOnError/src/main.ts] *modified*
import { A } from "../shared/types/db";
const a: string = "hello";
 
tsgo -b -v
ExitStatus:: Success
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 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors.
 
[HH:MM:SS AM] Building project 'tsconfig.json'...
 
//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *new*
export interface A {
name: string;
}
 
//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new*
export {};
 
//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *new*
export {};
 
//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new*
const a = "hello";
export {};
 
//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *new*
export {};
 
//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new*
console.log("hi");
export {};
 
//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified*
{"version":"FakeTSVersion","root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"]}
//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
{
"version": "FakeTSVersion",
"root": [
{
"files": [
"../shared/types/db.ts"
],
"original": "../shared/types/db.ts"
},
{
"files": [
"../src/main.ts"
],
"original": "../src/main.ts"
},
{
"files": [
"../src/other.ts"
],
"original": "../src/other.ts"
}
],
"size": 95
}
 
tsconfig.json::
SemanticDiagnostics::
*refresh* /home/src/tslibs/TS/Lib/lib.es2025.full.d.ts
*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts
*refresh* /user/username/projects/noEmitOnError/src/main.ts
*refresh* /user/username/projects/noEmitOnError/src/other.ts
Signatures::
 
 
Edit [2]:: no change
 
tsgo -b -v
ExitStatus:: Success
Output::
[HH:MM:SS AM] Projects in this build:
* tsconfig.json
 
[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/shared/types/db.js'