{"id":20666,"library":"vite-plugin-eslint","title":"vite-plugin-eslint","description":"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.","status":"active","version":"1.8.1","language":"javascript","source_language":"en","source_url":"https://github.com/gxmari007/vite-plugin-eslint","tags":["javascript","eslint","vite-plugin","typescript"],"install":[{"cmd":"npm install vite-plugin-eslint","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-eslint","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-eslint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; ESLint is required to perform linting","package":"eslint","optional":false},{"reason":"peer dependency; plugin operates within Vite's build system","package":"vite","optional":false}],"imports":[{"note":"Package exports a default function; CommonJS require is not available in ESM contexts.","wrong":"const eslint = require('vite-plugin-eslint')","symbol":"default","correct":"import eslint from 'vite-plugin-eslint'"},{"note":"Do not use named import; the package only has a default export.","wrong":"import { eslint } from 'vite-plugin-eslint'","symbol":"eslint","correct":"import eslint from 'vite-plugin-eslint'"},{"note":"TypeScript users can import the options type for type safety.","wrong":"","symbol":"EsLintOptions","correct":"import type { EsLintOptions } from 'vite-plugin-eslint'"}],"quickstart":{"code":"// vite.config.ts\nimport { defineConfig } from 'vite';\nimport eslint from 'vite-plugin-eslint';\n\nexport default defineConfig({\n  plugins: [\n    eslint({\n      cache: false,\n      fix: true,\n      include: ['src/**/*.ts', 'src/**/*.vue'],\n      exclude: ['node_modules'],\n      formatter: 'stylish',\n      emitWarning: true,\n      emitError: true,\n      failOnWarning: false,\n      failOnError: true,\n      lintOnStart: false,\n    }),\n  ],\n});","lang":"typescript","description":"Configures vite-plugin-eslint with common options; linting runs during dev and build."},"warnings":[{"fix":"Disable cache if you encounter stale lint results: set `cache: false`.","message":"The `cache` option is still marked `Beta` and may not correctly detect file changes in all scenarios.","severity":"gotcha","affected_versions":">=1.8.1"},{"fix":"Avoid enabling `lintOnStart` unless necessary; consider running lint as a separate command.","message":"Setting `lintOnStart: true` can significantly slow down startup on large projects as it lints all included files.","severity":"gotcha","affected_versions":">=1.8.1"},{"fix":"Refer to ESLint's flat config migration; consider using `eslint.config.js` instead of `.eslintrc.*`.","message":"Some ESLint options like `useEslintrc` and `overrideConfigFile` are passed directly but may be deprecated in ESLint >=9.","severity":"deprecated","affected_versions":">=1.8.1"},{"fix":"Ensure your ESLint version is compatible; test with your target ESLint version.","message":"The plugin uses the ESLint class which may change behavior between ESLint v7 and v8/v9.","severity":"gotcha","affected_versions":">=1.8.1"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install vite-plugin-eslint --save-dev` or `yarn add vite-plugin-eslint -D`.","cause":"Package not installed or missing in node_modules.","error":"Error: Cannot find module 'vite-plugin-eslint'"},{"fix":"Replace `import { eslint } from 'vite-plugin-eslint'` with `import eslint from 'vite-plugin-eslint'`.","cause":"Using named import `{ eslint }` instead of default import.","error":"TypeError: eslint is not a function"},{"fix":"Create a valid `.eslintrc.*` or `eslint.config.js` file in your project root.","cause":"ESLint configuration file missing or invalid.","error":"Failed to load ESLint config ..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}