Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ESLint Configuration in WebStorm error

I am trying to get ESLint work in WebStorm IDE. I am furnishing my config file and the error.

Error

Error: /usr/local/lib/node_modules/eslint-config-airbnb/rules/react.js: Configuration for rule "react/jsx-boolean-value" is invalid: Value "never,[object Object]" should NOT have more than 1 items. Referenced from: /usr/local/lib/node_modules/eslint-config-airbnb/index.js Referenced from: /Users/xxx/WebstormProjects/xx-xx-ui/xx/code/.eslintrc.js at validateRuleOptions (/usr/local/lib/node_modules/eslint/lib/config/config-validator.js:113:15)

.eslintrc.js

module.exports = {
    "extends": "airbnb",
    "rules": {
      "import/extensions": 1,
      "import/first": 1,
      "import/prefer-default-export": 1,
      "max-len": 1,
      "no-case-declarations": 1,
      "no-console": 1,
      "no-empty": 0,
      "no-fallthrough": 1,
      "no-mixed-spaces-and-tabs": 1,
      "no-param-reassign": 0,
      "no-tabs": 1,
      "no-undef": 0,
      "no-unused-vars": 1,
      "one-var": 1,
      "prefer-const": 1,
    }
};

package.json

These are dev dependencies

    "eslint-config-airbnb": "^15.1.0",
    "eslint-plugin-import": "^2.7.0",
    "eslint-plugin-jsx-a11y": "^5.1.1",
    "eslint-plugin-react": "^7.4.0",
like image 236
mbarish-me Avatar asked Feb 15 '26 00:02

mbarish-me


1 Answers

I've managed to solve it by

npm uninstall eslint-config-airbnb
npm i --save-dev eslint-config-airbnb
npm i --save-dev eslint
npm i --save-dev babel-eslint
npm i --save-dev eslint-plugin-jsx-a11y
npm i --save-dev eslint-plugin-react

I ended up with those packages

    "eslint": "^4.15.0",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-plugin-import": "^2.8.0",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-react": "^7.5.1"

The main idea behind fix is to let eslint-config-airbnb install peer dependencies, after doing so I have no errors after lint and no warnings inside IDE(Webstorm2017.3.3)

like image 56
Denis Rybalka Avatar answered Feb 17 '26 13:02

Denis Rybalka