Skip to main content
Get up and running with Oxc’s linter in under a minute.

Run oxlint Immediately

The fastest way to try oxlint is to run it directly with npx:
npx oxlint@latest
This will:
  • Download and run the latest version of oxlint
  • Scan your current directory for JavaScript and TypeScript files
  • Report any issues found with sensible default rules
No installation or configuration required. oxlint works out of the box with intelligent defaults.

Example Output

Here’s what you might see when running oxlint on a project:
Terminal
$ npx oxlint@latest

  eslint(no-debugger): Unexpected 'debugger' statement
    ╭─[src/app.ts:15:3]
 14   if (isProduction) {
 15     debugger;
    ·     ────┬───
    ·         ╰── Remove this debugger statement
 16   }
    ╰────
  help: Debugger statements are considered harmful in production code

  typescript/no-explicit-any: Unexpected any. Specify a different type.
    ╭─[src/utils.ts:8:24]
  7 
  8 function process(data: any) {
    ·                        ─┬─
    ·                         ╰── any disables type checking
  9   return data.value;
    ╰────

 2 problems (2 errors, 0 warnings)

Install Locally

For regular use, install oxlint in your project:
1

Install oxlint

Add oxlint as a dev dependency:
npm install --save-dev oxlint
2

Add npm script

Update your package.json to include a lint script:
package.json
{
  "scripts": {
    "lint": "oxlint"
  }
}
Now you can run:
npm run lint
3

Run oxlint

Lint your entire project:
npx oxlint
Or specific files and directories:
npx oxlint src/
npx oxlint src/ tests/
npx oxlint src/app.ts

Create Configuration File

Customize oxlint’s behavior with a configuration file.
1

Initialize configuration

Create a default configuration file:
npx oxlint --init
This creates .oxlintrc.json in your project root.
2

Configure rules

Edit .oxlintrc.json to customize rules:
.oxlintrc.json
{
  "plugins": [
    "typescript",
    "unicorn",
    "react",
    "import",
    "jsdoc",
    "node"
  ],
  "categories": {
    "correctness": "error",
    "suspicious": "warn",
    "pedantic": "warn"
  },
  "rules": {
    "no-console": "error",
    "no-debugger": "error",
    "typescript/no-explicit-any": "warn"
  }
}
3

Run with configuration

oxlint automatically detects and uses .oxlintrc.json:
npx oxlint
Or specify a custom config file:
npx oxlint -c path/to/config.json

Common CLI Options

Here are the most frequently used oxlint options:

Enable/Disable Rules

# Deny specific rules or categories
npx oxlint -D correctness -D no-debugger

# Allow (suppress) specific rules
npx oxlint -A no-console

# Warn on specific rules
npx oxlint -W suspicious

Fix Issues Automatically

# Fix safe auto-fixable issues
npx oxlint --fix

# Apply suggestions (may change behavior)
npx oxlint --fix-suggestions

# Apply dangerous fixes
npx oxlint --fix-dangerously
--fix-dangerously may change program behavior. Review changes carefully before committing.

Output Formats

# Default format (human-readable)
npx oxlint

# JSON format for programmatic use
npx oxlint --format json

# GitHub Actions format
npx oxlint --format github

# Unix format (file:line:column:message)
npx oxlint --format unix
Available formats: default, json, stylish, unix, checkstyle, github, gitlab, junit

Enable Plugins

# Enable React plugin
npx oxlint --react-plugin

# Enable import plugin (requires tsconfig)
npx oxlint --import-plugin --tsconfig tsconfig.json

# Enable JSX a11y plugin
npx oxlint --jsx-a11y-plugin

# Enable Jest plugin
npx oxlint --jest-plugin

Handle Warnings

# Disable warnings (errors only)
npx oxlint --quiet

# Treat warnings as errors
npx oxlint --deny-warnings

# Set maximum warning threshold
npx oxlint --max-warnings 10

Rule Categories

oxlint organizes rules into categories:
Code that is outright wrong or uselessEnabled by default. Catches bugs and incorrect code.
# These rules are enabled by default
npx oxlint

Configuration Examples

Minimal Configuration

.oxlintrc.json
{
  "rules": {
    "no-console": "warn",
    "no-debugger": "error"
  }
}

React Project

.oxlintrc.json
{
  "plugins": ["react", "react-perf", "jsx-a11y"],
  "categories": {
    "correctness": "error",
    "perf": "warn"
  },
  "rules": {
    "react/jsx-key": "error",
    "react-perf/jsx-no-new-object-as-prop": "warn"
  }
}

TypeScript Project

.oxlintrc.json
{
  "plugins": ["typescript", "import"],
  "categories": {
    "correctness": "error",
    "suspicious": "warn"
  },
  "rules": {
    "typescript/no-explicit-any": "warn",
    "typescript/consistent-indexed-object-style": ["error", "record"],
    "typescript/ban-ts-comment": [
      "error",
      { "ts-expect-error": "allow-with-description" }
    ]
  },
  "options": {
    "typeAware": true
  }
}

With Ignore Patterns

.oxlintrc.json
{
  "plugins": ["typescript", "unicorn"],
  "categories": {
    "correctness": "error"
  },
  "ignorePatterns": [
    "**/node_modules/**",
    "**/dist/**",
    "**/build/**",
    "**/*.d.ts"
  ]
}

Performance

oxlint is designed for speed. Here’s a comparison on the VSCode repository (4800+ files):
$ time npx oxlint

 Linted 4863 files in 0.7s

real    0m0.712s
user    0m2.847s
sys     0m0.156s
oxlint is typically 50-100x faster than ESLint on large codebases.

Next Steps

Linter Configuration

Learn about all configuration options

CLI Reference

Explore all CLI flags and options

Linter Tool

Learn about oxlint features

Formatter

Format your code with oxfmt

Troubleshooting

By default, oxlint scans the current directory for JS/TS files. Specify paths explicitly:
npx oxlint src/ tests/
Check your ignore patterns in .oxlintrc.json or .oxlintignore.
Create a .oxlintignore file:
.oxlintignore
node_modules
dist
*.d.ts
Or use ignorePatterns in .oxlintrc.json.
Yes! oxlint can run alongside ESLint. Use oxlint for fast checks and ESLint for rules not yet supported by oxlint.
package.json
{
  "scripts": {
    "lint": "oxlint && eslint ."
  }
}
Add typeAware: true to your config:
.oxlintrc.json
{
  "options": {
    "typeAware": true
  }
}
Or use the --type-aware flag:
npx oxlint --type-aware

Build docs developers (and LLMs) love