cache lint results for faster repeat execution#10773
Merged
brad-decker merged 1 commit intodevelopfrom Mar 31, 2021
Merged
Conversation
Member
Agreed! Seems like a reasonable tradeoff to me. I'm curious why this cache is never hit on CI though, if the flag is still used. Where is the cache? 🤔 |
Contributor
Author
|
@Gudahtt the cache is in a file that gets generated .eslintcache -- i don't think it should be persisted between runs unless we tell it to? We can tell eslint where to put the cache file and what to name it or if I can change CI so that it definitely doesn't persist that file I can. |
Member
|
Gotcha. That sounds OK. I was afraid it was being cached in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Increase performance of lint on successive runs
First run, normal:
Second run, cached:
Third run, after changing one file to have a lint issue, only one file checked:
The problem with this setup is with the import plugin. For example, if you change a file such that it no longer exports a thing, but the file is still valid...running lint won't find the errors in files that did not change but that rely on that import. eg:
changing
footobazin File a will not trigger a lint failure with the cache option, but when removing the cache or running in CI it will find it. I'm almost still in favor of this! I'd rather have 150 seconds of my day back frequently and be like "doh" when it fails in CI. 😅