-
-
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 #43, #44, #45 #47
Conversation
Codecov Report
@@ Coverage Diff @@
## master #47 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 8
Lines 200 219 +19
Branches 55 59 +4
=========================================
+ Hits 200 219 +19
Continue to review full report at Codecov.
|
@evilebottnawi @ricardogobbosouza this should fix #44 and #45 |
/cc @evilebottnawi |
@@ -51,6 +58,9 @@ export default function linter(options, compilation) { | |||
* @param {string | string[]} files | |||
*/ | |||
function lint(files) { | |||
for (const file of asList(files)) { | |||
delete crossRunResultStorage[file]; | |||
} |
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.
Why we need manually delete it? When you remove something from WeakMap often means that you are using it out of place
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.
Thats not the WeakMap. The WeakMap keeps a compiler instance to (file=>lintresult map) mapping.
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.
If we lint a file and it does not contain errors, we don't want the old result just in case we do not get a result back from the linter.
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.
Why we need to keep old result?
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.
That's the point of #44 ... we need to keep reporting results until they are resolved. In watch mode if the user edits a file we don't want to discard all the other file results and only show the one file's results.
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.
In each run of the compiler, we only get the results of the files we lint... in watch mode, that may only be one file. But this should be cumulative not just the last run.
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.
Thanks for explanation
85df345
I added a fix for #43 as well. |
/cc @ricardogobbosouza I think we can merge |
This PR contains a:
Motivation / Use-Case
Fix #43, #44, and #45
Breaking Changes
Additional Info