vite-plugin-eslint

ESLint plugin for vite.

Usage no npm install needed!

<script type="module">
  import vitePluginEslint from 'https://cdn.skypack.dev/vite-plugin-eslint';
</script>

README

vite-plugin-eslint

npm GitHub license

ESLint plugin for vite.

Install

npm install vite-plugin-eslint --save-dev
# or
yarn add vite-plugin-eslint --dev

Usage

import { defineConfig } from 'vite';
import eslintPlugin from 'vite-plugin-eslint';

export default defineConfig({
  plugins: [eslintPlugin()],
});

Options

cache

  • Type: boolean
  • Default: true

Decrease execution time.

fix

  • Type: boolean
  • Default: false

Auto fix source code.

include

  • Type: string | string[]
  • Default: ['src/**/*.js', 'src/**/*.jsx', 'src/**/*.ts', 'src/**/*.tsx', 'src/**/*.vue']

A single file, or array of files, to include when linting.

exclude

  • Type: string | string[]
  • Default: 'node_modules'

A single file, or array of files, to exclude when linting.

formatter

  • Type: string | ESLint.Formatter
  • Default: stylish

Custom error formatter or the name of a built-in formatter.

throwOnWarning

  • Type: boolean
  • Default: true

The warings found will be emitted, default to true.

throwOnError

  • Type: boolean
  • Default: true

The errors found will be emitted, default to true.

License

MIT