unplugin-oxlint is a universal bundler plugin designed to integrate the high-performance Oxlint linter into various JavaScript and TypeScript projects. Currently at version 0.8.0, this library maintains an active release cadence, frequently updating to support the latest Oxlint versions and bundler ecosystems. Its core differentiator is the ability to seamlessly embed Oxlint across popular build tools like Vite, Rollup, esbuild, and Webpack through the `unplugin` ecosystem. It also provides a Node.js API for programmatic linting. Key features include highly optimized performance by linting only changed files via `chokidar`, user-friendly terminal output, and optional integration with ESLint setups using `eslint-plugin-oxlint` to disable redundant rules. This allows for flexible adoption, either replacing ESLint or running alongside it for a faster feedback loop.
npm install unplugin-oxlintVerified import paths — ran on the pinned version, not inferred.
This Vite configuration demonstrates how to integrate `unplugin-oxlint` with basic options, including glob patterns, conditional auto-fixing via an environment variable, and setting the current working directory for linting.
Migrate from using the `unox` command to either configuring `unplugin-oxlint` as a bundler plugin (e.g., in `vite.config.ts`) or calling the `lint` function directly from a Node.js script.
Replace `options.path` with `options.includes`. For glob patterns, ensure `options.glob: true` is also set. Example: `Oxlint({ includes: ['src/**/*.ts'], glob: true })`.Ensure `oxlint` is installed as a development dependency in your project: `npm i -D oxlint` or `pnpm add -D oxlint`. Check the `unplugin-oxlint` peer dependency range for compatible `oxlint` versions.
Install `eslint-plugin-oxlint` (`npm i -D eslint-plugin-oxlint`) and configure your ESLint setup (e.g., `eslint.config.js`) to extend `oxlint.configs['flat/all']` or specific configurations to disable redundant rules.
Always use the specific bundler subpath for plugin imports, e.g., `import Oxlint from 'unplugin-oxlint/vite'` for Vite, or `require('unplugin-oxlint/webpack')` for Webpack.Run `npm install oxlint --save-dev` (or `pnpm add -D oxlint`, `yarn add -D oxlint`) in your project root.
Ensure the imported `Oxlint` plugin is always called as a function, typically with no arguments or an options object, e.g., `plugins: [Oxlint()]`.
Verify that `Oxlint()` is correctly placed within the `plugins` array in your bundler configuration file, e.g., `plugins: [Oxlint({ /* options */ })]`.Double-check the import statement. For esbuild and webpack, use `require('unplugin-oxlint/esbuild')()` or `require('unplugin-oxlint/webpack')()` respectively. For Vite/Rollup, use `import Oxlint from 'unplugin-oxlint/vite'`.