no-lonely-if Disallow an if statement as the only statement in an else block else { if (condition) ... } has the same control flow as else if (condition) ... when the block contains no other statements. Instead, you SHOULD flatten the nested if into the existing conditional chain. - Category: style - Level: warning - Fix: automatic - Scope: module Reported function classify(value: int32): string { if (value > 0) { return "positive"; } else { if (value < 0) { return "negative"; } } return "zero"; } Accepted function classify(value: int32): string { if (value > 0) { return "positive"; } else if (value < 0) { return "negative"; } return "zero"; } Prior art - ESLint ยท no-lonely-if language/linter/src/rules/style/nolonelyif.rs:8