Where Does ESLint Store Its Cache File?
ESLint writes its --cache results to .eslintcache in the working directory. How the cache works and the --cache-location override.
Last updated
ESLint only writes a cache when you pass --cache. The result is a single .eslintcache file in the directory where you ran the command. Next run skips unchanged files, which is the whole point on big codebases.
Two behaviors surprise people. Running once without --cache deletes the file, since results could be stale. And upgrading plugins never invalidates it, so phantom clean runs after an upgrade mean one thing: delete the file by hand. Point --cache-location at a file or folder to take control, and gitignore it either way.
Where ESLint stores this, by platform
.eslintcache
In the working directory of the eslint invocation. Custom directory targets need a trailing backslash, otherwise ESLint treats the path as a filename.
.eslintcache
Same working-directory rule. A --cache-location directory gets a hash-named file inside, like .cache_hashOfCWD, instead of the plain name.
.eslintcache
Mirrors macOS, trailing slash required for directory targets. CI caches keyed on lockfiles should include this file to actually speed up lint steps.
Frequently asked questions
Why did my .eslintcache file disappear?
You ran ESLint without --cache. That deliberately deletes the file because uncached results may differ. Use --cache-location to pin the file somewhere stable if you want deletion on your own schedule.
ESLint passes but shouldn't after a plugin upgrade, why?
The cache doesn't track plugin versions. Delete .eslintcache manually after any plugin or config upgrade. Then rerun with --cache to rebuild it from the new rules.
Notice an outdated path? Let us know.