v0.2.171. Passing --lib turns the checker off. It still reports the same block and expression counts, and exits 0, so it looks like a clean run.
Repro
Put an unambiguous type error in a <script server> block:
<script server>
const __sabotage: number = "definitely a string"
</script>$ stx typecheck 'resources/views/pricing.stx'
pricing.stx:13:7 error TS2322 Type 'string' is not assignable to type 'number'. [<script server>]
Checked 2 script block(s) and 10 template expression(s) in 1 file(s) — 4 error(s), 0 warning(s)
$ stx typecheck 'resources/views/pricing.stx' --lib types/session.d.ts
Checked 2 script block(s) and 10 template expression(s) in 1 file(s) — 0 error(s), 0 warning(s)Same file, same counts, exit 0. Every diagnostic is gone — not just ones relating to the lib.
Why this is worse than it looks
--lib is exactly the flag you reach for when the checker cannot see your app's types. On a real app (39 .stx files) the unwired run reported 220 errors, of which ~89 were TS2304 Cannot find name / TS2307 Cannot find module for the app's own SessionStore, AuthResponse and friends. The obvious fix is to point --lib at types/*.d.ts — and that turns 220 into 0.
The natural conclusion is "wired up correctly, codebase is clean." It is not; the checker stopped reporting. I nearly recommended exactly that as a CI gate.
Likely cause
This is the failure mode typecheck.ts already documents in its own comments — a syntax error in any file added to the program makes tsc abort and report nothing about user code, because skipLibCheck only suppresses semantic diagnostics:
stx.d.ts types them richly, but including it drags in the package's built declarations, and
dist/composables.d.tsis currently syntactically invalid … tsc aborts on a SYNTAX error in a lib file … so the checker reported nothing at all about the user's code.
So --lib is presumably appending to the same files array and hitting the same class of abort — or the ambient globals file and the lib are colliding. Either way the symptom is identical: tsc exits without diagnostics and the parser sees no TSC_LINE_RE matches, which reads as success.
Suggested fix
- Fail loudly instead of silently. If tsc produces no parseable diagnostic lines and exited non-zero, that is an abort, not a clean run — surface the raw output rather than printing
0 error(s). - Ideally check each
--libparses before adding it, and name the one that broke.
The distinction matters: "0 errors" and "the compiler refused to run" should never render the same way, especially for something intended as a CI gate.
Related: #1905 (codemod false positives, found in the same sweep).