Vite plugin that integrates ESLint and TypeScript linting into the Vite dev server and build process, displaying linter output in both the terminal and browser console. Version 4.0.0 is the latest stable release. Key differentiators: uses Vite's configureServer hook for real-time console feedback, supports custom linters, and provides separate serve/build options. Requires Vite and ESLint/TypeScript as peer dependencies.
npm install vite-plugin-linterVerified import paths — ran on the pinned version, not inferred.
Sets up ESLint and TypeScript linting with default options for files in src directory.
Use only with Vite; if migrating to Rollup, consider @rollup/plugin-eslint or similar.
Pass configEnv as shown in documentation; it is required for ESLint configuration resolution.
Use the CLI only for pre-commit hooks or small projects; adjust include/exclude patterns if needed.
Check CHANGELOG for any deprecated options; migrate to new API.
Explicitly set include patterns to limit scope.
Ensure EsLinter is constructed within the defineConfig callback and configEnv is passed: new EsLinter({ configEnv })Set include option as an array of patterns: include: ['./src/**/*.ts', './src/**/*.tsx']
Either create tsconfig.json or specify configFilePath: new TypeScriptLinter({ configFilePath: './otherTsconfig.json' })Ensure there is at least one source file outside node_modules, or explicitly set injectFile option.