When you have a branch checked out and the code is linted with eslint and the --cache
flag, it generates a .eslintcache
file. Because the .eslintcache
is in my .gitignore
, when you switch to another branch and the code is linted again, the cache file is already there so eslint in theory reuses it but we cannot assume that the previous cached files are valid. So shouldn't we remove the .eslintcache
file when switching branches?
You should add generated files (like . eslintcache) which you don't want to appear in git status , to be omited by git to . gitignore.
Enabling this option can dramatically improve ESLint's running time by ensuring that only changed files are linted. Note: If you run ESLint with --cache and then run ESLint without --cache , the . eslintcache file will be deleted.
eslint goes over your code and reports stylistic errors. Usually going over the whole code is unneccessary, because you only changed a few files since the last run. To be able to track which files changed, and which errors occured in the files which were not changed, eslint is writing a cache (into the file you found).
Could not find any suggestions on this matter, but adding .eslintcache to .gitignore is a more convinient way than deleting it manually every time
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With