excessive-nesting Disallow control flow nested beyond four levels Deeply nested control flow makes every operation depend on a long chain of surrounding branches. Instead, you SHOULD use guards, early exits, or an extracted function once nesting exceeds four levels. - Category: style - Level: warning - Fix: none - Scope: module Reported function acceptsMail( isActive: boolean, hasEmail: boolean, isSubscribed: boolean, isVerified: boolean, allowsMail: boolean, ): boolean { if (isActive) { if (hasEmail) { if (isSubscribed) { if (isVerified) { if (allowsMail) { return true; } } } } } return false; } Accepted function acceptsMail( isActive: boolean, hasEmail: boolean, isSubscribed: boolean, isVerified: boolean, allowsMail: boolean, ): boolean { if (!isActive || !hasEmail || !isSubscribed || !isVerified || !allowsMail) { return false; } return true; } Prior art - Clippy ยท excessivenesting language/linter/src/rules/style/excessivenesting.rs:8