⚓️+⚡️Vite Plugin Oxlint

April 24, 2026 · View on GitHub

npm version license

⚓️+⚡️Vite Plugin Oxlint

A Vite plugin for integrating the Oxlint linter into your Vite project.

Table of Contents

Installation

npm install vite-plugin-oxlint oxlint

Usage

import oxlintPlugin from 'vite-plugin-oxlint'

export default {
  plugins: [oxlintPlugin()]
}

Options

OptionTypeDefaultDescription
configFilestringoxlintrc.jsonPath to the oxlint config file
pathstring.Directory where oxlint runs
ignorePatternstring | string[]Glob patterns of files to ignore
allowstring[]Rules/categories to allow (turn off)
denystring[]Rules/categories to deny (turn on)
warnstring[]Rules/categories to warn
oxlintPathstringPath to the oxlint binary (useful in monorepos)
formatstringdefaultOutput format (default, checkstyle, github, gitlab, json, junit, stylish, unix)
quietbooleanfalseSuppress warnings, only report errors
fixbooleanfalseEnable auto-fixing
failOnErrorbooleanfalseFail the build on lint errors
failOnWarningbooleanfalseFail the build on lint warnings
lintOnStartbooleantrueRun oxlint when the build starts
lintOnHotUpdatebooleantrueRun oxlint on every HMR update during dev
paramsstringAdditional raw CLI flags passed to oxlint

Advanced Usage

All examples below assume the following setup:

import oxlintPlugin from 'vite-plugin-oxlint'

export default {
  plugins: [
    oxlintPlugin({
      /* options here */
    })
  ]
}

Configuration file

Use a custom oxlint config file. Default is oxlintrc.json. Note: allow, deny, and warn options override config file rules.

{
  configFile: 'eslintrc.json'
}

Working directory

Restrict linting to a subdirectory. Default is the project root.

{
  path: 'src'
}

Ignore patterns

Ignore files using .gitignore-style patterns. See oxlint ignore docs. Quote patterns to avoid shell glob interpretation.

// Single pattern
{
  ignorePattern: '"test.js"'
}

// Multiple patterns
{
  ignorePattern: ['"test.js"', '"dist/**"']
}

Allow / Deny / Warn rules

Control which rules or categories are active. Run npx oxlint --rules to list available rules and categories. These options override any rules defined in the config file.

{
  deny: ['correctness', 'perf'],   // turn on
  allow: ['debugger', 'eqeqeq'],  // turn off
  warn: ['suspicious']
}

Oxlint binary path

In monorepos, if you get "command not found: oxlint" errors, specify the binary path explicitly. Without this option, the plugin falls back to npx (or your package manager's equivalent).

{
  oxlintPath: '/path/to/your/monorepo/node_modules/.bin/oxlint'
}

Output format

Change how lint diagnostics are reported. See oxlint output formats. Available: default, checkstyle, github, gitlab, json, junit, stylish, unix.

{
  format: 'stylish'
}

Fail on errors or warnings

By default, lint issues are logged but don't fail the build.

// Suppress warnings entirely (only report errors)
{
  quiet: true
}

// Fail on errors
{
  failOnError: true
}

// Fail on warnings
{
  failOnWarning: true
}

// Disable linting at build start
{
  lintOnStart: false
}

// Disable linting on HMR updates
{
  lintOnHotUpdate: false
}

Additional CLI options

Pass any raw CLI flags as a string. See oxlint CLI options.

{
  params: '--deny-warnings --quiet'
}

Integration with ESLint

If your project still needs ESLint, use vite-plugin-eslint alongside this plugin, and configure ESLint with eslint-plugin-oxlint to disable rules already covered by oxlint.

import oxlintPlugin from 'vite-plugin-oxlint'
import eslintPlugin from 'vite-plugin-eslint'

export default {
  plugins: [oxlintPlugin(), eslintPlugin()]
}

License

MIT LICENSE