no-unnecessary-condition
Configuration
rslint.config.ts
Rule Details
Disallow conditionals where the type is always truthy or always falsy.
Any expression being used as a condition must be able to evaluate as truthy or falsy in order to be considered necessary. Conversely, any expression that always evaluates to truthy or always evaluates to falsy is considered unnecessary and will be flagged by this rule.
Examples of incorrect code for this rule:
Examples of correct code for this rule: