Skip to main content

Overview

Oxlint is a production-ready linter that catches mistakes in your JavaScript and TypeScript code. It’s designed to be 50-100x faster than ESLint while maintaining compatibility with ESLint’s configuration format and rules.

Lightning Fast

Lints 4800+ files in under 1 second. Built for monorepos and large codebases.

ESLint Compatible

Drop-in replacement supporting popular ESLint plugins and configurations.

200+ Rules

Comprehensive rule coverage including TypeScript, React, and more.

Auto-fixing

Automatically fix many issues with --fix flag.

Quick Start

Run without installation

npx oxlint@latest
Oxlint will automatically discover and lint all JavaScript/TypeScript files in your project.

Install locally

npm install -D oxlint
Then add to your package.json:
package.json
{
  "scripts": {
    "lint": "oxlint"
  }
}

CLI Usage

Basic Commands

# Lint current directory
oxlint

# Lint specific files or directories
oxlint src/ lib/ index.js

# Auto-fix issues
oxlint --fix

# Check with specific configuration
oxlint -c .oxlintrc.json

CLI Options

FlagDescription
-c, --config <PATH>Path to configuration file (.oxlintrc.json, .oxlintrc.jsonc, or oxlint.config.ts)
--initInitialize oxlint configuration with default values
--tsconfig <PATH>Path to TypeScript config for import plugin and path aliases

Examples

# Deny all warnings and errors in the correctness category
oxlint -D correctness

# Allow no-debugger and deny no-console
oxlint -A no-debugger -D no-console

# Deny all rules, then allow specific ones
oxlint -D all -A no-unused-vars -A no-console

# Lint with type-aware rules
oxlint --type-aware --tsconfig ./tsconfig.json

# Format output for GitHub Actions
oxlint --format github

# Lint with React and Jest plugins
oxlint --react-plugin --jest-plugin

Configuration

Configuration File

Create .oxlintrc.json in your project root:
.oxlintrc.json
{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "plugins": [
    "typescript",
    "react",
    "unicorn",
    "import",
    "jsdoc"
  ],
  "categories": {
    "correctness": "error",
    "suspicious": "warn",
    "perf": "error"
  },
  "rules": {
    "no-console": "error",
    "no-debugger": "error",
    "prefer-const": ["error", { "destructuring": "all" }],
    "typescript/no-explicit-any": "warn",
    "react/jsx-key": "error"
  },
  "ignorePatterns": [
    "**/node_modules/**",
    "**/dist/**",
    "**/*.min.js"
  ]
}

Rule Configuration

Rules can be configured with severity levels and options:
{
  "rules": {
    "no-unused-vars": "off",      // Disable rule
    "no-console": "warn",         // Warning
    "no-debugger": "error"        // Error
  }
}

Overrides

Apply different rules to specific files:
.oxlintrc.json
{
  "rules": {
    "no-console": "error"
  },
  "overrides": [
    {
      "files": ["test/**/*.test.ts"],
      "rules": {
        "no-console": "off"
      }
    },
    {
      "files": ["**/*.config.js"],
      "rules": {
        "no-restricted-imports": ["error", {
          "patterns": [{
            "regex": ".*/dist/.*",
            "message": "Don't import from dist"
          }]
        }]
      }
    }
  ]
}

Ignore Patterns

Oxlint respects .gitignore by default. Additional patterns:
.oxlintrc.json
{
  "ignorePatterns": [
    "**/fixtures/**",
    "**/generated/**",
    "**/*.min.js",
    "!important-file.js"  // Negation
  ]
}

Available Rules

View All Rules

oxlint --rules

Major Rule Collections

  • no-unused-vars - Disallow unused variables
  • no-console - Disallow console statements
  • no-debugger - Disallow debugger statements
  • prefer-const - Prefer const over let
  • no-var - Disallow var declarations
  • curly - Enforce consistent brace style
  • And 100+ more…
  • @typescript-eslint/no-explicit-any - Disallow any type
  • @typescript-eslint/no-unused-vars - TS-aware unused variables
  • @typescript-eslint/ban-ts-comment - Ban @ts- comments
  • @typescript-eslint/consistent-type-imports - Consistent imports
  • And 50+ more…
  • react/jsx-key - Enforce key prop in iterators
  • react/no-array-index-key - Prevent array index as key
  • react/jsx-no-duplicate-props - No duplicate props
  • react-hooks/rules-of-hooks - Enforce hooks rules
  • react-hooks/exhaustive-deps - Check effect dependencies
  • import/no-cycle - Detect circular dependencies
  • import/no-duplicates - No duplicate imports
  • import/extensions - Enforce file extensions
  • import/no-self-import - Prevent self-imports
  • unicorn/filename-case - Enforce filename conventions
  • unicorn/no-null - Disallow null
  • unicorn/prefer-module - Prefer ES modules
  • unicorn/no-array-for-each - Prefer for-of

Performance

Benchmarks

On a typical codebase (VS Code repository with 4800+ files):
ToolTime
oxlint0.7s
ESLint60s+
Oxlint is approximately 50-100x faster than ESLint on large codebases.

Performance Features

  • Single AST pass: Most rules run in one traversal
  • Parallel processing: Multi-threaded file processing
  • Arena allocation: Efficient memory management
  • Optimized parsing: Leverages oxc’s fast parser

Language Server Protocol (LSP)

Oxlint includes a built-in language server for editor integration:
# Start LSP server
oxlint --lsp

Editor Integration

Install the oxc VS Code extension for:
  • Real-time linting
  • Quick fixes
  • Rule documentation on hover

Migration from ESLint

Compatibility

Oxlint is designed for easy migration:
  1. Config format: Supports ESLint-style configuration
  2. Rule names: Uses the same rule names as ESLint
  3. Plugins: Compatible with major ESLint plugins
  4. Output formats: Supports ESLint output formats

Migration Steps

1

Install oxlint

npm install -D oxlint
2

Initialize configuration

npx oxlint --init
This creates .oxlintrc.json based on your project.
3

Test alongside ESLint

package.json
{
  "scripts": {
    "lint:eslint": "eslint .",
    "lint:oxlint": "oxlint",
    "lint": "oxlint"  // Switch when ready
  }
}
4

Gradually migrate rules

Start with core rules, then enable plugins as needed.
Some ESLint rules may have slight behavioral differences. Test thoroughly before full migration.

CI/CD Integration

GitHub Actions

.github/workflows/lint.yml
name: Lint

on: [push, pull_request]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
      - run: npm ci
      - run: npx oxlint --format github

GitLab CI

.gitlab-ci.yml
lint:
  image: node:20
  script:
    - npm ci
    - npx oxlint --format gitlab
  artifacts:
    reports:
      codequality: gl-code-quality-report.json

Pre-commit Hook

package.json
{
  "lint-staged": {
    "*.{js,jsx,ts,tsx}": "oxlint --fix"
  }
}

API Reference

For programmatic usage from Node.js or Rust, see:

CLI Reference

Complete CLI command reference

Rust API

Build tools with oxc_linter crate

FAQ

Oxlint is written in Rust with performance as a primary goal. It uses:
  • A highly optimized parser (oxc_parser)
  • Arena allocation for memory efficiency
  • Single-pass AST traversal for most rules
  • Parallel file processing
  • No plugin loading overhead
Oxlint implements the most commonly used ESLint rules and major plugins. Check oxlint --rules for the complete list. If you need a specific rule, please open an issue on GitHub.
Partially. Oxlint uses a similar config format but with some differences. Use oxlint --init to generate a compatible config based on your project.
Currently, oxlint has built-in support for major plugins (TypeScript, React, etc.). External JavaScript-based plugins are not yet supported, but this is planned for future releases.
Yes! Oxlint is designed for monorepos and large codebases. Use nested config files or the --disable-nested-config flag to control configuration resolution.

Resources

GitHub Repository

Source code and issue tracker

Rule Documentation

Complete rule reference

Discord Community

Get help and discuss features

npm Package

Install from npm

Build docs developers (and LLMs) love