Integrates ESLint into Vite's build and dev server, providing real-time linting feedback in the terminal and browser overlay. Current stable version is 1.8.1, with a monthly release cadence. It runs ESLint on specified file types (JS, TS, Vue, Svelte) and supports caching, auto-fix, and granular error/warning configuration. Differentiates from eslint-webpack-plugin by being Vite-native and simpler to configure.
npm install vite-plugin-eslintVerified import paths — ran on the pinned version, not inferred.
Configures vite-plugin-eslint with common options; linting runs during dev and build.
Disable cache if you encounter stale lint results: set `cache: false`.
Avoid enabling `lintOnStart` unless necessary; consider running lint as a separate command.
Refer to ESLint's flat config migration; consider using `eslint.config.js` instead of `.eslintrc.*`.
Ensure your ESLint version is compatible; test with your target ESLint version.
Run `npm install vite-plugin-eslint --save-dev` or `yarn add vite-plugin-eslint -D`.
Replace `import { eslint } from 'vite-plugin-eslint'` with `import eslint from 'vite-plugin-eslint'`.Create a valid `.eslintrc.*` or `eslint.config.js` file in your project root.