Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
vite-plugin-eslint
Advanced tools
vite-plugin-eslint is a Vite plugin that integrates ESLint into the Vite build process. It allows you to lint your code on build and serve, ensuring that your code adheres to the specified linting rules.
Lint on Build
This feature allows you to lint your code during the build process. By adding the eslintPlugin to the Vite configuration, ESLint will run and report any linting errors or warnings.
import { defineConfig } from 'vite';
import eslintPlugin from 'vite-plugin-eslint';
export default defineConfig({
plugins: [eslintPlugin()]
});
Lint on Serve
This feature allows you to lint your code during the development server process. You can specify which files to include or exclude from linting.
import { defineConfig } from 'vite';
import eslintPlugin from 'vite-plugin-eslint';
export default defineConfig({
plugins: [eslintPlugin({
include: ['src/**/*.js', 'src/**/*.vue'],
exclude: ['node_modules']
})]
});
Custom ESLint Options
This feature allows you to pass custom ESLint options to the plugin. For example, you can enable the 'fix' option to automatically fix linting errors where possible.
import { defineConfig } from 'vite';
import eslintPlugin from 'vite-plugin-eslint';
export default defineConfig({
plugins: [eslintPlugin({
eslintOptions: {
fix: true
}
})]
});
eslint-webpack-plugin is a plugin for Webpack that integrates ESLint into the Webpack build process. It offers similar functionality to vite-plugin-eslint but is designed for use with Webpack instead of Vite.
rollup-plugin-eslint is a plugin for Rollup that integrates ESLint into the Rollup build process. Like vite-plugin-eslint, it allows you to lint your code during the build process, but it is tailored for Rollup.
eslint-loader is a loader for Webpack that allows you to lint your code using ESLint. It is similar to eslint-webpack-plugin but is used as a loader rather than a plugin.
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.
cache
boolean
false
Decrease execution time, Beta
Cache now correctly recognizes file changes, you can try it out.
fix
boolean
false
Auto fix source code.
eslintPath
string
eslint
Path to eslint
instance that will be used for linting.
lintOnStart
boolean
false
Check all matching files on project startup, too slow, turn on discreetly.
include
string | string[]
['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.vue', '**/*.svelte']
A single file, or array of files, to include when linting.
exclude
string | string[]
['**/node_modules/**']
A single file, or array of files, to exclude when linting.
formatter
string | ESLint.Formatter['format']
stylish
Custom error formatter or the name of a built-in formatter.
emitWarning
boolean
true
The warings found will be printed.
emitError
boolean
true
The errors found will be printed.
failOnWarning
boolean
false
Will cause the module build to fail if there are any warnings, based on emitWarning
.
failOnError
boolean
true
Will cause the module build to fail if there are any errors, based on emitError
.
MIT
FAQs
ESLint plugin for vite.
The npm package vite-plugin-eslint receives a total of 339,950 weekly downloads. As such, vite-plugin-eslint popularity was classified as popular.
We found that vite-plugin-eslint demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.