Registry / devops / vite-plugin-linter

vite-plugin-linter

JSON →
library4.0.0jsnpmunverified

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-linter
INSTALL
IMPORT
SIG · VITE-PLUGIN-LINTER
V
vite-plugin-linter
devopsjavascriptv4.0.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

linterPlugin
✓ import { linterPlugin } from 'vite-plugin-linter'
✗ import linterPlugin from 'vite-plugin-linter'
Named export; default import will not work.
EsLinter
✓ import { EsLinter } from 'vite-plugin-linter'
✗ import { ESLinter } from 'vite-plugin-linter'
Export name is 'EsLinter' (not 'ESLinter').
TypeScriptLinter
✓ import { TypeScriptLinter } from 'vite-plugin-linter'
✗ import { TypeScriptLinter } from 'vite-plugin-linter/ts'
All exports are from the main package; no subpath exports.

Sets up ESLint and TypeScript linting with default options for files in src directory.

import { defineConfig } from 'vite'; import { linterPlugin, EsLinter, TypeScriptLinter } from 'vite-plugin-linter'; export default defineConfig((configEnv) => ({ plugins: [ linterPlugin({ include: ['./src/**/*.ts', './src/**/*.tsx'], linters: [new EsLinter({ configEnv }), new TypeScriptLinter()], }), ], }));
Debug
Known issues
gotchaPlugin uses Vite-specific hook configureServer and will not work with Rollup.
fix
Use only with Vite; if migrating to Rollup, consider @rollup/plugin-eslint or similar.
affects: *
gotchaEsLinter requires configEnv from defineConfig callback; not providing it causes runtime errors.
fix
Pass configEnv as shown in documentation; it is required for ESLint configuration resolution.
affects: >=3.0.0
gotchaWhen running via CLI (vite-plugin-linter command), includeMode always defaults to filesInFolder, which may lint all files and cause performance issues.
fix
Use the CLI only for pre-commit hooks or small projects; adjust include/exclude patterns if needed.
affects: *
deprecatedOptions deprecated in previous versions may still work but will be removed in future releases.
fix
Check CHANGELOG for any deprecated options; migrate to new API.
affects: >=4.0.0
gotchaDefault include is undefined, which may lint all processed files; unexpected large linting sets can slow down builds.
fix
Explicitly set include patterns to limit scope.
affects: *
Errors
Common errors & fixes
Error: configEnv is required
EsLinter instantiated without passing the Vite ConfigEnv object.
fix
Ensure EsLinter is constructed within the defineConfig callback and configEnv is passed: new EsLinter({ configEnv })
TypeError: Cannot read properties of undefined (reading 'includes')
Plugin options include field is not an array or is undefined.
fix
Set include option as an array of patterns: include: ['./src/**/*.ts', './src/**/*.tsx']
Error: Could not find tsconfig.json
TypeScriptLinter default configFilePath is tsconfig.json but it does not exist in project root.
fix
Either create tsconfig.json or specify configFilePath: new TypeScriptLinter({ configFilePath: './otherTsconfig.json' })
Warning: Linter output injected into first non-node_modules file
Plugin injects output into the first file not in node_modules; if no such file exists, injection fails.
fix
Ensure there is at least one source file outside node_modules, or explicitly set injectFile option.
Upgrade
Version history
4.0.0latest on npm
Audit
Dependencies
viterequiredCore dependency; plugin uses Vite-specific hook configureServer
eslintoptionalRequired if using EsLinter
typescriptoptionalRequired if using TypeScriptLinter
Agent activity
31 hits · last 30 days
node
26
Bingbot
1
Resources
vite-plugin-linter — npm install vite-plugin-linter · libregistry