Oxlint Powered by tsrs: Up to 7x Faster Type-Aware TypeScript Linting with 75% Less MemoryNote · digest for November 18
Oxlint Powered by tsrs: Up to 7x Faster Type-Aware TypeScript Linting with 75% Less Memory
Note3 sections≈ 4 min

Oxlint Powered by tsrs: Up to 7x Faster Type-Aware TypeScript Linting with 75% Less Memory

Can you run strict, type-aware TypeScript linting after every edit or commit without waiting minutes for CI to finish? In large repositories, that check often becomes the slowest stage in the pipeline.

A basic linter only scans a single file to catch a missing semicolon or extra indentation. When you turn on type-aware linting, however, the analyzer has to trace cross-module links and resolve types for every variable and function. To eliminate that bottleneck, the Oxlint team wired up tsrs, a Rust port of the TypeScript compiler that speeds up checks and slashes memory usage.

Why the Classic Stack Slows Down

Let's see why combining typescript-eslint and tsc in Node.js struggles on large projects. To analyze code, a parser first builds an Abstract Syntax Tree (AST) in memory. Standard style rules only read that single-file tree and run fast.

Once you enable type-aware rules, typescript-eslint has to spin up a full tsc compiler instance inside Node.js, build a project-wide type graph, and keep it in memory. Then in CI, you run tsc --noEmit as a separate step, forcing the compiler to do the exact same work a second time. On big codebases, this double pass easily consumes gigabytes of RAM and minutes of build time.

Even with the Go-based tsgolint backend, linting and compilation remained two separate processes. As long as the type checker and linter live apart and each reads the project its own way, you pay for double CPU and memory work.

How tsrs Combines Type Analysis and Linting in One Pass

Max Schwenk from Owner.com originally created tsrs with AI agents, validating the Rust port against TypeScript's official conformance test suite. Now the engine is developed inside the Oxc ecosystem with support from Cloudflare and VoidZero, even compiles to WebAssembly, and already runs on projects at Cloudflare, Owner.com, and OpenAI.

Moving both stages to Rust means the compiler and linter no longer parse files twice or pass structures between processes. In a single pass, the parser builds the syntax tree, tsrs resolves types, and the linter immediately runs all 61 rules from tsgolint v7.0.2007 with familiar autofixes and hints. An optional fast mode also tunes worker counts, groups related tasks, and enables memory-optimized caching.

According to Oxc's benchmarks, the gains stand out even against the fast Go engine. For type-aware linting alone, tsrs beats tsgolint v7.0.2007 by up to 5x using roughly 70% less memory, and outpaces typescript-eslint by up to 98x while saving up to 82% of peak RAM. When combining type checking and linting in one run, the lead over tsgolint grows to 7x with up to 75% less memory, while typescript-eslint plus tsc trails by up to 122x with the same 82% memory savings.

How to Switch to tsrs and Play It Safe

For a standard TypeScript project, migration takes two packages and a familiar command. Open a terminal in your repository root and update your dependencies:

pnpm i -D oxlint tsrs
pnpx oxlint --type-aware

Once installed, oxlint automatically detects tsrs and switches to it without rule changes. If your .oxlintrc.json already sets options.typeAware: true, you don't even have to touch your scripts—just run your usual lint command.

To avoid running a separate tsc step afterward, pass a second flag for combined type checking:

pnpx oxlint --type-aware --type-check

In this mode, the CLI reports TypeScript compiler errors alongside linter warnings in one pass over your files. In CI, this replaces the classic tsc --noEmit && eslint chain with a single command and no duplicate parsing.

If you already use Vite+, you don't need to wire up dependencies manually:

vp upgrade
vp check

Starting with version 1.7.0, vp upgrade in Vite+ pulls in the new backend automatically, so vp check and vp lint run on tsrs out of the box. Keep in mind that on tricky edge cases—like deep recursive conditional types and higher-order generics—the Rust port is still catching up to reference tsc. Before removing your old CI check, run the new and old pipelines side by side, compare exit codes and errors, and report any mismatches to the Oxc issue tracker.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 2