Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All modules are linted in watch mode after changing only a single file #75

Closed
decademoon opened this issue Feb 5, 2021 · 7 comments · Fixed by #77
Closed

All modules are linted in watch mode after changing only a single file #75

decademoon opened this issue Feb 5, 2021 · 7 comments · Fixed by #77
Assignees
Labels
bug Something isn't working

Comments

@decademoon
Copy link

  • Operating System: macOS 11.1
  • Node Version: 15.7.0
  • NPM Version: yarn berry PnP
  • webpack Version: 4.46.0
  • eslint-webpack-plugin Version: 2.5.0

Expected Behavior

Only lint modules that were rebuilt after changing a file.

Actual Behavior

Every module is linted after changing a file.

Code

new ESLintPlugin({
  extensions: ['js', 'vue'],
})

How Do We Reproduce?

It seems there was a recent change to which hooks were used to lint the files. Before succeedModule was used which was only called with the rebuilt modules after a file change, but now finishModules is used which passes every module in the compilation, so all files get linted.

@ricardogobbosouza ricardogobbosouza added the bug Something isn't working label Feb 5, 2021
@ricardogobbosouza
Copy link
Collaborator

Solving it now. =)

@wendyzhaogogo
Copy link

wendyzhaogogo commented Feb 5, 2021

My problem is a little different. In my project, there remains a lot of errors & warnings. I only want to lint what is saved by current user in his IDE.
Now, when the project starts, all files are linted..about 100+

@ricardogobbosouza
Copy link
Collaborator

ricardogobbosouza commented Feb 5, 2021

@WilkinWendy for this you can enable lintDirtyModulesOnly

https://github.com/webpack-contrib/eslint-webpack-plugin#lintdirtymodulesonly

@wendyzhaogogo
Copy link

@WilkinWendy for this you can enable lintDirtyModulesOnly

I’ve tried it,but not work.

@wendyzhaogogo
Copy link

@WilkinWendy for this you can enable lintDirtyModulesOnly

I’ve tried it,but not work.

{ exclude: 'node_modules', extensions: ['.js', '.jsx', '.vue', '.ts', '.tsx'], quiet: true, cache: true, fix: true, lintDirtyModulesOnly: true, formatter: 'codeframe' }

@wendyzhaogogo
Copy link

@WilkinWendy for this you can enable lintDirtyModulesOnly

I’ve tried it,but not work.

In my project, the compilation seems to be triggered in a dead loop, when fix:true

@wendyzhaogogo
Copy link

@WilkinWendy for this you can enable lintDirtyModulesOnly

I’ve tried it,but not work.

In my project, the compilation seems to be triggered in a dead loop, when fix:true

I‘ve worked out reason of this problem.
If a file is unfixable,which means the output of the fixed file is the same as the source file,
eg: no-console rule is unfixable.
the outputFixes function will be executed in a dead loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants