Gathering detailed insights and metrics for eslint-webpack-plugin
Gathering detailed insights and metrics for eslint-webpack-plugin
Gathering detailed insights and metrics for eslint-webpack-plugin
Gathering detailed insights and metrics for eslint-webpack-plugin
craco-eslint-webpack-plugin
A craco plugin for eslint-webpack-plugin
prettier-eslint-plugin
Fork of prettier-eslint-webpack-plugin
fork-ts-checker-webpack-plugin
Runs typescript type checker and linter on separate process.
eslint-import-resolver-webpack
Resolve paths to dependencies, given a webpack.config.js. Plugin for eslint-plugin-import.
npm install eslint-webpack-plugin
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
259 Stars
177 Commits
48 Forks
13 Watching
2 Branches
37 Contributors
Updated on 08 Nov 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-5%
742,766
Compared to previous day
Last week
1.3%
3,931,124
Compared to previous week
Last month
6.3%
16,785,848
Compared to previous month
Last year
-7.2%
206,615,771
Compared to previous year
30
This version of eslint-webpack-plugin only works with webpack 5. For the webpack 4, see the 2.x branch.
This plugin uses eslint
to find and fix problems in your JavaScript code
To begin, you'll need to install eslint-webpack-plugin
:
1npm install eslint-webpack-plugin --save-dev
or
1yarn add -D eslint-webpack-plugin
or
1pnpm add -D eslint-webpack-plugin
[!NOTE]
You also need to install
eslint >= 8
from npm, if you haven't already:
1npm install eslint --save-dev
or
1yarn add -D eslint
or
1pnpm add -D eslint
Then add the plugin to your webpack config. For example:
1const ESLintPlugin = require('eslint-webpack-plugin'); 2 3module.exports = { 4 // ... 5 plugins: [new ESLintPlugin(options)], 6 // ... 7};
You can pass eslint options.
[!NOTE]
The config option you provide will be passed to the
ESLint
class. This is a different set of options than what you'd specify inpackage.json
or.eslintrc
. See the eslint docs for more details.
[!WARNING]
In eslint-webpack-plugin version 1 the options were passed to the now deprecated CLIEngine.
cache
1type cache = boolean;
true
The cache is enabled by default to decrease execution time.
cacheLocation
1type cacheLocation = string;
node_modules/.cache/eslint-webpack-plugin/.eslintcache
Specify the path to the cache location. Can be a file or a directory.
configType
1type configType = 'flat' | 'eslintrc';
eslintrc
Specify the type of configuration to use with ESLint.
eslintrc
is the classic configuration format available in most ESLint versions.flat
is the new format introduced in ESLint 8.21.0.The new configuration format is explained in its own documentation.
This configuration format being considered as experimental, it is not exported in the main ESLint module in ESLint 8. You need to set your
eslintPath
toeslint/use-at-your-own-risk
for this config format to work.
context
1type context = string;
compiler.context
A string indicating the root of your files.
eslintPath
1type eslintPath = string;
eslint
Path to eslint
instance that will be used for linting. If the eslintPath
is a folder like a official eslint, or specify a formatter
option. now you don't have to install eslint
.
extensions
1type extensions = string | Array<string>;
'js'
Specify extensions that should be checked.
exclude
1type exclude = string | Array<string>;
'node_modules'
Specify the files and/or directories to exclude. Must be relative to options.context
.
resourceQueryExclude
1type resourceQueryExclude = RegExp | Array<RegExp>;
[]
Specify the resource query to exclude.
files
1type files = string | Array<string>;
null
Specify directories, files, or globs. Must be relative to options.context
.
Directories are traversed recursively looking for files matching options.extensions
.
File and glob patterns ignore options.extensions
.
fix
1type fix = boolean;
false
Will enable ESLint autofix feature.
Be careful: this option will change source files.
formatter
1type formatter = string| ( 2 results: Array<import('eslint').ESLint.LintResult>, 3 data?: import('eslint').ESLint.LintResultData | undefined 4) => string
'stylish'
Accepts a function that will have one argument: an array of eslint messages (object). The function must return the output as a string. You can use official eslint formatters.
lintDirtyModulesOnly
1type lintDirtyModulesOnly = boolean;
false
Lint only changed files, skip lint on start.
threads
1type threads = boolean | number;
false
Will run lint tasks across a thread pool. The pool size is automatic unless you specify a number.
By default the plugin will auto adjust error reporting depending on eslint errors/warnings counts.
You can still force this behavior by using emitError
or emitWarning
options:
emitError
1type emitError = boolean;
true
The errors found will always be emitted, to disable set to false
.
emitWarning
1type emitWarning = boolean;
true
The warnings found will always be emitted, to disable set to false
.
failOnError
1type failOnError = boolean;
true
Will cause the module build to fail if there are any errors, to disable set to false
.
failOnWarning
1type failOnWarning = boolean;
false
Will cause the module build to fail if there are any warnings, if set to true
.
quiet
1type quiet = boolean;
false
Will process and report errors only and ignore warnings, if set to true
.
outputReport
1type outputReport = 2 | boolean 3 | { 4 filePath?: string | undefined; 5 formatter?: 6 | ( 7 | string 8 | (( 9 results: Array<import('eslint').ESLint.LintResult>, 10 data?: import('eslint').ESLint.LintResultData | undefined, 11 ) => string) 12 ) 13 | undefined; 14 };
false
Write the output of the errors to a file, for example a checkstyle xml file for use for reporting on Jenkins CI.
The filePath
is an absolute path or relative to the webpack config: output.path
.
You can pass in a different formatter
for the output file,
if none is passed in the default/configured formatter will be used.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
Found 25/30 approved changesets -- score normalized to 8
Reason
2 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 4
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More