tsrs is a drop-in replacement for the TypeScript 7 compiler and language server, written in Rust.
Our goal is 100% conformance, with much lower memory use and faster type checking. Read the announcement.
pnpm add -D tsrs
pnpm exec tsrs --noEmit --fast
--fast enables performance optimizations, including adaptive checker counts and additional caches.
See fast mode for details.
You can try tsrs today and give us feedback on performance, memory usage, and conformance.
Try checking and emitting code in the browser playground.
We aim to release a stable version against TypeScript 7.1 with 100% conformance. See compatibility and evidence for supported features and known gaps.
Default mode preserves the pinned TypeScript compiler's checker behavior, including known diagnostic differences when checker count or file order changes. This sensitivity is inherited from TypeScript itself. See differences from pinned TypeScript for the remaining runtime differences and unsupported features.
tsrs takes its major and minor version from the TypeScript release it ports and keeps the patch number for itself.
On a TypeScript beta or RC, a release adds a tsrs counter: 7.1.0-rc.1, then 7.1.0-rc.2. Once that TypeScript
minor is stable, the first release is 7.1.0, and each later one bumps the patch, whether it fixes tsrs or picks up a
TypeScript patch. TypeScript numbers its RC X.Y.1-rc and its first stable X.Y.2, so the patch numbers differ:
| Event | TypeScript pin | tsrs release |
|---|---|---|
| Last release in the earlier format | 7.1.0-beta |
7.1.0-beta.tsrs9 |
| TypeScript 7.1 RC | 7.1.1-rc |
7.1.0-rc.1 |
| tsrs fix | 7.1.1-rc |
7.1.0-rc.2 |
| TypeScript 7.1 ships | 7.1.2 |
7.1.0 |
| tsrs fix | 7.1.2 |
7.1.1 |
| TypeScript patch | 7.1.3 |
7.1.2 |
| TypeScript 7.2 beta | 7.2.0-beta |
7.2.0-beta.1 |
| TypeScript 7.2 RC | 7.2.1-rc |
7.2.0-rc.1 |
| TypeScript 7.2 ships | 7.2.2 |
7.2.0 |
Releases publish to npm's latest tag, and tsrs --version and npm metadata name the exact TypeScript version and
commit. Versioning and releases
has the release rules and the parts of the scheme that aren't built yet.
The following defaults and opt-in preset are available in 0.20.0 and later.
By default, tsrs follows the pinned TypeScript compiler's checker settings: four checkers (capped by file count),
Go's file assignment and checker history. Enable the fast preset with --fast or
TSRS_FAST=1:
pnpm exec tsrs --noEmit --fast
# Or enable the same preset through the environment:
TSRS_FAST=1 pnpm exec tsrs --noEmit
Fast mode adapts checker counts to the machine and project, groups related work together, and enables additional
caches and memory optimizations. It keeps strict, skipLibCheck, noCheck and other checking options as configured.
See performance options for configuration, behavior and incremental-cache details.
tsrs-lint can replace tsgolint as the backend for Oxlint's type-aware rules. With --type-check,
the same run also reports the type errors of the files Oxlint lints, as tsgolint does. Available in tsrs 0.23.0 and
later. Oxlint 1.92.0 and later finds tsrs-lint when tsrs is installed and uses it in place of oxlint-tsgolint:
pnpm add -D oxlint tsrs
TSRS_FAST=1 pnpm exec oxlint --type-aware --type-check
Files Oxlint does not lint are not type-checked, so keep a separate tsrs --noEmit run to check whole tsconfig
programs. See type checking in the lint run.
The chart below was measured with tsrs 0.24.0, when --type-check checked whole tsconfig programs.
@tsrs/wasm provides WebAssembly support
targeting wasm32-wasip1 (WASI Preview 1).
- CLI usage and memory tuning
- Editor setup
- Node API
- WebAssembly for Node and browsers
- Benchmarks and methodology
- Release notes
- Engineering notes
The issue tracker is open for bug reports. Please include a minimal reproduction. Pull requests remain closed because we don't have the bandwidth to review them.
See the contributing guide for building from source and running the suites, the Code of Conduct, and security policy for reporting vulnerabilities.
We thank the following organizations and contributors:
- Depot CI for sponsoring our continuous integration.
- Owner.com for sponsoring the initial work.
- Max Schwenk for the port.
- @walkerdb for improvements to the project.
- @JiangWeixian for transferring the
tsrsnpm package name.
We extend special thanks to the TypeScript team for their support.
tsrs is a derivative of TypeScript (Copyright Microsoft Corporation), licensed under Apache-2.0.
The bundled lib.*.d.ts files are TypeScript's. See NOTICE for attribution.
Not affiliated with or endorsed by Microsoft.