Oxlint Setup Guide

Zero-Config Start (30 seconds)

# Run without installing
npx oxlint .

# Or install as devDependency
npm install -D oxlint

That’s it. No config file needed. Oxlint ships with 93 rules enabled by default.

Add to package.json

{
  "scripts": {
    "lint": "oxlint src/ test/"
  }
}

Scope to specific directories to avoid linting dist/, node_modules/, etc.

Output Example

  ! eslint(no-unused-vars): Variable 'x' is declared but never used.
     ,-[src/utils.ts:12:7]
  11 |
  12 | const x = computeValue();
     :       ^-- 'x' is declared here
  13 | return result;
     `----
  help: Consider removing this declaration.

Found 1 warning and 0 errors.
Finished in 14ms on 25 files with 93 rules using 10 threads.

Note the speed: 14ms for 25 files. ESLint would take 2-5 seconds for the same.

Adding a Config File

Create .oxlintrc.json when you want to customize rules:

{
  "$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
  "plugins": ["typescript"],
  "rules": {
    "typescript/no-explicit-any": "warn",
    "no-console": "warn"
  }
}

The $schema gives IDE autocomplete for all options.

Enable TypeScript Plugin

By default oxlint runs generic JS/TS rules. To enable TypeScript-specific rules:

{
  "plugins": ["typescript"],
  "rules": {
    "typescript/no-explicit-any": "warn",
    "typescript/consistent-type-imports": "warn",
    "typescript/no-non-null-assertion": "warn"
  }
}

Running Alongside ESLint

For projects that already have ESLint (mysukari.com, markdown-task-planner, hn.etelej.com, starlight-action):

{
  "scripts": {
    "lint": "oxlint src/ && eslint src/",
    "lint:fast": "oxlint src/"
  }
}

Run oxlint first (milliseconds), then ESLint for framework-specific rules. Use lint:fast for quick local checks.

CI Integration

# GitHub Actions
- name: Lint
  run: npx oxlint src/ test/

Adds <1 second to CI. No setup, no cache needed.

Ignore Patterns

Oxlint respects .gitignore by default. For additional ignores:

{
  "ignorePatterns": ["**/*.test.ts", "generated/"]
}

Or inline:

// oxlint-disable-next-line no-console
console.log("debug");

What Rules Are On by Default?

Run npx oxlint --rules to see all available rules and their default state. The defaults cover:

  • eslint core - no-unused-vars, no-undef, no-unreachable, eqeqeq, etc.
  • typescript - basic TS rules (when plugin enabled)
  • import - import/export validation
  • unicorn - modern JS best practices
  • jest/vitest - test quality rules (auto-detected)

Next Steps