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
ESLint ignores its own cache #13517
Comments
Hi @kirill-konshin, thanks for the issue!
If you are using the same cache file in different clones of the same repository, it's more likely that the cache file itself is used but all the files have different mtimes compared to the run where the cache file was created. ESLint cache currently uses mtime and size of the file to verify if the file was changed. There is eslint/rfcs#63 proposal to optionally use checksum instead of mtime. |
We are using Which in turn means that cache is useless. In our case it takes 15min to lint w/o a cache... I’ve managed to speed it up to 4min by using https://github.com/jest-community/jest-runner-eslint to run ESLint in parallel. Fun part is that it has its own cache issue on top of ESLint’s one jest-community/jest-runner-eslint#82. So basically at this moment I don’t see how to utilize cache in the CI env like Gitlab where workspace can be cloned over and over. Unlike some other CI systems, where workspace is created per-branch and runner/executor is sticky. In Gitlab any job can be picked up by any runner. P.S. What a coincidence, the proposal you were referring to was created 2 days ago ) |
Unfortunately, at the moment it does seem useless in this scenario. I hope we'll be able to add better support for the use of eslint cache on CIs in some of the future versions. |
Marking as "works as intended" since it isn't a bug in the actual implementation. I think we should improve this, probably by adding an option (e.g., as proposed in eslint/rfcs#63). As for possible workarounds, it might be useful to track jaredwray/file-entry-cache#14 (looks like it might be merged soon). It will allow for setting an env variable |
Unfortunately, it looks like there wasn't enough interest from the team Thanks for contributing to ESLint and we appreciate your understanding. |
We're running into this same issue. We restore the cache on CircleCI, but it gets ignored. Would love an option to use the file hash for caching instead of mtime. |
We are working on that now ( PR to follow: #13713 |
Tell us about your environment
We have a Gitlab configured this way:
And
package.json
:What did you expect to happen?
I can see that the ESLint cache is being successfully created on previous job launches, e.g. a file
.eslint/cache
is present in Gitlab Cache archive. And I expect to see that cache is used:What actually happened? Please include the actual, raw output from ESLint.
Looks like the cache is not used because I see output like this (for ALL the files in the repo):
But like I said, I do see the ESLint cache file being extracted from the Gitlab's cache.
Main question to ESLint is what can cause the cache file to be ignored?
Are you willing to submit a pull request to fix this bug?
Yes, if someone points where to look.
The text was updated successfully, but these errors were encountered: