no-constant-binary-expression
Configuration
rslint.config.ts
Rule Details
Disallows expressions where the operation is guaranteed to always produce the same result, indicating a likely logic error. This includes comparisons against newly constructed objects (which can never be referentially equal to anything), constant short-circuit expressions where the left-hand side determines the result regardless of the right-hand side, and comparisons that always evaluate to the same boolean value.
Examples of incorrect code for this rule:
Examples of correct code for this rule: