eslint: no-else-return doesn't trigger for else if.
Tell us about your environment
- ESLint Version: 4.6.1
- Node Version: 8.4.0
- npm Version: 5.3.0
What parser (default, Babel-ESLint, etc.) are you using? see config Please show your full configuration: see eslint demo URLs. What did you do? Please include the actual source code causing the issue.
const res = (() => {
if (error) {
return 'It failed';
} else if (loading) {
return "It's still loading";
}
return result;
})();
What did you expect to happen?
no-else-return should trigger.
What actually happened? Please include the actual, raw output from ESLint.
no-else-return did not trigger.
Demo urls:
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (16 by maintainers)
Commits related to this issue
- Add test for #9228 — committed to graingert/eslint by graingert 7 years ago
- Add test for #9228 — committed to graingert/eslint by graingert 7 years ago
- Add test and move existing tests for #9228 — committed to graingert/eslint by graingert 7 years ago
- Update: Add test and move existing tests for #9228 — committed to graingert/eslint by graingert 7 years ago
- Update: Add test and move existing tests for #9228 — committed to graingert/eslint by graingert 7 years ago
- Update: Add test and move existing tests for #9228 — committed to graingert/eslint by graingert 7 years ago
- Update: Add test and move existing tests for #9228 — committed to graingert/eslint by graingert 7 years ago
- Update: Add test and move existing tests for #9228 — committed to graingert/eslint by graingert 7 years ago
- Update: Add test and move existing tests for #9228 — committed to graingert/eslint by graingert 7 years ago
- Update: Add test and move existing tests for #9228 — committed to graingert/eslint by graingert 7 years ago
- Update: Add test and move existing tests for #9228 — committed to graingert/eslint by graingert 7 years ago
- Update: Add test and move existing tests for #9228 — committed to graingert/eslint by graingert 7 years ago
- Update: Add test and move existing tests for #9228 — committed to graingert/eslint by graingert 7 years ago
- Update: Add test and move existing tests for #9228 — committed to graingert/eslint by graingert 7 years ago
- Update: Add test and move existing tests for #9228 — committed to graingert/eslint by graingert 7 years ago
- Update: Add test and move existing tests for #9228 — committed to graingert/eslint by graingert 7 years ago
- Update: Add test and move existing tests for #9228 — committed to graingert/eslint by graingert 7 years ago
@platinumazure fyi, with explicit block statements eslint flags them all.