Skip to content

Marcoru97/vite-plugin-eslint

 
 

Repository files navigation

vite-plugin-eslint

npm npm peer dependency version npm peer dependency version GitHub license

ESLint plugin for vite.

Install

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

Usage

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

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

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.

include

  • Type: string | RegExp | ReadonlyArray<string | RegExp>
  • Default: /\.(jsx?|tsx?|vue|svelte)$/

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

exclude

  • Type: string | RegExp | ReadonlyArray<string | RegExp>
  • Default: [/virtual:/, /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.

throwOnWarning

  • Type: boolean
  • Default: false
  • Deprecated: use emitWarning

The warings found will be emitted.

throwOnError

  • Type: boolean
  • Default: false
  • Deprecated: use emitError

The errors found will be emitted.

License

MIT

About

🚨 ESLint plugin for vite

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 77.7%
  • Vue 11.9%
  • HTML 8.4%
  • JavaScript 2.0%