Trying to install eslint into create-react-app, but get next error when running linter:
Here is my .eslintrc
config file:
{
"extends": ["airbnb", "prettier", "prettier/react"],
"plugins": ["prettier"],
"parser": "babel-eslint"
}
If install babel-eslint
manually it'll potentially produce another error based on package conflict between project and react-scripts
dependencies:
Did you install @babel/eslint-parser
or eslint-parser
?
In my case I had to use @babel/eslint-parser
and .eslintrc
looks like this:
"parser": "@babel/eslint-parser",
To fix this issue just reuse babel-eslint
dependency from react-scripts
, that already installed. Update your config:
{
"extends": ["airbnb", "prettier", "prettier/react"],
"plugins": ["prettier"],
"parser": "react-scripts/node_modules/babel-eslint"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With