no-constant-binary-expression
Comparisons that always evaluate to true or false, and logical expressions that either always short-circuit or never short-circuit, are usually programmer errors.Rule Type: Problem
Fixable: No
Fixable: No
Why This Rule Exists
These errors are especially common in complex expressions where operator precedence is easy to misjudge:false, which can surprise developers from other languages:
Rule Details
This rule identifies:==and===comparisons that always evaluate totrueorfalse||,&&, and??expressions that always or never short-circuit