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.
3.5× 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 on a dedicated Linux machine
The check scenarios the review box runs on every pull request, on four dedicated Linux cores: a cold check (no saved history) of three public projects against TypeScript 7.0.2's native tsc, from the bench of pull request #42 on 2026-10-24. These are the numbers in the README's benchmark table. ts-r-check reports exactly tsc's diagnostics on tRPC and date-fns, 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. With its saved history and nothing changed it took 140.9 ms on RxJS, but 401.0 ms on tRPC and 1,020.4 ms on date-fns, about as long as a cold check there. TypeORM and Playwright are not in the review box's set, and peak memory was not measured on this run: both are in the shared-laptop run below, which is older.
- ts-r
- Other tools
| Project | ts-r-check, saved history, nothing changed | The repo's own tsc |
|---|---|---|
| tRPC | 401.0 ms | 5,176.7 ms |
| date-fns | 1,020.4 ms | 1,970.2 ms |
| RxJS | 140.9 ms | 14,249.3 ms |
How we measured
- Measured
- Wall time with hyperfine (cargo xtask bench --repos), median of 5 runs after 1 warm-up; peak memory not measured on this run. Every tool checks the same wrapper tsconfig (noEmit, not incremental)
- Machine
- Linux x86-64: four cores of the review box's bench machine, a cpuset nothing else is scheduled on while it measures (one bench slot); release build. The CPU model is not recorded with the result
- Software
- ts-r-check release build of PR #42's head d8a6a97 (merged as 8b6c630), benchmarked against main at 0697824: the two differ only in ts_r_run, which no scenario here runs; TypeScript 7.0.2 (native tsc) pinned in bench/package.json; each repo's own TypeScript
- Input
- tRPC packages/server, date-fns pkgs/core and RxJS packages/rxjs at the commits pinned in bench/repos.toml
- Command
The review box's pull request bench (bench.yml): cargo xtask bench --repos trpc,date-fns,rxjs,three-x10- Recorded in
- commit
1a20ed6
ts-r-check against tsc 7.0.2 on five projects, shared laptop
Type checking five public projects from the command line, cold (no saved history), against TypeScript 7.0.2's native tsc, on the shared laptop on 2026-10-16 at commit 9c3a371: older code than the Linux run above, with peak memory and two more projects. 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]