Gathering detailed insights and metrics for eslint-loader-fs-cache
Gathering detailed insights and metrics for eslint-loader-fs-cache
Gathering detailed insights and metrics for eslint-loader-fs-cache
Gathering detailed insights and metrics for eslint-loader-fs-cache
@npmteam2024/nesciunt-tempore-occaecati
A simple cache system for a single user request, built on the same concepts of [data loader](https://github.com/facebook/dataloader).
@wemnyelezxnpm/nemo-accusamus-magnam
A simple cache system for a single user request, built on the same concepts of [data loader](https://github.com/facebook/dataloader).
npm install eslint-loader-fs-cache
Typescript
Module System
Node Version
NPM Version
44.3
Supply Chain
85.1
Quality
68.4
Maintenance
50
Vulnerability
96.8
License
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
1,608
Last Day
2
Last Week
3
Last Month
17
Last Year
88
MIT License
136 Commits
1 Forks
2 Watchers
4 Branches
1 Contributors
Updated on Feb 17, 2017
Minified
Minified + Gzipped
Latest Version
1.6.7
Package Id
eslint-loader-fs-cache@1.6.7
Size
5.93 kB
NPM Version
4.3.0
Node Version
6.9.5
Published on
Mar 09, 2017
Cumulative downloads
Total Downloads
Last Day
0%
2
Compared to previous day
Last Week
-57.1%
3
Compared to previous week
Last Month
466.7%
17
Compared to previous month
Last Year
-9.3%
88
Compared to previous year
1
5
eslint loader for webpack
1$ npm install eslint-loader --save-dev
In your webpack configuration
1module.exports = { 2 // ... 3 module: { 4 rules: [ 5 { 6 test: /\.js$/, 7 exclude: /node_modules/, 8 loader: "eslint-loader", 9 options: { 10 // eslint options (if necessary) 11 } 12 }, 13 ], 14 }, 15 // ... 16}
When using with transpiling loaders (like babel-loader
), make sure they are in correct order
(bottom to top). Otherwise files will be check after being processed by babel-loader
1module.exports = { 2 // ... 3 module: { 4 rules: [ 5 { 6 test: /\.js$/, 7 exclude: /node_modules/, 8 use: [ 9 "babel-loader", 10 "eslint-loader", 11 ], 12 }, 13 ], 14 }, 15 // ... 16}
To be safe, you can use enforce: "pre"
section to check source files, not modified
by other loaders (like babel-loader
)
1module.exports = { 2 // ... 3 module: { 4 rules: [ 5 { 6 enforce: "pre", 7 test: /\.js$/, 8 exclude: /node_modules/, 9 loader: "eslint-loader", 10 }, 11 { 12 test: /\.js$/, 13 exclude: /node_modules/, 14 loader: "babel-loader", 15 }, 16 ], 17 }, 18 // ... 19}
You can pass eslint options using standard webpack loader options.
Note that the config option you provide will be passed to the CLIEngine
.
This is a different set of options than what you'd specify in package.json
or .eslintrc
.
See the eslint docs for more detail.
fix
(default: false)This option will enable ESLint autofix feature.
Be careful: this option might cause webpack to enter an infinite build loop if some issues cannot be fixed properly.
cache
(default: false)This option will enable caching of the linting results into a file. This is particularly useful in reducing linting time when doing a full build.
The cache file is written to the ./node_modules/.cache
directory, thanks to the usage
of the find-cache-dir module.
formatter
(default: eslint stylish formatter)Loader 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.
1module.exports = { 2 entry: "...", 3 module: { 4 rules: [ 5 { 6 test: /\.js$/, 7 exclude: /node_modules/, 8 loader: "eslint-loader", 9 options: { 10 // several examples ! 11 12 // default value 13 formatter: require("eslint/lib/formatters/stylish"), 14 15 // community formatter 16 formatter: require("eslint-friendly-formatter"), 17 18 // custom formatter 19 formatter: function(results) { 20 // `results` format is available here 21 // http://eslint.org/docs/developer-guide/nodejs-api.html#executeonfiles() 22 23 // you should return a string 24 // DO NOT USE console.*() directly ! 25 return "OUTPUT" 26 } 27 } 28 }, 29 ], 30 }, 31}
By default the loader will auto adjust error reporting depending
on eslint errors/warnings counts.
You can still force this behavior by using emitError
or emitWarning
options:
emitError
(default: false
)Loader will always return errors if this option is set to true
.
1module.exports = { 2 entry: "...", 3 module: { 4 rules: [ 5 { 6 test: /\.js$/, 7 exclude: /node_modules/, 8 loader: "eslint-loader", 9 options: { 10 emitError: true, 11 } 12 }, 13 ], 14 }, 15}
emitWarning
(default: false
)Loader will always return warnings if option is set to true
.
quiet
(default: false
)Loader will process and report errors only and ignore warnings if this option is set to true
1module.exports = { 2 entry: "...", 3 module: { 4 rules: [ 5 { 6 test: /\.js$/, 7 exclude: /node_modules/, 8 loader: "eslint-loader", 9 options: { 10 quiet: true, 11 } 12 }, 13 ], 14 }, 15}
failOnWarning
(default: false
)Loader will cause the module build to fail if there are any eslint warnings.
1module.exports = { 2 entry: "...", 3 module: { 4 rules: [ 5 { 6 test: /\.js$/, 7 exclude: /node_modules/, 8 loader: "eslint-loader", 9 options: { 10 failOnWarning: true, 11 } 12 }, 13 ], 14 }, 15}
failOnError
(default: false
)Loader will cause the module build to fail if there are any eslint errors.
1module.exports = { 2 entry: "...", 3 module: { 4 rules: [ 5 { 6 test: /\.js$/, 7 exclude: /node_modules/, 8 loader: "eslint-loader", 9 options: { 10 failOnError: true, 11 } 12 }, 13 ], 14 }, 15}
outputReport
(default: 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 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
1module.exports = { 2 entry: "...", 3 module: { 4 rules: [ 5 { 6 test: /\.js$/, 7 exclude: /node_modules/, 8 loader: "eslint-loader", 9 options: { 10 outputReport: { 11 filePath: 'checkstyle.xml', 12 formatter: require('eslint/lib/formatters/checkstyle') 13 } 14 } 15 }, 16 ], 17 }, 18}
NoErrorsPlugin
prevents Webpack from outputting anything into a bundle. So even ESLint warnings
will fail the build. No matter what error settings are used for eslint-loader
.
So if you want to see ESLint warnings in console during development using WebpackDevServer
remove NoErrorsPlugin
from webpack config.
configFile
or using eslint -c path/.eslintrc
Bear in mind that when you define configFile
, eslint
doesn't automatically look for
.eslintrc
files in the directory of the file to be linted.
More information is available in official eslint documentation in section Using Configuration Files.
See #129.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
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
branch protection not enabled on development/release branches
Details
Reason
78 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-03
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