If the body of if
contains one of these keywords, the else
is moot:
throw
break
continue
return
This slightly overlaps with https://eslint.org/docs/rules/no-else-return
This was inspired by eslint/eslint#13067.
This could be auto-fixed, but we should take care to properly move any comments.
if (foo) {
throw new Error();
} else {
console.log('π¦');
}
if (foo) {
throw new Error();
}
console.log('π¦');
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too