Back to all notes
Tooling
2 weeks ago

oxc: one Rust toolchain instead of ESLint + Prettier

oxlint and oxfmt replace ESLint and Prettier with one Rust toolchain — fast enough to run in a pre-commit hook without thinking about it.

One toolchain, not two

oxc is a JavaScript toolchain written in Rust. This site uses two pieces of it: oxlint for linting and oxfmt for formatting, in place of ESLint and Prettier. One toolchain, one config style, no plugin-resolution archaeology.

The setup

oxlint runs with the plugins this stack needs — typescript, react, jsx-a11y, nextjs, import, unicorn, oxc — scoped to the correctness category so it flags real bugs, not stylistic taste. oxfmt handles formatting (the one override here is "semi": false). Both are wired into a Lefthook pre-commit hook that fixes and re-stages staged files.

Why switch

Speed, mostly. oxlint's own benchmarks put it at tens of times faster than ESLint on the same files — fast enough that linting the whole repo is instant and the pre-commit hook never makes you wait. Tools you do not wait for are tools you actually run.

The catch

The rule coverage is not a one-to-one match for a maxed-out ESLint config with a dozen plugins, so if you lean on a specific exotic rule, check it exists first. For a typical TypeScript-and-React project the correctness rules cover the bugs that matter, and the speed pays for itself daily.

#oxc#oxlint#oxfmt#tooling
Found this useful?

Related notes