Oxlint JS Plugins Alpha
JavaScript plugins for Oxlint have reached alpha - and we expect 80% of ESLint users can now switch to Oxlint and have it "just work".
Oxlint already has over 650 popular lint rules implemented in Rust, running at native speed. JS plugins fill in the gaps - an ESLint-compatible plugin API, letting you run existing ESLint plugins and write your own custom rules, all within Oxlint. Native performance for most rules, full flexibility for the rest.
Since the first technical preview last year, we've filled out almost the entire ESLint plugin API, added TypeScript plugin support, auto-fixes, IDE integration, and major performance gains.
This means many teams can replace ESLint with Oxlint, without rewriting their lint rules.
This alpha release marks the point where we feel JS plugins are ready for adoption in real world projects.
Most projects should find that Oxlint can now act as a drop-in replacement for ESLint, with straightforward migration, and large reduction in linting time.
Features
- Run most existing ESLint plugins without modification.
- Write your own custom lint rules in JavaScript or TypeScript.
- Get auto-fixes and suggestions from JS plugin rules.
- See JS plugin diagnostics live in your IDE via the language server.
How reliable is it?
Oxlint JS plugins support is tested against the full test suite of ESLint itself, and also against a wide selection of ESLint plugins, including:
| Plugin | Tests | Pass rate |
|---|---|---|
| ESLint built-in rules | 33,006 | 100% |
| React hooks (including React Compiler rules) | 5,007 | 100% |
| ESLint Stylistic | 18,310 | 99.99% |
| Testing Library | 17,016 | 100% |
| SonarJS | 3,951 | 99.6%* |
| e18e | 474 | 100%* |
* excluding type-aware rules
If a plugin isn't in the list above, it will very likely still work - it just isn't included in our conformance test suite yet.
ESLint's own tests cover the entire API surface, so a 100% pass rate gives us confidence that we've covered corner cases, as well as the happy path. Please try it out and let us know!
Oxlint is already used in production by many companies and projects, including Midjourney, Preact, Posthog, Outline, and Actual.
What it can't do (yet)
- Limited support for front-end frameworks' custom file formats (e.g. Svelte, Vue, Angular) - coming later this year.
- No custom type-aware rules (TypeScript-ESLint's rules are already built into Oxlint via type-aware linting).
- Some users have found the experience on Windows sub-par. Out of memory errors are a known issue, specifically on Windows. We're working on it. In the meantime, if you hit this problem, we recommend running Oxlint in WSL, if that's an option.
You can follow our progress towards filling these gaps on the tracking issue.
Getting Started
Install oxlint as a dev dependency:
pnpm add -D oxlint
``````json [package.json]
{
"scripts": {
"lint": "oxlint"
}
}
``````json [.oxlintrc.json]
{
"jsPlugins": ["eslint-plugin-testing-library"],
"rules": {
"testing-library/no-render-in-lifecycle": "error"
}
}
``````sh
pnpm run lint
``````sh
npx @oxlint/migrate eslint.config.js
``````jsonc [.oxlintrc.json]
{
"jsPlugins": ["oxlint-plugin-eslint"],
"rules": {
// Note: "eslint-js" not "eslint"
"eslint-js/no-restricted-syntax": [
"error",
{
"selector": "ThrowStatement > CallExpression[callee.name=/Error$/]",
"message": "Use `new` keyword when throwing an `Error`.",
},
],
},
}
``````jsonc [.oxlintrc.json]
{
"jsPlugins": [
// Set up an alias for the plugin "jsdoc-js"
{ "name": "jsdoc-js", "specifier": "eslint-plugin-jsdoc" },
],
"rules": {
// Use the alias to refer to rules from the plugin
"jsdoc-js/check-examples": "error",
"jsdoc-js/require-description": "error",
// Use plain "jsdoc" for rules which Oxlint implements natively
"jsdoc/require-property-name": "error",
"jsdoc/require-property-description": "error",
},
}
``````sh
git checkout bench-eslint
npm ci
hyperfine -i --warmup 1 --runs 5 "node --run eslint"
``````sh
git checkout bench-oxlint
npm ci
hyperfine -i --warmup 1 --runs 5 "node --run oxlint"
