Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I remove .eslintcache when switching git branches?

Tags:

git

eslint

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?

like image 268
Gabriel Llamas Avatar asked Sep 16 '20 12:09

Gabriel Llamas


People also ask

Should we add Eslintcache in Gitignore?

You should add generated files (like . eslintcache) which you don't want to appear in git status , to be omited by git to . gitignore.

How do I remove Eslintcache?

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.

What is .eslintcache file?

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).


1 Answers

Could not find any suggestions on this matter, but adding .eslintcache to .gitignore is a more convinient way than deleting it manually every time

like image 139
o-faro Avatar answered Sep 23 '22 12:09

o-faro