Rust · Node · C ABI

corsa-bind

Author type-aware lint rules with real Corsa types — plus a stdio API + LSP and zero-cost hot paths. No forks, no patches.

  • type-aware custom rules
  • 59 tsgolint-parity rules
  • real types from Corsa
no-floating-await.ts
import { OxlintUtils } from "corsa-oxlint";

export const rule = createRule({
  create(context) {
    const services = OxlintUtils.getParserServices(context);
    const checker = services.program.getTypeChecker();
    return {
      AwaitExpression(node) {
        const type = checker.getTypeAtLocation(node.argument);
        if (!isThenable(type)) context.report({ node });
      },
    };
  },
});

corsa-bind

Native Rust and JavaScript bindings for the Corsa TypeScript checker — fast, type-aware tooling without reimplementing the checker and without forking it.

Corsa is Microsoft's native Go port of the TypeScript compiler — the TypeScript 7 / "native preview" line, commonly known as tsgo. It is the same engine that powers tsgo's --noEmit type checking, exposed over stdio.

corsa-bind is a multi-crate workspace for talking to that checker. Hot paths live in Rust and stay zero-cost; napi-rs and a shared C ABI surface that performance to JavaScript, C, C++, Go, Zig, C#, Swift, and MoonBit — so you can build custom checker tooling and type-aware lint rules on top of the real upstream checker, with no forks and no patches.

Quick start

corsa-bind runs on top of Oxlint. Install the plugin from npm:

bash
npm i corsa-oxlint

Register the plugin in your Oxlint config and point settings.corsaOxlint at your tsconfig.json and a Corsa (tsgo) binary — that is what makes the rules type-aware:

js
// oxlint.config.js
import { corsaOxlintPlugin } from "corsa-oxlint/rules";

export default [
  {
    settings: {
      corsaOxlint: {
        parserOptions: {
          project: ["./tsconfig.json"],
          corsa: { executable: "./.cache/corsa" },
        },
      },
    },
    plugins: { typescript: corsaOxlintPlugin },
    rules: {
      "typescript/no-floating-promises": "error",
      "typescript/no-misused-promises": "error",
    },
  },
];

Then run Oxlint:

bash
npx oxlint

The Getting started guide covers the Corsa binary, authoring your own type-aware rules, and the @corsa-bind/napi and Rust entry points.

Why corsa-bind

  • Rust-first performance. Hot paths are zero-cost Rust with msgpack-first stdio defaults; JS/TS authoring keeps full ergonomics through napi-rs.
  • Type-aware Oxlint. Author Oxlint plugins with real Corsa type information, backed by native rule implementations ported from tsgolint.
  • Bindings everywhere. One C ABI (corsa_ffi) powers C, C++, Go, Zig, C#, Swift, and MoonBit; @corsa-bind/napi covers Node.js, Deno, and Bun.
  • Reproducible upstream. ref/corsa-upstream is pinned by exact commit with a strict no forks, no patches policy, so behavior stays auditable.

Start here

Use the bindings

  • Node.js binding — the full @corsa-bind/napi surface for Node, Deno, and Bun.
  • Language bindings — the corsa_ffi C ABI for C, C++, Go, Zig, C#, Swift, MoonBit.
  • Type-aware Oxlintcorsa-oxlint rule authoring, native rules, and stylistic rules.
  • Native rules — the full set of type-aware rules implemented natively in Rust.
  • Stylistic rules — the Rust-backed @stylistic-compatible formatting rules.

Run and ship

Operational reference

Build and deploy

Build the static documentation site locally:

bash
vp run -w docs_build

Deploy with Void. The root void.json points Void at the docs build and dist/docs output directory, so this runs from the repository root:

bash
npx void deploy