Bottom Line: It is 100% safe to delete .eslintcache. Deleting this file will NOT alter your code, format settings, or .eslintrc configuration rules.
What is the .eslintcache File?
Located in the root of JavaScript, TypeScript, React, and Node.js projects, .eslintcache is created when running ESLint with the --cache flag.
ESLint uses this file to store a hash table of inspected source code files and their linting results. On subsequent lint runs (npm run lint), ESLint skips checking files that haven’t been modified since the last check, speeding up CI/CD pipeline linters.
Can You Delete .eslintcache?
✅ Yes, it is completely safe to delete.
- Zero code risk: Your source code and ESLint rule configurations are untouched.
- Fixes false lint errors: If ESLint reports phantom errors on deleted or renamed files, deleting
.eslintcacheforces ESLint to run a fresh, accurate linting pass across the entire codebase.
How to Safely Clean Up ESLint Cache
Method 1: Delete File via Command Line
# macOS / Linux
rm -f .eslintcache
# Windows (PowerShell)
Remove-Item -Force .eslintcache
Method 2: Add to .gitignore
To prevent committing .eslintcache to your Git repository, add this line to your .gitignore:
.eslintcache
Related Guides
- Learn about deleting node_modules folders.
- How to clean up Webpack cache.
- Check if you can clean git folders.
Discussion
Loading authentication...