Skip to content

Linter (oxlint)

  • npm weekly downloads

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

Language Support

  • Supports:
    • JavaScript and TypeScript by their extensions js, mjs, cjs, jsx, ts, mts, cts and tsx.
    • <script> content of .vue, .astro and .svelte files.
  • No support for:

Installation

Run oxlint directly at the root of your repository:

sh
$ npx oxlint@latest
sh
$ pnpm dlx oxlint@latest
sh
$ yarn dlx oxlint@latest
sh
$ bunx oxlint@latest
sh
$ deno run npm:oxlint@latest

Or save it to your package.json:

sh
$ npm add -D oxlint
sh
$ pnpm add -D oxlint
sh
$ yarn add -D oxlint
sh
$ bun add -D oxlint

oxlint does not require Node.js, the binaries can be downloaded from the latest GitHub releases.

Command-line Interface

See Command-line Interface

Configuration File

See 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

package.json
json
{
  "lint-staged": {
    "**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,astro,svelte}": "oxlint"
  }
}

VSCode Extension

Download the official VSCode extension from the

Zed Extension

https://zed.dev/extensions?q=oxc

Continuous Integration

Since oxlint only takes a few seconds to run, we recommend running oxlint before ESLint for faster feedback loops.

GitHub Actions

yaml
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
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.

Released under the MIT License.