ts-r-check
Type checker. Replaces tsc.
- Alpha
- On npm
ts-r-check type-checks a TypeScript project and prints diagnostics in tsc’s format, with tsc’s error codes. Like tsc, it writes JavaScript, source maps and declarations unless noEmit is set; --noEmit only checks. It is the least finished part of ts-r, and it follows one rule: no false positives first.
1.6× faster type checks
What switching looks like
ts-r-check reads the config you already have, so switching is a change to the command, not the project.
"scripts": {
- "typecheck": "tsc --noEmit -p tsconfig.json",
+ "typecheck": "ts-r-check --noEmit -p tsconfig.json",
}
What works, and what doesn’t yet
Works today
- Loading the project from tsconfig.json, including extends, with tsc’s config diagnostics
- Module resolution that matches tsc’s on all but 10 of 158,174 resolutions in five public repos
- Assignability, calls and overloads, generics and inference, unions and narrowing
- keyof, mapped, conditional and literal types; classes, declarations and unused-code checks
- tsc’s output in both plain and pretty form, with tsc’s exit codes
Not yet
- Octal escapes in strings (TS1487) only with --no-history; no “Did you mean” suggestions on regular expression errors (TS1369)
- Some inference: contextual types through reverse mapped types
- Some relation and narrowing results, mostly in TS2322, TS2339 and TS2345
- 385 of 12,750 of tsc’s conformance test variants still differ (3.0%)
Measured
Every run, on the same pinned public projects as the home page, with the command and commit that recorded it.
ts-r-check against tsc 7.0.2
Type checking five public projects from the command line, cold (no saved history), against TypeScript 7.0.2's native tsc. Some of these repos do not type-check cleanly under TypeScript 7. ts-r-check reports exactly tsc's diagnostics on tRPC, date-fns and TypeORM; on Playwright it reports 2 extra, and on RxJS 6 extra and misses 5 of about 21,900 (2026-10-24, 087afc9). It also skips checks it does not implement yet, so these times will move as the checker grows.
- ts-r
- Other tools
| Project | ts-r-check, saved history, nothing changed | The repo's own tsc |
|---|---|---|
| tRPC | 23 ms | 1,130 ms |
| date-fns | 78 ms | 324 ms |
| RxJS | 57 ms | 2,468 ms |
| TypeORM | 126 ms | 3,915 ms |
| Playwright | 40 ms | 4,754 ms |
How we measured
- Measured
- Wall time with hyperfine (cargo xtask bench --repos), median of 5 runs; peak RSS of one extra run. Every tool checks the same wrapper tsconfig (noEmit, not incremental)
- Machine
- Apple M-series MacBook (macOS arm64, 16 cores, 48 GB), shared with other jobs while measuring; release build, 4 threads
- Software
- ts-r-check release build; TypeScript 7.0.2 (native tsc) pinned in bench/package.json; each repo's own TypeScript
- Input
- tRPC, date-fns, RxJS, TypeORM and Playwright at the commits pinned in bench/repos.toml
- Command
cargo xtask bench --fetch-repos --repos trpc,date-fns,rxjs,typeorm,playwright && cargo xtask bench --repos trpc,date-fns,rxjs,typeorm,playwright --memory check-- Recorded in
- commit
9c3a371
Correctness
Compared with the tool ts-r-check replaces, on its own tests and on real code.
- tsconfig loading100%
114 of 114 --showConfig outputs match; 111 of 114 with the same diagnostics (3 differ in a message's text)
tsc 7.0.2 --showConfig and config diagnostics on the five public bench repos (114 tsconfig files). Commit ea41eac.
- Module resolution99.9%
158,174 resolutions, 10 mismatches (one require of vitest, in two tRPC configs)
tsc 7.0.2 --traceResolution on the five public bench repos (114 configs). Commit ea41eac.
- Binder diagnostics90.0%
418 of 464 tests exact; 1,720 of 1,839 diagnostics found
tsc 7.0.2 baselines for the binder's codes (12,783 variants). Commit 4224610.
- Type checker97.0%
97.0% exact (all diagnostics and chains); 191 variants with a diagnostic tsc does not report, 10 of them in tests where tsc reports nothing
tsc 7.0.2 conformance baselines, 12,750 compared test variants. Commit 9b5f8f2.
Command line
An excerpt of ts-r-check --help. You can also run it through the launcher as ts-r check.
Next to tsc
ts-r-check reads the same tsconfig.json and prints the same format, so editor problem matchers and CI annotations that parse tsc’s output work unchanged. An error from ts-r-check is very likely one tsc reports too, but a clean run doesn’t mean tsc is clean. Keep tsc in CI until ts-r-check covers the features your project uses.
usage: ts-r-check [-p tsconfig.json] [options]