create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

.eslintcache constantly generated

Open idbd1 opened this issue 6 years ago • 73 comments

Is there a way of disabling .eslintcache generation? I'm struggling to find the answer in the documentation.

idbd1 avatar Nov 27 '20 11:11 idbd1

Same... This just started happening to me today.

Adam-Ross avatar Nov 28 '20 00:11 Adam-Ross

Same for me as well. Couldn't find the answer anywhere else.

Safnaj avatar Nov 28 '20 09:11 Safnaj

It's part of v4, I think. There's a PR to have it moved into the node_modules folder, which I believe is consistent with some other caches.

It's there to help speed up the linting during both development runs and production builds. It can mostly be ignored, but I don't think there's any way to disable it right now.

nrayburn-tech avatar Nov 28 '20 15:11 nrayburn-tech

same here

sajid-khan-afridi avatar Nov 29 '20 06:11 sajid-khan-afridi

put in .gitignore file

sajid-khan-afridi avatar Nov 29 '20 06:11 sajid-khan-afridi

Same for me as well. Couldn't find the answer anywhere else.

put in .gitignore file

sajid-khan-afridi avatar Nov 29 '20 06:11 sajid-khan-afridi

Same for me as well. Couldn't find the answer anywhere else.

put in .gitignore file

adding it to the .gitignore file only disables its tracking. The file is annoying me and i want to get rid of this. Its still keep generating.

Safnaj avatar Nov 29 '20 08:11 Safnaj

This cache file dependency is not only annoying, but it's also a hurdle in trying to deploy the application as a non-root user in a container. Here's the related StackOverflow thread.

cseas avatar Nov 29 '20 11:11 cseas

same...

Poolshark avatar Nov 29 '20 15:11 Poolshark

same here

ricardodanaya avatar Nov 30 '20 04:11 ricardodanaya

I think it should be be put into node_modules/.cache/.eslintcache so it's out of sight like other caches (e.g. babel's).

silverwind avatar Nov 30 '20 15:11 silverwind

This file is generated with react-scripts 4.0.1. If you change the version to 4.0.0 you won't have this issue for now. This might get changed in a future release.

Blazekla avatar Nov 30 '20 16:11 Blazekla

Update:

It has now started to cause compile errors as well:

image

EBUSY: resource busy or locked, open 'C:\Users\Oscar\source\repos\<>\ClientApp\.eslintcache'

Original:

eslint --cache false should work but I don't know how to inject that. I saw nothing about this under Configuring ESLint or Create React App Custom Environment Variables

https://eslint.org/docs/user-guide/configuring

https://create-react-app.dev/docs/adding-custom-environment-variables/

https://eslint.org/docs/user-guide/command-line-interface#options

You could also specify another cache location if you find a way to inject the command:

--cache-location Path to the cache location. Can be a file or a directory. If none specified .eslintcache will be used. The file will be created in the directory where the eslint command is executed.

https://eslint.org/docs/2.0.0/user-guide/command-line-interface#caching

Ogglas avatar Dec 01 '20 09:12 Ogglas

It seems that cache was enabled on purpose here: https://github.com/facebook/create-react-app/pull/9911

falinsky avatar Dec 01 '20 12:12 falinsky

It seems that cache was enabled on purpose here: #9911

Yes bt as @silverwind said it should be there in the node_modules/.cache/.eslintcache

Safnaj avatar Dec 01 '20 13:12 Safnaj

I think the main issue is a bad default location coming from eslint, see https://github.com/eslint/eslint/issues/13897.

silverwind avatar Dec 01 '20 13:12 silverwind

Not only is it annoying, it also wastes time on debugging. My app kept showing an error for the line of code that was no longer there. I tried everything and only deleting .eslintcache solved the problem.

idbd1 avatar Dec 02 '20 08:12 idbd1

This file is generated with react-scripts 4.0.1. If you change the version to 4.0.0 you won't have this issue for now. This might get changed in a future release.

Still generates

Motii1 avatar Dec 02 '20 15:12 Motii1

A fix seems to be in progress https://github.com/facebook/create-react-app/pull/9977. Looks like the plan is to move .eslintcache into node_modules/.cache

StraightOuttaCrompton avatar Dec 02 '20 20:12 StraightOuttaCrompton

A fix seems to be in progress #9977. Looks like the plan is to move .eslintcache into node_modules/.cache

As far as I understand that fix has nothing to do with an issue described by @dominikabieder

Not only it is annoying, it wastes time on debugging. My app kept showing an error for the line of code that was no longer there. I tried everything and only deleting .eslintcache solved the problem.

falinsky avatar Dec 02 '20 20:12 falinsky