Consider changing default location of `.eslintcache` to `node_modules/.cache`
See original GitHub issueThe version of ESLint you are using.
v7.14.0
The problem you want to solve.
The default location of .eslintcache
in the project root is problematic because that directory is generally used to store configuration, not ephemeral files like this cache. By putting it in the project root, you’re forcing everyone wo enables that cache to put an entry for it in .gitignore
.
Your take on the correct solution to problem.
Use find-cache-dir to locate the common cache directory and store the file there instead. This is a common pattern used by many other modules like babel-loader
, terser-webpack-plugin
and even eslint-loader
. If there is no node_modules
, fall back to a temporary directory.
Are you willing to submit a pull request to implement this change?
Yes
Issue Analytics
- State:
- Created 3 years ago
- Reactions:15
- Comments:5 (2 by maintainers)
Top GitHub Comments
For what it’s worth, this has been raised before and https://github.com/eslint/eslint/issues/11757#issuecomment-496945984 has examples of other popular projects using the
node_modules/.cache
convention.That’s the thing, nobody wants to extend .gitignore every time when creating a new project. Nobody will complain if other packages will not solve that problem in a more elegant way ( keeping it in node_modules/.cache ). So I think keeping the standard is not a bad idea.