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.
Versions identify the supported TypeScript release and an unpadded tsrs revision. For TypeScript 7.1.0-beta,
7.1.0-beta.tsrs1 is the first tsrs release and 7.1.0-beta.tsrs2 is the next fix. Stable TypeScript 7.1.0
uses 7.1.0-tsrs1.
SemVer compares tsrsN as text, so tsrs10 sorts before tsrs9; further sequential revisions require a new
TypeScript version. These versions are tsrs prereleases, including those targeting stable TypeScript, and publish
to npm's next tag (pnpm add -D tsrs@next). The compiler's TypeScript
compatibility version and exact source commit remain available separately in tsrs --version and npm metadata.
See versioning and releases
for nightly versions and release ordering.
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 --noEmitFast 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 each tsconfig program it lints, so it can replace a separate
tsrs --noEmit run over the same tsconfigs. 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-checkEach program is then parsed and checked once instead of twice. See type checking in the lint run.
@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.