-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
fix: prevent lint all files #77
Conversation
Codecov Report
@@ Coverage Diff @@
## master #77 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 8
Lines 251 251
Branches 71 71
=========================================
Hits 251 251
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to look at better hook and logic here, but right now is good solution, let's return to this in future
Will be great to add test using mock
I think that unfortunately this fix won't work after merging webpack reports errors from lintError.js I would suggest not merging this PR and creating global cache in |
This will only be possible in v3 because |
In v3 version support for webpack 4 will be removed |
when v3 will be available, as beta or next ? |
I've learned about |
@watjurk It looks good to me 😄 |
Should I create PR to this repo ? |
Do you want to create a pr or do you prefer me to do it? |
I think I prefer you to do this, maybe some day... |
why |
Sorry but I don't understand your point, could you explain ? |
I just don't known the reason, why |
According to the documentation, the invalid hook is called to the changed or removed file |
|
Search for _done method in the Watching.js, and you will find: process.nextTick(() => {
if (!this.closed) {
this.watch(
compilation.fileDependencies,
compilation.contextDependencies,
compilation.missingDependencies
);
}
}); as you see this.watch is called every time webpack is done compiling, and this is why this.watcher.once i really "not once". |
Thank you ,so the name of this hook called 'invalid' is not strict ,is it ? |
What do you mean by saying it's not strict ? It's just called 'invalid' because it's called every time compilation is invalidated (something change), this is how I think about it. |
yes , you are right.that's it, I have to learn webpack in detail. |
This PR temporarily solves the performance problem ... |
This PR contains a:
Motivation / Use-Case
The goal is to group the changed files and execute lint only at the end
succeedModule
its called for every file and watch mode just file changedfinishModules
is called with all modules and is responsible for linting added filesResolve #75
Breaking Changes
Additional Info