Getting Started with Oxlint
Oxlint is an extremely fast JavaScript and TypeScript linter designed to catch erroneous or useless code without requiring any configurations by default. Get up and running in seconds!
Quick Start
The fastest way to try Oxlint is to run it directly on your project:
$ npx oxlint@latest
$ pnpm dlx oxlint@latest
$ yarn dlx oxlint@latest
$ bunx oxlint@latest
$ deno run npm:oxlint@latest
That's it! Oxlint will automatically scan your JavaScript and TypeScript files and report any issues it finds.
INFO
At this stage, Oxlint can be used to fully replace ESLint in small to medium projects.
For larger projects, our 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.
Why Oxlint?
- ⚡ Blazingly Fast: 50-100 times faster than ESLint, scales with CPU cores (benchmark)
- 📦 Zero Configuration: Works out of the box with sensible defaults
- 🛠️ Rich Rule Set: Over 520 rules from
eslint
,typescript
,eslint-plugin-react
,eslint-plugin-jest
,eslint-plugin-unicorn
,eslint-plugin-jsx-a11y
and many more - 🔧 Auto-fixing: Automatically fix many issues with
--fix
- ⚙️ Configurable: Support for configuration files, nested configs, and comment disabling
Installation
Try it now (Recommended)
Run oxlint
directly at the root of your repository to try it without installing:
$ npx oxlint@latest
$ pnpm dlx oxlint@latest
$ yarn dlx oxlint@latest
$ bunx oxlint@latest
$ deno run npm:oxlint@latest
Install to your project
Or save it to your package.json:
$ npm add -D oxlint
$ pnpm add -D oxlint
$ yarn add -D oxlint
$ bun add -D oxlint
Then run it via npm scripts:
{
"scripts": {
"lint": "oxlint",
"lint:fix": "oxlint --fix"
}
}
Standalone Binary
oxlint
does not require Node.js. The binaries can be downloaded from the latest GitHub releases as a standalone binary, perfect for CI environments without Node.js.
Basic Usage
Lint your project
$ oxlint
Oxlint will automatically find and lint all JavaScript and TypeScript files in your project.
Fix issues automatically
$ oxlint --fix
Many issues can be automatically fixed. This is safe and won't change your code's behavior.
Check specific files or directories
$ oxlint src/
$ oxlint src/components/*.tsx
$ oxlint --include "**/*.js" --include "**/*.ts"
Next Steps
Now that you have Oxlint running, here's how to get the most out of it:
🔧 Customize Rules and Configuration
Create an .oxlintrc.json
file in your project root to customize which rules are enabled:
{
"rules": {
"no-console": "warn",
"no-debugger": "error",
"prefer-const": "error"
},
"plugins": ["react", "jsx-a11y"],
"env": {
"browser": true,
"node": true
}
}
📚 Learn more: Configuration Guide | Available Rules | Plugins
🚀 Set Up CI/CD Integration
Add Oxlint to your continuous integration for consistent code quality:
GitHub Actions
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npx --yes oxlint@latest --deny-warnings
Other CI Systems
- GitLab CI:
npx oxlint@latest --deny-warnings
- Bitbucket Pipelines:
npx oxlint@latest --deny-warnings
- Jenkins:
npx oxlint@latest --deny-warnings
💡 Tip: Pin the version in CI to avoid surprises: npx --yes oxlint@0.x.x
📚 Learn more: CI Integration Examples
🔄 Migrate from ESLint
Already using ESLint? Here's how to transition smoothly:
Run both side-by-side initially:
json{ "scripts": { "lint": "oxlint && eslint .", "lint:fix": "oxlint --fix && eslint . --fix" } }
Use eslint-plugin-oxlint to disable overlapping rules:
shnpm install -D eslint-plugin-oxlint
Convert your ESLint config with oxlint-migrate:
shnpx oxlint-migrate
📚 Learn more: Migration Guide
⚡ Unlock Advanced Features
Automatic Fixes
Fix issues automatically while preserving your code's behavior:
oxlint --fix
Framework-Specific Linting
Enable rules for your framework:
{
"plugins": ["react", "vue", "jsx-a11y"],
"settings": {
"react": {
"version": "detect"
}
}
}
Nested Configuration
Use different rules for different parts of your project:
{
"extends": ["../../../.oxlintrc.json"],
"plugins": ["jest"],
"env": {
"jest": true
}
}
📚 Learn more: Automatic Fixes | Nested Config
🏗️ IDE and Editor Integration
Get real-time linting in your editor:
- VS Code: Install the Oxc VS Code Extension
- Zed: Search for "oxc" in Zed Extensions
- Other Editors: Use the Language Server Protocol
🛠️ Development Workflow Integration
Pre-commit Hooks with lint-staged
{
"lint-staged": {
"**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,astro,svelte}": "oxlint"
}
}
pre-commit Framework
repos:
- repo: https://github.com/oxc-project/mirrors-oxlint
rev: v0.x.x # Use the latest version
hooks:
- id: oxlint
verbose: true
Build Tool Integration
- Vite: vite-plugin-oxlint
- Universal: unplugin-oxlint
📊 Performance Optimization
For large codebases:
Use ignore patterns to skip unnecessary files:
json{ "ignorePatterns": ["dist/", "build/", "node_modules/"] }
Leverage parallel processing: Oxlint automatically uses all CPU cores
Run incrementally: Only lint changed files in CI:
shgit diff --name-only --cached | grep -E '\.(js|ts|jsx|tsx)$' | xargs oxlint
🤝 Get Help and Stay Updated
- 📖 Documentation: oxc.rs
- 💬 Community: Discord Server
- 🐛 Issues: GitHub Issues
- 🌟 Stay Updated: Follow @boshen_c on Twitter
Technical Details
Command-line Interface
Configuration File
Migrate from eslint flat config
If you have an existing eslint.config.*
file, you can convert it to an .oxlintrc.json
config with oxlint-migrate.
Language Support
- Supported:
- 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
- Not supported:
- Type-aware rules defined by
typescript-eslint
- Stylistic rules
- Type-aware rules defined by
System Requirements
oxlint
is built for darwin-arm64, darwin-x64, linux-arm64, linux-x64, win32-arm64 and win32-x64.