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.2× 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 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
- 248 of 12,750 of tsc’s conformance test variants still differ (1.9%)
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 GitHub-hosted Linux runner
The check scenarios benched on every pull request, on GitHub's shared ubuntu-24.04 runner: a cold check (no saved history) of three public projects against TypeScript 7.0.2's native tsc, from the bench of pull request #133 on 2026-11-10. Over the three, ts-r-check took 4,326.8 ms against tsc 7's 5,389.9 ms, about 1.25x faster. Most of that is tRPC (about 2.2x) and date-fns (about 1.9x). On RxJS the gap is small: 3,458.3 ms against 3,645.7 ms, about 1.05x, which is within the spread this runner shows inside one run (up to about 10%, bench/README.md), so treat RxJS as level with tsc 7. On the same run's ubuntu-24.04-arm runner, which reports but does not gate, tsc 7 was faster on RxJS: 3,392.1 ms against ts-r-check's 4,031.2 ms. ts-r-check reports exactly tsc 7's diagnostics on all three projects (bench/README.md, "Diagnostics against tsc 7", and b748322's commit message: still 0 extra and 0 missing). With its saved history and nothing changed it took 31.7 ms on tRPC, 81.8 ms on date-fns and 62.7 ms on RxJS. TypeORM and Playwright are not in the pull request bench'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 | 31.7 ms | 2,921.4 ms |
| date-fns | 81.8 ms | 1,116.9 ms |
| RxJS | 62.7 ms | 6,115.9 ms |
How we measured
- Measured
- Wall time with hyperfine 1.20.0 (cargo xtask bench --repos), median of 5 runs after 1 warm-up (bench/scenarios.toml); peak memory not measured on this run. Every tool checks the same wrapper tsconfig (noEmit, not incremental). Results from the bench comment of pull request #133 (run https://github.com/Webb-Ventures/typescript-rust/actions/runs/42764854681, linux-x64 gate)
- Machine
- GitHub-hosted ubuntu-24.04 runner (the linux-x64 bench gate: x64, 4 vCPU, 16 GB), a shared virtual machine, not a dedicated one; release build, 4 threads. The CPU model is not recorded with the result. Measured on one commit over three nights (bench/README.md), this runner varied 1-6% between nights on most scenarios and 16-21% on the shortest (lint-trpc, run-startup), with up to about 10% spread within a run
- Software
- ts-r-check release build of PR #133's head 63756ad (squash-merged as b748322, the same tree), benchmarked against its base parity/lsp-2 at 93d24e2 on the same runner, with RAYON_NUM_THREADS=4; TypeScript 7.0.2 (native tsc) pinned in bench/package.json; each repo's own TypeScript; Node 24 from actions/setup-node (the exact version is not recorded)
- Input
- tRPC packages/server, date-fns pkgs/core and RxJS packages/rxjs at the commits pinned in bench/repos.toml
- Command
The pull request bench (.github/workflows/bench-actions.yml, .github/scripts/bench-gate.sh): cargo xtask bench --repos trpc,date-fns,rxjs,three-x10- Recorded in
- commit
b748322
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 now reports exactly tsc 7's diagnostics on all five (bench/README.md, "Diagnostics against tsc 7": tRPC, date-fns and TypeORM on 2026-10-24, Playwright and RxJS on 2026-11-10), but these times are from older code (commit 9c3a371), whose diagnostics were not compared in this run.
- 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; 114 of 114 with the same diagnostics
tsc 7.0.2 --showConfig and config diagnostics on the five public bench repos (114 tsconfig files). Commit b5938d0.
- Module resolution100%
158,174 resolutions, 0 mismatches
tsc 7.0.2 --traceResolution on the five public bench repos (114 configs). Commit d5e3943.
- 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 checker98.1%
98.1% exact (all diagnostics and chains); 110 variants with a diagnostic tsc does not report, 4 of them in tests where tsc reports nothing
tsc 7.0.2 conformance baselines, 12,750 compared test variants. Commit 0f29450.
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]