Reputation: 31485
I'm trying to set up ESLint on my React project.
Installed both eslint
and eslint-plugin-react
locally on my project.
Also using the VSCode ESLint extension (but I tried this without this extension and I also get the same linting errors).
Below you can see my .eslintconfig.json file and dependencies versions. I've got JSX enabled.
I keep getting errors on these closing tags.
What seems to be the problem? I can't make this errors go away and it's just simple closing tags.
Thanks a lot.
Upvotes: 1
Views: 1871
Reputation: 31485
It seems that it was being caused by some kind of conflict between the eslint
package and some of babel
packages, because when I did a clean install using only eslint
and react
that .eslintrc.json
configuration worked perfectly.
I didn't have babel-eslint
installed before and I was using the default parser that comes with eslint
.
To solve the problem I had to install the babel-eslint
package and use it as the parser for the eslint
package. Everything is working fine now and those errors are gone.
Even though the babel-eslint
docs says that you don't have to use it just because you're using babel
, in my situation, using it along with babel
and eslint
solved the problem.
New eslint
config file:
Upvotes: 1