menu

double-comparisons

Prefer one comparison over an equivalent pair of comparisons

Two comparisons that repeat identical operand computations can encode the same relation as one comparison. Instead, you SHOULD use the equivalent single operator.

Reported

1function atMost(left: int32, right: int32): boolean {2    return left < right || left === right;3}

Accepted

1function atMost(left: int32, right: int32): boolean {2    return left <= right;3}