ESLint plugin for vite.
npm install vite-plugin-eslint --save-dev
# or
yarn add vite-plugin-eslint -D
# or
pnpm add vite-plugin-eslint -D
import { defineConfig } from 'vite';
import eslintPlugin from 'vite-plugin-eslint';
export default defineConfig({
plugins: [eslintPlugin()],
});
You can pass eslint options.
- Type:
boolean
- Default:
false
Decrease execution time, Beta
Cache now correctly recognizes file changes, you can try it out.
- Type:
boolean
- Default:
false
Auto fix source code.
- Type:
string | RegExp | ReadonlyArray<string | RegExp>
- Default:
/\.(jsx?|tsx?|vue|svelte)$/
A single file, or array of files, to include when linting.
- Type:
string | RegExp | ReadonlyArray<string | RegExp>
- Default:
[/virtual:/, /node_modules/]
A single file, or array of files, to exclude when linting.
- Type:
string | ESLint.Formatter['format']
- Default:
stylish
Custom error formatter or the name of a built-in formatter.
- Type:
boolean
- Default:
true
The warings found will be printed.
- Type:
boolean
- Default:
true
The errors found will be printed.
- Type:
boolean
- Default:
false
Will cause the module build to fail if there are any warnings, based on emitWarning
.
- Type:
boolean
- Default:
true
Will cause the module build to fail if there are any errors, based on emitError
.
- Type:
boolean
- Default:
false
- Deprecated: use
emitWarning
The warings found will be emitted.
- Type:
boolean
- Default:
false
- Deprecated: use
emitError
The errors found will be emitted.
MIT