Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

vite-plugin-eslint

gxmari0072.1mMIT1.8.1TypeScript support: included

ESLint plugin for vite.

eslint, vite-plugin

readme

vite-plugin-eslint

npm npm peer dependency version npm peer dependency version GitHub license

ESLint plugin for vite.

Install

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

Usage

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

export default defineConfig({
  plugins: [eslint()]
})

Options

You can pass eslint options.

cache

  • Type: boolean
  • Default: false

Decrease execution time, Beta Cache now correctly recognizes file changes, you can try it out.

fix

  • Type: boolean
  • Default: false

Auto fix source code.

eslintPath

  • Type: string
  • Default: eslint

Path to eslint instance that will be used for linting.

lintOnStart

  • Type: boolean
  • Default: false

Check all matching files on project startup, too slow, turn on discreetly.

include

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

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['format']
  • Default: stylish

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

emitWarning

  • Type: boolean
  • Default: true

The warings found will be printed.

emitError

  • Type: boolean
  • Default: true

The errors found will be printed.

failOnWarning

  • Type: boolean
  • Default: false

Will cause the module build to fail if there are any warnings, based on emitWarning.

failOnError

  • Type: boolean
  • Default: true

Will cause the module build to fail if there are any errors, based on emitError.

License

MIT

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.8.1 (2022-08-16)

Bug Fixes

1.8.0 (2022-08-11)

Features

  • add eslintPath option to customize eslint instance (128fc9a), closes #23
  • add lintOnStart option (851be59)

Bug Fixes

1.7.0 (2022-07-19)

Features

1.6.1 (2022-05-19)

Bug Fixes

  • add @types/eslint dependency to resolve property type incompleteness (b73285f), closes #31
  • make sure to export eslint parameter types (7d7d3b8)

1.6.0 (2022-04-25)

Features

  • add emitError replace throwOnError (063109e)
  • add emitWarning replace throwOnWarning (2f1b643)
  • add failOnError, if there are any errors to make module build fails (cc72a01), closes #24
  • add failOnWarning, if there are any warnings when the module build fails (f2e800f)

Bug Fixes

  • when cache is true, some file change will not trigger cache file update (f196bab)

1.5.2 (2022-04-21)

Bug Fixes

  • install eslint8 warning (1c9ced4)

1.5.1 (2022-04-20)

Bug Fixes

  • set include default value to /\.(jsx?|tsx?|vue|svelte)$/ (6d09b28)

1.5.0 (2022-04-20)

Features

  • can pass eslint options (e19147a)
  • set default options cache: false, include: src/*/, exclude: /node_modules/ (99fa887)

1.4.0 (2022-04-11)

Features

1.3.0 (2021-06-26)

Features

  • add throwOnWarning and throwOnError config options (0dc6386), closes #6

1.2.0 (2021-06-22)

Features

  • add cacheLocation settings, remove .eslintcache file (0df9bd8)

1.1.3 (2021-06-17)

Bug Fixes

  • fix png file emit error (fa105d6)

1.1.2 (2021-06-10)

Bug Fixes

  • set the default value of include with src/**/* to prevent errors during build (babe97e), closes #3

1.1.1 (2021-05-27)

1.1.0 (2021-02-22)

Features

  • add fix prop, auto fix source code (b97c77f)
  • support eslint cache (33c451c)

1.0.5 (2021-02-19)

1.0.4 (2021-02-19)