iTranslated by AI
Introduction to oxlint and How to Use It With ESLint
What is this?
This article summarizes the basics of oxlint, a next-generation Linter for JavaScript / TypeScript, and how to integrate and use it in projects where ESLint is already installed.
oxlint Overview
oxlint[1] is a next-generation Linter for JavaScript / TypeScript developed by the oxc project. oxc is a high-performance code analysis toolchain written in Rust, and oxlint is provided as a component of it. Incidentally, oxc also includes oxfmt, a Prettier-compatible code formatter, in addition to the Linter.
While Biome is famous as a next-generation toolchain written in Rust, it differs from oxc in that it provides both a Linter and a Formatter in a single tool. oxc contains various features such as a Linter, Formatter, and Transformer, but these are provided as individual tools (Node modules), and users choose and install only what they need.
A Rule Set Following ESLint
As of version v1.31.0, the latest as of December 2025, over 600 rules have already been implemented. Basically, the names of each rule follow those of ESLint as they are. Many of the options provided by ESLint's rules are also supported (though not all). For this reason, migrating from ESLint is relatively easy.
Supports ESLint Plugins
Although oxlint is implemented in Rust, it also supports plugins implemented in JavaScript, and its API is compatible with ESLint. In other words, you can use existing ESLint plugins as they are in oxlint.
Coexistence with ESLint
As mentioned above, oxlint emphasizes its compatibility with ESLint and is designed to be used together. The following is a quote from the official documentation:
At this stage, Oxlint can be used to fully replace ESLint in small to medium projects.
For larger projects, our current advice is to turn off ESLint rules via eslint-plugin-oxlint, and run Oxlint before ESLint in your local or CI setup for a quicker feedback loop.
It states, "At this stage, oxlint can completely replace ESLint in small to medium-sized projects, but for larger projects, run ESLint with eslint-plugin-oxlint loaded right after executing oxlint."
eslint-plugin-oxlint is an ESLint configuration preset that disables only the rules already supported by oxlint. In other words, it is like eslint-config-prettier. By utilizing this, you can perform a step-by-step migration to oxlint while keeping the overall structure of your existing Lint rule settings intact.
Trying out oxlint
Here, I will explain the procedure for introducing oxlint to a project based on TypeScript.
Installation
npm install --save-dev oxlint oxlint-tsgolint
In addition to the oxlint core, install oxlint-tsgolint. oxlint-tsgolint is a plugin that provides rules for TypeScript, specifically those that require type information or are aware of it (Type-Aware Linting). It is characterized by being extremely fast because it uses typescript-go to retrieve type information. While basic Linting is possible with the oxlint core alone, the available rules are limited, so using oxlint-tsgolint together is recommended for TypeScript-based projects.
You can perform Linting using type information by specifying the --type-aware option when running the oxlint CLI.
npx oxlint --type-aware
Creating a Configuration File
Create a configuration file named .oxlintrc.json in the project root directory. While JavaScript formats (.js, .cjs, .mjs) like those in ESLint are not supported, inline comments can be used.
{
// Specifying $schema enables IDE autocompletion.
"$schema": "./node_modules/oxlint/configuration_schema.json",
"rules": {
"no-unused-vars": "error",
"typescript/await-thenable": "warn",
"unicorn/no-await-in-promise-methods": "off"
}
}
Bundled Plugins
The various rules implemented in oxlint are provided by the scope of plugins bundled by default. For example, no-unused-vars belongs to the eslint plugin, and typescript/await-thenable belongs to the typescript plugin. You enable the plugins to which the rules you want to configure belong.
{
"plugins": ["eslint", "typescript", "unicorn"],
"rules": {
"no-unused-vars": "error",
"typescript/await-thenable": "warn",
"unicorn/no-await-in-promise-methods": "off"
}
}
Note that the initial value of the plugins field is ["eslint", "typescript", "unicorn", "oxc"], so it can be omitted in the example above. The initial value for every rule is all "warn", and you overwrite them with "error" or "off" as needed.
Be aware that if you configure a rule but the plugin it belongs to is not enabled, that rule will be ignored.
{
"plugins": ["eslint"],
"rules": {
"node/no-new-require": "error" // Ignored because the node plugin is not enabled
}
}
Bulk Enable/Disable via the categories Field
The standard implemented rules are grouped by units called categories separate from the plugin units mentioned above, and you can use this to enable/disable them in bulk. For example, by configuring as follows, all rules belonging to the correctness category will be enabled.
{
"categories": {
"correctness": "error"
}
}
| Name | Summary |
|---|---|
correctness |
Rules that detect code that is absolutely incorrect or meaningless. |
suspicious |
Rules that detect code that is likely to be incorrect or meaningless, though not to the extent of correctness. |
pedantic |
Rules for those who want a generally stricter Linter. This also brings the possibility of false positives. |
perf |
Rules aimed at improving performance. |
style |
Rules that detect maintainability or consistency in coding style. |
restriction |
Rules that detect and prohibit specific patterns, syntax, or features. |
nursery |
Rules that are not yet stable on the Linter side (subject to change in the future). |
Note that even if you use the categories field, it will be ignored if the plugin to which the rule belongs is not enabled. Also, the rules field takes precedence between the categories field and the rules field.
{
"plugins": ["node"],
"categories": {
// Includes node/no-new-require, but overridden by the setting in the rules field
"correctness": "error"
},
"rules": {
"node/no-new-require": "warn"
},
}
Coexistence with ESLint
Here, I will explain how to introduce oxlint into a project where ESLint is already installed and use both together.
0. Prerequisites
- Depends on many ESLint plugins and has extensive rule configurations
- ESLint configuration file is in Flat Config format
- oxlint and oxlint-tsgolint are already installed
1. Generating an oxlint Configuration File from an ESLint Configuration File
Use a tool called oxlint-migrate to automatically generate an oxlint configuration file from an existing ESLint configuration file.
# Generally, running it via npx is sufficient as you only use it once
npx @oxlint/migrate eslint.config.js --type-aware --output-file oxlintrc.json
This generates .oxlintrc.json based on eslint.config.js. Specifying the --type-aware option also enables oxlint-tsgolint rules. Rules not supported by oxlint are not included in the generated file and are ignored, but you can confirm which rules are unsupported (or to be implemented in the future) because they are output as logs when running the command.
Log Output Example
$ npx @oxlint/migrate eslint.config.js --type-aware --output-file oxlintrc.json ✹ ✭
Packages: +10
++++++++++
Progress: resolved 30, reused 9, downloaded 7, added 10, done
unsupported rule: dot-notation
... (omitted for brevity) ...
unsupported rule: testing-library/prefer-screen-queries
unsupported rule: testing-library/render-result-naming-convention
2. Disabling ESLint Rules Already Supported by oxlint
To prevent executing rules supported by oxlint again on the ESLint side, install eslint-plugin-oxlint and incorporate it into the ESLint configuration file.
npm install --save-dev eslint-plugin-oxlint
import oxlint from 'eslint-plugin-oxlint';
export default [
// ... Existing configuration ...
...oxlint.configs['flat/all'], // Incorporate the oxlint plugin
];
In the example above, all rules supported by oxlint are disabled, but it is also possible to use flat/recommended (equivalent to correctness) or disable by oxlint plugin units.
3. Running oxlint and ESLint Serially
All that remains is to run oxlint and ESLint serially in your CI or local environment. For example, define a lint script like the following.
{
"scripts": {
"lint": "oxlint --type-aware && eslint ."
}
}
Performance Comparison
I conducted a performance comparison between oxlint and ESLint when Linting the same codebase with the same rule set. The comparison targets are as follows.
Codebase
I will verify this with a repository for personal development that I use daily for hobbies and learning purposes.
- File types: JavaScript / TypeScript (
*.{js,ts,tsx}) - Number of files: 479
- Total lines: 28,178
Linter Configuration File
Since an eslint.config.js targeting the codebase of the entire repository already exists, I will generate .oxlintrc.json using the aforementioned oxlint-migrate based on it. At that time, all rules not supported by oxlint will be excluded from eslint.config.js. This creates the same rule set for oxlint and ESLint.
Measurement
I will measure execution time using time, a shell built-in command.
time npx eslint .
time npx oxlint --type-aware
Results
| Linter | Result |
|---|---|
| ESLint | 20.06s user 1.99s system 153% cpu **14.352 total** |
| oxlint | 0.79s user 0.33s system 163% cpu **0.686 total** |
While ESLint takes over 20 seconds, oxlint is extremely fast at less than 1 second. I performed this about 5 times for each, and the results were nearly identical. In this case, there was about a 25x performance difference.
The reason for the speed, in addition to oxlint being written in Rust, is that type information acquisition via oxlint-tsgolint is extremely fast. Since ESLint launches tsc to retrieve type information, that overhead appears as a large difference.
Incidentally, the TypeScript ESLint development team previously experimentally developed a tool based on typescript-go called tsgolint, and it was reported that ESLint performance improved by 20–40 times by using it[3]. oxlint-tsgolint inherits this tsgolint, so similar speedups are realized.
Conclusion
oxlint is a next-generation Linter that offers high compatibility with ESLint while also boasting fast performance due to being written in Rust. Since it is designed so that it can be introduced step-by-step into projects where ESLint is already installed, those who are interested should definitely give it a try.
-
According to the official documentation, it is pronounced "ox-lint." ↩︎
-
When I posted about this on X, I received a reply from someone at void(0), the organization developing oxc. While there was no specific mention, loading configuration presets might be supported in the future.
https://twitter.com/TheAlexLichter/status/1995183441600446529 ↩︎ -
https://github.com/typescript-eslint/tsgolint?tab=readme-ov-file#speedup-over-eslint ↩︎
Discussion