A simple example of .eslintrc configuration, with
max-lenof 110 characters per line.- Parser
babel-eslintfor better support of new features. - Fix error: 'React' must be in scope when using JSX
react/react-in-jsx-scope:
.eslintrc.json:
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"no-unused-vars": "warn",
"react/react-in-jsx-scope": "off",
"max-len": [
1,
110,
2
]
}
}