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.

Check all five projects, total wall timeShorter is faster.
  • ts-r-check1,936 ms
  • tsc 7.0.23,044 ms

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.

package.json
  "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 every resolution of the reference app
  • 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
  • 420 of 12,750 of tsc’s conformance test variants still differ (3.3%)

Measured

Every run, on the same reference app 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.

Check all five projects, total wall timeShorter is faster, in ms
  • ts-r
  • Other tools
  • ts-r-check1,936 ms
  • tsc 7.0.23,044 ms
Cold check, wall timeShorter is faster, in ms
  • tRPC packages/server108 ms
  • date-fns pkgs/core226 ms
  • RxJS packages/rxjs462 ms
  • TypeORM packages/typeorm548 ms
  • Playwright592 ms
Cold check, peak memoryShorter is faster, in MB
  • tRPC packages/server117 MB
  • date-fns pkgs/core216 MB
  • RxJS packages/rxjs458 MB
  • TypeORM packages/typeorm377 MB
  • Playwright463 MB
Warm runs, and each repo's own TypeScript
Projectts-r-check, saved history, nothing changedThe repo's own tsc
tRPC23 ms1,130 ms
date-fns78 ms324 ms
RxJS57 ms2,468 ms
TypeORM126 ms3,915 ms
Playwright40 ms4,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%

    49 of 49 configs match

    tsc --showConfig on private-app. Commit 856e43d.

  • Module resolution100%

    63,958 resolutions, 0 mismatches

    tsc --traceResolution, 24 private-app configs. Recorded in crates/ts_r_resolver/AGENTS.md.

  • 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 checker96.7%

    96.7% exact (all diagnostics and chains); 214 variants with a diagnostic tsc does not report, 22 of them in tests where tsc reports nothing

    tsc 7.0.2 conformance baselines, 12,750 compared test variants. Commit 775ce97.

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.

ts-r-check --help
usage: ts-r-check [-p tsconfig.json] [options]