{"id":22556,"library":"vite-eslint-plugin","title":"Vite ESLint Plugin","description":"An ESLint plugin for Vite that lints JavaScript, TypeScript, Vue, and Svelte files during development and build. Version 1.9.2 is the current stable release, with no major release cadence documented. It is a fork of vite-plugin-eslint, offering additional configuration options such as lintOnStart, custom eslintPath, and granular failOnWarning/failOnError settings. Key differentiators include better control over linting behavior and support for modern file types.","status":"active","version":"1.9.2","language":"javascript","source_language":"en","source_url":"https://github.com/sagarpanchal/vite-eslint-plugin","tags":["javascript","eslint","vite-plugin","typescript"],"install":[{"cmd":"npm install vite-eslint-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add vite-eslint-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-eslint-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for TypeScript types when using ESLint in TypeScript projects.","package":"@types/eslint","optional":true},{"reason":"Peer dependency: core ESLint library required for linting functionality.","package":"eslint","optional":false},{"reason":"Peer dependency: required to integrate with Vite build tool.","package":"vite","optional":false}],"imports":[{"note":"The package exports a default function. Named import does not work.","wrong":"import { eslint } from 'vite-eslint-plugin'","symbol":"default","correct":"import eslint from 'vite-eslint-plugin'"},{"note":"CommonJS require returns the default export as a function.","wrong":"const { eslint } = require('vite-eslint-plugin')","symbol":"eslint","correct":"const eslint = require('vite-eslint-plugin')"},{"note":"You can alias the default import to any name.","symbol":"default","correct":"import eslintPlugin from 'vite-eslint-plugin'"}],"quickstart":{"code":"// vite.config.ts\nimport { defineConfig } from 'vite'\nimport eslint from 'vite-eslint-plugin'\n\nexport default defineConfig({\n  plugins: [\n    {\n      // fail on errors during build\n      ...eslint(),\n      apply: 'build',\n    },\n    {\n      // do not fail during dev\n      ...eslint({ failOnWarning: false, failOnError: false }),\n      apply: 'serve',\n      enforce: 'post',\n    },\n  ],\n})","lang":"typescript","description":"Configures the ESLint plugin for production builds (fails on errors) and development server (warnings and errors do not fail)."},"warnings":[{"fix":"Set lintOnStart: false (default) unless you need initial linting of the whole project.","message":"The plugin may significantly slow down HMR if lintOnStart is enabled, because it lints all matching files on startup.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use default import: `import eslint from 'vite-eslint-plugin'`.","message":"Version 1.0.0 changed the export from a named object to a default function. Existing code using `import { eslint } from 'vite-eslint-plugin'` will break.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use `failOnWarning` and `failOnError` instead.","message":"The option `emitWarning` and `emitError` are deprecated in favor of `failOnWarning` and `failOnError`.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Align @types/eslint version with eslint peer dependency (>=7).","message":"If you use TypeScript and have `@types/eslint` installed, you may need to ensure the versions align with your eslint peer dependency.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Change import to: `import eslint from 'vite-eslint-plugin'`","cause":"Using named import `{ eslint }` instead of default import.","error":"TypeError: eslint is not a function"},{"fix":"Create an ESLint configuration file (e.g., .eslintrc.json) or specify `overrideConfigFile` in plugin options.","cause":"ESLint cannot find an ESLint configuration file (e.g., .eslintrc) in the project root.","error":"Error: ESLint configuration is invalid: No configuration found for file..."},{"fix":"Install eslint: `npm install eslint --save-dev`","cause":"ESLint is not installed as a peer dependency.","error":"Error: Cannot find module 'eslint'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}