no-else-return
Configuration
rslint.config.ts
Rule Details
Disallow else blocks after return statements in if statements. When every
preceding branch returns, the else block is unnecessary and its contents can
be placed after the if statement.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
This rule has an object option:
allowElseIf(default:true): allowselse ifblocks after areturn.
Examples of correct code for this rule with { "allowElseIf": true }:
Examples of incorrect code for this rule with { "allowElseIf": false }: