Open froodley opened 6 years ago
Such rules are similar but not quite what I need. They only enforce that if the if
branch has a return, else
is unnecessary. We expressly forbid use of else
, period. In SRP code it is a clear code smell.
Oh I see what you mean now! Pull Requests very welcome! Great idea for a rule.
http://blog.timoxley.com/post/47041269194/avoid-else-return-early
Use of if-else is always unnecessary, and leads to cyclomatic complexity. Other clean code linters (phpmd, golint) enforce this pattern. Would love to have this rule as I have to enforce it manually in my typescript projects right now.