eslint-webpack-plugin: Module lint errors are reported when module is not included in webpack bundle

  • Operating System: N/R
  • Node Version: N/R
  • NPM Version: N/R
  • webpack Version: N/R
  • eslint-webpack-plugin Version: 2.4.3 (the same issue occurs on branch pref-use-finish-modules)

Let’s assume scenario: webpack entry point: index.js

  • index.js
  • lintError.js
  1. index.js:
import "lintError.js";

webpack is erroring with lintError.js’s linting error

  1. let’s change index.js (lintErrorjs.js is no longer imported in the bundle):
// import "lintErrorjs";

again webpack is erroring with lintError.js’s linting error

Expected Behavior / Situation

after index.js is changed (2) webpack shouldn’t throw error

Actual Behavior / Situation

webpack is throwing an error

Modification Proposal

the issue is this line: https://github.com/webpack-contrib/eslint-webpack-plugin/blob/4daddf5335b2c78203482d7e7f6d82a909277212/src/linter.js#L84

I propose getting rid of cache in src/linter.js, as we are not using it as cache at all, maybe create a real caching mechanism

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 1
  • Comments: 16 (7 by maintainers)

Most upvoted comments

Solving it now. =)