Registry / testing / vite-eslint-plugin

vite-eslint-plugin

JSON →
library1.9.2jsnpmunverified

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.

npm install vite-eslint-plugin
INSTALL
IMPORT
SIG · VITE-ESLINT-PLUGIN
V
vite-eslint-plugin
testingjavascriptv1.9.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

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

default
import eslint from 'vite-eslint-plugin'
import { eslint } from 'vite-eslint-plugin'
The package exports a default function. Named import does not work.
eslint
const eslint = require('vite-eslint-plugin')
const { eslint } = require('vite-eslint-plugin')
CommonJS require returns the default export as a function.
default
import eslintPlugin from 'vite-eslint-plugin'
You can alias the default import to any name.

Configures the ESLint plugin for production builds (fails on errors) and development server (warnings and errors do not fail).

// vite.config.ts import { defineConfig } from 'vite' import eslint from 'vite-eslint-plugin' export default defineConfig({ plugins: [ { // fail on errors during build ...eslint(), apply: 'build', }, { // do not fail during dev ...eslint({ failOnWarning: false, failOnError: false }), apply: 'serve', enforce: 'post', }, ], })
Debug
Known issues
gotchaThe plugin may significantly slow down HMR if lintOnStart is enabled, because it lints all matching files on startup.
fix
Set lintOnStart: false (default) unless you need initial linting of the whole project.
affects: >=0.0.0
breakingVersion 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.
fix
Use default import: `import eslint from 'vite-eslint-plugin'`.
affects: >=1.0.0
deprecatedThe option `emitWarning` and `emitError` are deprecated in favor of `failOnWarning` and `failOnError`.
fix
Use `failOnWarning` and `failOnError` instead.
affects: >=0.0.0
gotchaIf you use TypeScript and have `@types/eslint` installed, you may need to ensure the versions align with your eslint peer dependency.
fix
Align @types/eslint version with eslint peer dependency (>=7).
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: eslint is not a function
Using named import `{ eslint }` instead of default import.
fix
Change import to: `import eslint from 'vite-eslint-plugin'`
Error: ESLint configuration is invalid: No configuration found for file...
ESLint cannot find an ESLint configuration file (e.g., .eslintrc) in the project root.
fix
Create an ESLint configuration file (e.g., .eslintrc.json) or specify `overrideConfigFile` in plugin options.
Error: Cannot find module 'eslint'
ESLint is not installed as a peer dependency.
fix
Install eslint: `npm install eslint --save-dev`
Upgrade
Version history
1.9.2latest on npm
Audit
Dependencies
@types/eslintoptionalPeer dependency required for TypeScript types when using ESLint in TypeScript projects.
eslintrequiredPeer dependency: core ESLint library required for linting functionality.
viterequiredPeer dependency: required to integrate with Vite build tool.
Agent activity
9 hits · last 30 days
node
8
Resources
vite-eslint-plugin — npm install vite-eslint-plugin · libregistry