Possible Errors

Best Practices

Strict Mode

Variables

Node.js and CommonJS

Stylistic Issues

ECMAScript 6

no-else-return

- Disallow else blocks after return statements in if statements

Fixable

This rule is aimed at highlighting an unnecessary block of code following an if containing a return statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a return statement.

What ESLint should do when it catches the rule break

Show a warning

Options

allowElseIf

Allows else if blocks after a return.

Rule examples

You can check them out here.