webpack-contrib / eslint-loader

[DEPRECATED] A ESlint loader for webpack
MIT License
1.06k stars 121 forks source link

Lint dirty/modified files only #304

Closed thasmo closed 4 years ago

thasmo commented 5 years ago

Feature Proposal

Add an option similar to the lintDirtyModulesOnly option of the styleling plugin, which only lints changed files and skips linting on start; could be false by default.

Use Case

Introducing linting to an existing big project is a lot of work and a possibility to lint and fix only changed files can be a huge benefit, as errors and warnings show up only for those files.

DiscoNova commented 5 years ago

I do see a benefit of this... but - to me at least - it appears that this approach could lead to issues somewhere down the road.

Doing tons of changes (that may be completely unrelated to the change you intended to make simply because it was dismissed from linting before) on a file you're modifying for a specific thing ... can easily lead to things getting missed on peer review.

Whereas... if the file fails linting without the changes you've made, that gets fixed first (which is everything literally connected to the thing you want to change) ... and then you modify things in another commit ... to me - that would seem like a more clear approach.

ricardogobbosouza commented 5 years ago

@thasmo this would require creating a plugin, which runs a little farther, as this is a loader. We can think of creating an eslint-webpack-plugin plugin that incorporates this loader, what do you think @evilebottnawi ?

alexander-akait commented 5 years ago

@ricardogobbosouza yes, it is require create plugin, plugins also have more api than loader, maybe it is good idea migrate on plugin

ricardogobbosouza commented 5 years ago

@evilebottnawi Should we create a separate repository? or migrate this?

alexander-akait commented 5 years ago

@ricardogobbosouza will be great create separate repo and deprecate this after official release. Do you want to do it? If yes, just ping me again and i will create new repo

ricardogobbosouza commented 5 years ago

ping @evilebottnawi please create repository eslint-webpack-plugin

alexander-akait commented 5 years ago

@ricardogobbosouza Welcome https://github.com/webpack-contrib/eslint-webpack-plugin :tada:

ricardogobbosouza commented 5 years ago

@evilebottnawi thanks

ricardogobbosouza commented 4 years ago

https://github.com/webpack-contrib/eslint-webpack-plugin/ @evilebottnawi its almost ready :smile:

Can configure azure pipeline? https://github.com/webpack-contrib/eslint-webpack-plugin/issues/1

thasmo commented 4 years ago

@ricardogobbosouza, awesome - didn't expect to have this so fast. Very nice! Going to look into it asap. 👍

ricardogobbosouza commented 4 years ago

@thasmo thanks

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

ricardogobbosouza commented 4 years ago

I'll leave it open for now, but the idea is to use eslint-webpack-plugin