Linter (oxlint)
Oxlint is designed to catch erroneous or useless code without requiring any configurations by default.
INFO
At the current stage, oxlint is not intended to fully replace ESLint; it serves as an enhancement when ESLint's slowness becomes a bottleneck in your workflow.
We recommend running oxlint before ESLint in your lint-staged or CI setup for a quicker feedback loop, considering it only takes a few seconds to run on large codebases.
Features
- 50 - 100 times faster than ESLint, and scales with the number of CPU cores (benchmark).
- Over 400 rules with a growing list from
eslint
,typescript
,eslint-plugin-react
,eslint-plugin-jest
,eslint-plugin-unicorn
,eslint-plugin-jsx-a11y
and many more. - Supports
- .eslintignore.
- ESLint comment disabling.
- Partial ESLint v8 Configuration in
json
format
Language Support
- Supports:
- JavaScript and TypeScript by their extensions
js
,mjs
,cjs
,jsx
,ts
,mts
,cts
andtsx
. <script>
content of.vue
,.astro
and.svelte
files.
- JavaScript and TypeScript by their extensions
- No support for:
- type-aware rules defined by
typescript-eslint
. - stylistic rules.
- type-aware rules defined by
Installation
Run oxlint
directly at the root of your repository:
$ npx oxlint@latest
$ pnpm dlx oxlint@latest
$ yarn dlx oxlint@latest
$ bunx oxlint@latest
$ deno run npm:oxlint@latest
Or save it to your package.json:
$ npm add -D oxlint
$ pnpm add -D oxlint
$ yarn add -D oxlint
$ bun add -D oxlint
oxlint
does not require Node.js, the binaries can be downloaded from the latest GitHub releases.
Command-line Interface
Configuration File
Integration
ESLint
If you are looking for a way to use oxlint in projects that still need ESLint, You can use eslint-plugin-oxlint to turn off ESLint rules that are already supported by oxlint. So you can enjoy the speed of oxlint while still using ESLint.
lint-staged
{
"lint-staged": {
"**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,astro,svelte}": "oxlint"
}
}
VSCode Extension
Download the official VSCode extension from the
Continuous Integration
Since oxlint
only takes a few seconds to run, we recommend running oxlint
prior to ESLint for faster feedback loops.
GitHub Actions
jobs:
oxlint:
name: Lint JS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npx --yes oxlint@0.0.0 --deny-warnings # change to the latest release
It is advised to pin the version, otherwise CI may fail after a new release.
pre-commit
.pre-commit-hooks.yaml
repos:
- repo: https://github.com/oxc-project/mirrors-oxlint
rev: v0.0.0 # change to the latest version
hooks:
- id: oxlint
verbose: true
Unplugin
https://www.npmjs.com/package/unplugin-oxlint
Vite plugin
https://www.npmjs.com/package/vite-plugin-oxlint
System Requirements
oxlint
is built for darwin-arm64, darwin-x64, linux-arm64, linux-x64, win32-arm64 and win32-x64.