eslint-webpack-plugin
Advanced tools
Comparing version 2.5.2 to 2.5.3
@@ -5,2 +5,10 @@ # Changelog | ||
### [2.5.3](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v2.5.2...v2.5.3) (2021-03-24) | ||
### Bug Fixes | ||
* allow multiple instances ([#92](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/92)) ([0cdd621](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/0cdd621be597c643cad6c4a41c7fed31c29fb1a5)) | ||
* match hidden directories for path exclusions ([#87](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/87)) ([bb8750c](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/bb8750cb8a1cb4f6297a07b579ad4e394e11d968)) | ||
### [2.5.2](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v2.5.1...v2.5.2) (2021-02-18) | ||
@@ -7,0 +15,0 @@ |
@@ -10,2 +10,3 @@ export default ESLintWebpackPlugin; | ||
constructor(options?: Options); | ||
key: string; | ||
options: import('./options').PluginOptions; | ||
@@ -21,3 +22,2 @@ /** | ||
apply(compiler: Compiler): void; | ||
key: string | undefined; | ||
/** | ||
@@ -24,0 +24,0 @@ * |
"use strict"; | ||
const plugin = require('./index'); | ||
const plugin = require('./'); | ||
module.exports = plugin.default; |
@@ -35,2 +35,3 @@ "use strict"; | ||
constructor(options = {}) { | ||
this.key = ESLINT_PLUGIN; | ||
this.options = (0, _options.getOptions)(options); | ||
@@ -48,7 +49,7 @@ this.run = this.run.bind(this); | ||
// this differentiates one from the other when being cached. | ||
this.key = compiler.name || `${ESLINT_PLUGIN}_${counter += 1}`; // If `lintDirtyModulesOnly` is disabled, | ||
this.key = compiler.name || `${this.key}_${counter += 1}`; // If `lintDirtyModulesOnly` is disabled, | ||
// execute the linter on the build | ||
if (!this.options.lintDirtyModulesOnly) { | ||
compiler.hooks.run.tapPromise(ESLINT_PLUGIN, this.run); | ||
compiler.hooks.run.tapPromise(this.key, this.run); | ||
} // TODO: Figure out want `compiler.watching` is and how to use it in Webpack5. | ||
@@ -61,3 +62,3 @@ // From my testing of compiler.watch() ... compiler.watching is always | ||
let isFirstRun = this.options.lintDirtyModulesOnly; | ||
compiler.hooks.watchRun.tapPromise(ESLINT_PLUGIN, c => { | ||
compiler.hooks.watchRun.tapPromise(this.key, c => { | ||
if (isFirstRun) { | ||
@@ -79,6 +80,5 @@ isFirstRun = false; | ||
if ( // @ts-ignore | ||
compiler.hooks.thisCompilation.taps.find( // @ts-ignore | ||
({ | ||
compiler.hooks.thisCompilation.taps.find(({ | ||
name | ||
}) => name === ESLINT_PLUGIN)) { | ||
}) => name === this.key)) { | ||
return; | ||
@@ -94,3 +94,3 @@ } | ||
const exclude = (0, _utils.parseFoldersToGlobs)(this.options.exclude ? options.exclude : '**/node_modules/**', []); | ||
compiler.hooks.thisCompilation.tap(ESLINT_PLUGIN, compilation => { | ||
compiler.hooks.thisCompilation.tap(this.key, compilation => { | ||
/** @type {import('./linter').Linter} */ | ||
@@ -117,3 +117,3 @@ let lint; | ||
compilation.hooks.succeedModule.tap(ESLINT_PLUGIN, ({ | ||
compilation.hooks.succeedModule.tap(this.key, ({ | ||
resource | ||
@@ -124,3 +124,7 @@ }) => { | ||
if (file && !files.includes(file) && (0, _micromatch.isMatch)(file, wanted) && !(0, _micromatch.isMatch)(file, exclude)) { | ||
if (file && !files.includes(file) && (0, _micromatch.isMatch)(file, wanted, { | ||
dot: true | ||
}) && !(0, _micromatch.isMatch)(file, exclude, { | ||
dot: true | ||
})) { | ||
files.push(file); | ||
@@ -131,3 +135,3 @@ } | ||
compilation.hooks.finishModules.tap(ESLINT_PLUGIN, () => { | ||
compilation.hooks.finishModules.tap(this.key, () => { | ||
if (files.length > 0) { | ||
@@ -138,3 +142,3 @@ lint(files); | ||
compilation.hooks.additionalAssets.tapPromise(ESLINT_PLUGIN, processResults); | ||
compilation.hooks.additionalAssets.tapPromise(this.key, processResults); | ||
@@ -141,0 +145,0 @@ async function processResults() { |
{ | ||
"name": "eslint-webpack-plugin", | ||
"version": "2.5.2", | ||
"version": "2.5.3", | ||
"description": "A ESLint plugin for webpack", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53509
1062