$ cnpm install vite-plugin-eslint
ESLint plugin for vite.
npm install eslint vite-plugin-eslint --save-dev
# or
yarn add eslint vite-plugin-eslint -D
import { defineConfig } from 'vite'
import eslint from 'vite-plugin-eslint'
export default defineConfig({
plugins: [eslint()]
})
You can pass eslint options.
cachebooleanfalseDecrease execution time, Beta Cache now correctly recognizes file changes, you can try it out.
fixbooleanfalseAuto fix source code.
eslintPathstringeslintPath to eslint instance that will be used for linting.
lintOnStartbooleanfalseCheck all matching files on project startup, too slow, turn on discreetly.
includestring | string[]['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.vue', '**/*.svelte']A single file, or array of files, to include when linting.
excludestring | string[]['**/node_modules/**']A single file, or array of files, to exclude when linting.
formatterstring | ESLint.Formatter['format']stylishCustom error formatter or the name of a built-in formatter.
emitWarningbooleantrueThe warings found will be printed.
emitErrorbooleantrueThe errors found will be printed.
failOnWarningbooleanfalseWill cause the module build to fail if there are any warnings, based on emitWarning.
failOnErrorbooleantrueWill cause the module build to fail if there are any errors, based on emitError.
MIT
Copyright 2013 - present © cnpmjs.org | Home |