Forgetting about .eslintcache in React
07 April, 2021 - 1 min read
With the release of React 17 and React Scripts 4.0.1, we came across .eslintcache that was not in .gitignore by default. The file, although beneficial, was super annoying when trying to run commands like
git diff. Since .gitignore comes first in alphabetical order, one had to go through the entire changes to the .gitignore file before getting to the files that one was actually concerned about. After months of grappling with this annoying file, I decided to get rid of it once and for all.
Here, I document the steps:
.gitignore so that git no longer tracks it.
Now we just need to remove this file from our current working directory as well as from origin. For this, we run:
git rm --cached .eslintcache
And viola, the .eslintcache has been removed for git forever.