Configuration for rule "no-else-return" is invalid
See original GitHub issueI get this error on save with atom. I’ve tried to fiddle around with versions and re-install everything. Looks like there is a bad config option in the eslint-config-airbnb-base.
node_modules/eslint-config-airbnb-base/rules/best-practices.js: Configuration for rule "no-else-return" is invalid: Value "[object Object]" should NOT have more than 0 items.
The rule in best-practices.js looks like this:
// disallow else after a return in an if
// https://eslint.org/docs/rules/no-else-return
// TODO: semver-major, set allowElseIf to false
'no-else-return': ['error', { allowElseIf: true }],
My dependencies:
"devDependencies": {
"babel-eslint": "^8.0.1",
"eslint": "^4.9.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-meteor": "^4.1.4",
"eslint-plugin-react": "^7.4.0"
},
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:16
Top Results From Across the Web
no-else-return - ESLint - Pluggable JavaScript Linter
This rule is aimed at highlighting an unnecessary block of code following an if containing a return statement. As such, it will warn...
Read more >eslint/eslint - Gitter
I want to use global eslint config and globally installed plugins, ... for rule "no-else-return" is invalid: Value "[object Object]" should NOT have...
Read more >javascript - Unnecessary 'else' after 'return'. (No-else-return)
What that is basically saying is that the else part of the if statement is unnecessary if there is a return in the...
Read more >eslintrc.json - Google Git
"no-template-curly-in-string": "error",. "valid-jsdoc": "error",. // Best Practices ... "no-else-return": "error", ... "no-invalid-this": "off",.
Read more >eslint-config-nicestyle - npm package - Snyk
Learn more about eslint-config-nicestyle: package health score, popularity, ... A proposal of style and rules for javascript. ... no-else-return, error.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I got this exact error today, this should be reopen, here is my eslint config:
And I get the error while building the project:
The option was added in eslint 4.9. Probably your atom-plugin uses an outdated version of eslint.