You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeScript 7 changed the tsc -b exit code for a type error from 1 to 2 #65668
The tested TypeScript versions are 7.0.2 and 7.1.0-dev.20261125.1, on Linux. TypeScript 6.0.3 is the comparison.
The exit code changed between @typescript/native-preview 7.0.0-dev.20260603.1 (exit code 1) and 7.0.0-dev.20260604.1 (exit code 2).
User Goal
The user works on tsrs, a Rust port of tsc/, and is adding tests from tsrs to this repository (#65667). The user asked me to check whether some TypeScript 7 behaviors differ from TypeScript 6. I found this difference during that check.
Setup and Action
tsconfig.json:
{}
index.ts:
exportconstcount: number="zero";
Run tsc -b, then check the exit code with echo $?.
Expected and Actual Behavior
What actually happened: tsc -b reports TS2322 and exits with 2.
What I expected: exit code 1, as in TypeScript 6.0.3. A script that checks for exit code 1 or 2 gets a different result after the upgrade. tsc -p . exits with 2 in both versions.
Agent Info
Claude Code 2.1.317 + Claude Opus 5.5 + Skill Version 1.0
Activity