Closed muuvmuuv closed 4 years ago
Firstly, check your node_modules
directory, and see if eslint-plugin-jest is in there.
If not, try deleting your package-lock.json
file as well as the node_modules
directory, and then reinstall. Sometimes NPM just won't install all dependencies of dependencies, and this is the fix.
It is not there, because I'm not using jest or any test framework. Why do I need to install something I do not need? Or why does the eslint-config does not install it as a peerDep, seems like it is not working without it.
So I think you're confused. This config has eslint-plugin-jest
as a dependency. Even if you're not using Jest, or any other testing framework, this package will install that one. You don't need to install anything else yourself.
Or why does the eslint-config does not install it as a peerDep, seems like it is not working without it.
So that's not at all what peer dependencies are for.
A common issue (and is something I've seen myself) is that NPM doesn't install according to the lock file, and it gets confused. The fix for this is what I mentioned above. Delete the lock file, delete your modules folder, and reinstall.
This package should install eslint-plugin-jest
itself. If it doesn't, that's an issue with NPM.
Oh, yes, sorry I misunderstood your suggestion! Now it seems to work (still the babel issue but this is another issue). Thank you!
My Error is: "[eslint] Failed to load plugin 'jest' declared in 'package.json » eslint-config-react-app/jest': Cannot find module 'eslint/package.json'"
quite a similar one, the only difference is that it says "Cannot find module 'eslint/package.json' instead of "eslint-plugin-jest What should I do?
I have installed the config in the root of my project and in a sub-directory I have an eslint config, which looks like that:
Now when I do
eslint -c docs/.eslintrc.json --cache docs
. I get this error: