Oxlint: High-Performance JavaScript/TypeScript Linter
Oxlint is a JavaScript and TypeScript linter, part of the Oxc (Oxidation Compiler) suite, designed for extremely fast performance. It aims to provide a zero-configuration experience, allowing users to quickly integrate it into their projects. The current stable version is 1.60.0, and the project maintains a rapid release cadence, often releasing new minor versions (e.g., 1.58.0, 1.59.0, 1.60.0) and breaking changes at a frequent pace, sometimes weekly or bi-weekly. Key differentiators include its Rust-based implementation for speed and its focus on being an 'ESLint alternative' with built-in rules, avoiding the plugin ecosystem complexity of ESLint. It's intended to be run as a CLI tool.
Common errors
-
Command 'oxlint' not found
cause Oxlint is not installed globally or locally, or `npx` is not being used.fixRun `npm install oxlint` in your project, or use `npx oxlint` for a temporary execution. -
Error: No matched files. Please specify files to lint.
cause Oxlint found no files matching the patterns provided, or no patterns were given and it couldn't infer them. This became a hard error in v1.60.0.fixSpecify target files explicitly, e.g., `oxlint src/` or `oxlint **/*.js`. If using `oxlint .`, ensure there are JavaScript/TypeScript files in the current directory or subdirectories. -
Error: Unknown rule: 'my-custom-rule'. Please check the rule name.
cause A rule specified in the configuration (or implicitly via presets) does not exist in Oxlint's built-in rules. This became an error in v1.58.0.fixCorrect the rule name or remove the invalid rule from your configuration. Consult `npx oxlint --rules` for a list of available rules. -
SyntaxError: Unexpected token 'export'
cause Running `oxlint` CLI directly with an older Node.js version that does not support ESM without flags. Oxlint typically requires newer Node.js versions.fixEnsure your Node.js version meets the requirement of `>=20.19.0 || >=22.12.0`. Update Node.js or use a version manager like `nvm` to switch versions.
Warnings
- breaking Oxlint now errors if no files match the provided patterns, preventing silent failures where no files were linted. This changed the default behavior from silently succeeding.
- breaking The default behavior for showing and fixing safe suggestions in the LSP (Language Server Protocol) integration has changed. Previously, this might have required explicit configuration.
- breaking Oxlint will now report an error if you specify a rule that is not a recognized built-in rule. This prevents typos or incorrect rule names from being silently ignored.
- gotcha Oxlint is still under active and rapid development. Breaking changes are frequent across minor versions, requiring regular updates and review of release notes. The project prioritizes performance and rapid feature delivery, which can lead to API instability.
- gotcha The `oxlint` npm package is primarily a Command-Line Interface (CLI) tool. It does not expose a public programmatic JavaScript/TypeScript API for direct `import` statements in user projects, unlike some other linter libraries.
Install
-
npm install oxlint -
yarn add oxlint -
pnpm add oxlint
Quickstart
{
"name": "my-project",
"version": "1.0.0",
"description": "A sample project using Oxlint.",
"main": "index.js",
"scripts": {
"lint": "oxlint .",
"lint:fix": "oxlint . --fix"
},
"devDependencies": {
"oxlint": "^1.60.0"
}
}
// Run from your terminal:
// npm install oxlint
// npm run lint
// npm run lint:fix
// Or for a quick, temporary check without installation:
// npx --yes oxlint@latest