ESLint ignores its own cache
See original GitHub issueTell us about your environment
We have a Gitlab configured this way:
cache:
key: $CI_COMMIT_REF_NAME
paths:
- .eslint
lint:
stage: test
script: DEBUG=eslint:cli-engine yarn lint:all
And package.json
:
{
"scripts": {
"lint": "eslint --cache --cache-location .eslint/cache --fix --ignore-path .eslintignore",
"lint:all": "yarn lint \"src/**/*.{js,jsx,ts,tsx}\"",
}
}
- ESLint Version: 7.2.0
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:
eslint:cli-engine Skipping file since it hasn't changed: /xxx/src/app/core/data/stores/utils.js +0ms
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):
eslint:cli-engine Lint /xxx/src/app/core/data/stores/utils.js +132ms
^^^^
this means cache was not used
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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Where is ESLint cache stored? - Stack Overflow
Open the command palette ( Ctrl + Shift + P ) and execute Reload Window command (type it in until it autocompletes, press...
Read more >Command Line Interface - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Developers - ESLint ignores its own cache - - Bountysource
Tell us about your environment. We have a Gitlab configured this way: cache: key: $CI_COMMIT_REF_NAME paths: - .eslint lint: stage: test script: ...
Read more >Caching Dependencies - CircleCI
This is referred to as a partial cache restore. Each line in the keys: list manages one cache (each line does not correspond...
Read more >Master ESLint in 7 Minutes - Medium
That being said, use your own thought process and decide for yourself which options best suit ... Ignore ESLint warnings/ errors warning for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 royriojas/file-entry-cache#14 (looks like it might be merged soon). It will allow for setting an env variable
FILE_ENTRY_CACHE_USE_CHECKSUM
which would be used directly from thefile-entry-cache
dependency.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.