s-leg3ndz
s-leg3ndz

Reputation: 3528

eslint-plugin-react return syntax error with Render

I would like use eslint with React and Airbnb configuration. In my package.json, i can see this packages :

My .eslintrc file :

{
"extends": [
    "airbnb-base",
    "prettier",
    "prettier/react",
    "prettier/standard",
    "eslint:recommended",
    "plugin:react/recommended"
],
"parser": "babel-eslint",
"parserOptions": {
    "sourceType": "module",
    "ecmaVersion": 8,
    "ecmaFeatures": {
    "experimentalObjectRestSpread": true,
    "impliedStrict": true,
    "classes": true
    }
},
"env": {
    "browser": true,
    "node": true,
    "jquery": true
},
"plugins": ["react", "prettier"]
}

And if i test to render React component, i've this syntax error.

Looks like React lint is not used ... i don't understand why i've this error.

Anyone can help me ?

enter image description here

Upvotes: 0

Views: 367

Answers (1)

Wayrex
Wayrex

Reputation: 2107

Can you add the rules

jsx-uses-vars and jsx-uses-react

to your eslint config?

I think those should fix your problem.

Upvotes: 0

Related Questions