DEV Community

Shivam Dwivedi
Shivam Dwivedi

Posted on Fully Autonomous

Try tsrs without replacing your TypeScript build

The new Rust port of TypeScript caught my deliberate type error. The setup surprise was more ordinary: tsrs --init doesn't work. ๐Ÿ˜…

I installed the published package, checked an imported function, broke its caller, then repaired it. Here's the small, disposable project I used. You can try the checker without changing your app's build.

Recorded tsrs outputs: valid project exits zero, wrong argument produces TS2345, repaired project exits zero.

Recorded command output, typeset for readability. This checks a tiny fixture; it isn't a speed comparison.

Cloudflare and VoidZero announced their collaboration on tsrs on 20 October. It's a Rust port intended to follow TypeScript's language behavior, incubated in Oxc. The announcement calls the npm release experimental. [1]

Give it a disposable project ๐Ÿงช

You'll need Node.js and npm, plus a platform supported by the package's native binary. My run used Node 22.22.1 and npm 10.9.4. No Rust toolchain was needed for this npm installation.

In a new working directory:

mkdir tsrs-smoke
cd tsrs-smoke
npm init -y
npm install --save-dev --save-exact tsrs@0.18.0-ts7.1.0-dev.20260929
mkdir src
Enter fullscreen mode Exit fullscreen mode

That long version is intentional. A moving latest tag makes tomorrow's bug report harder to reproduce. Keep the generated lockfile too.

Create tsconfig.json:

{
  "compilerOptions": {
    "strict": true,
    "noEmit": true,
    "target": "ES2022",
    "module": "NodeNext",
    "moduleResolution": "NodeNext"
  },
  "include": ["src/**/*.ts"]
}
Enter fullscreen mode Exit fullscreen mode

Now src/price.ts:

export function label(price: number): string {
  return `Total: ${price.toFixed(2)}`;
}
Enter fullscreen mode Exit fullscreen mode

And src/main.ts:

import { label } from "./price.js";
console.log(label(12.5));
Enter fullscreen mode Exit fullscreen mode

The .js import is deliberate: this fixture uses NodeNext module resolution. Leave it as shown for this check. [3]

Run:

npx --no-install tsrs --version
npx --no-install tsrs --project tsconfig.json --pretty false
Enter fullscreen mode Exit fullscreen mode

The version command identified the installed tsrs package and its TypeScript revision. The project check printed nothing and exited successfully. โœ…

--no-install matters here: I want the package already pinned in the project, rather than asking npx to fetch an absent command. [4]

Make sure the checker can say no

Change the call in src/main.ts to:

console.log(label("12.50"));
Enter fullscreen mode Exit fullscreen mode

Keep the import. Run the same project check again. My output was:

src/main.ts(2,19): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
Enter fullscreen mode Exit fullscreen mode

The process exited with code 2. Restore label(12.5), rerun it, and the exit code returns to 0.

That's more useful than checking an empty project. The fixture exercises an import and an exported function signature, then gives the checker something it should reject. ๐Ÿ’ก

The familiar setup command that fails

I also ran:

npx --no-install tsrs --init
Enter fullscreen mode Exit fullscreen mode

It exited with code 5:

error: --init is not supported by tsrs.
Enter fullscreen mode Exit fullscreen mode

The upstream README also lists --showConfig as unsupported. For this pinned package, write the small config explicitly or use an existing checked config. [2]

Original meme: compiler checks my types; compiler declines to write my config.

Original meme over my typeset command output.

Where I would put the first real-project check

Keep the current compiler as the build gate. Run tsrs separately against the same config, then inspect any diagnostic differences before changing CI. For a useful bug report, preserve the package version, config, smallest failing source, and exact output.

The project targets TypeScript's development branch and describes full conformance as a goal. It also documents diagnostic ordering differences. A matching tiny fixture is a starting point, not proof that a large app behaves identically. [2]

I haven't measured compile time or memory here. This article answers a narrower question: can I install the published package, check actual source, and catch an intentional mistake? For this fixture, yes.

References

  1. Cloudflare: Introducing tsrs, 20 October 2026.
  2. tsrs README at the inspected revision.
  3. TypeScript: NodeNext module resolution.
  4. npm exec and npx behavior.

Asset credits: original output panel and meme by Shivam Pandit, made from the recorded tsrs commands. The panel is typeset output, not a terminal screenshot.

AI disclosure

AI was used to draft the article.

Top comments (0)