Skip to content

oxc/double-comparisons Correctness

This rule is turned on by default.
🛠️ An auto-fix is available for this rule.

What it does

This rule checks for double comparisons in logical expressions.

Why is this bad?

Redundant comparisons can be confusing and make code harder to understand.

Example

Examples of incorrect code for this rule:

javascript
x === y || x < y;
x < y || x === y;

Examples of correct code for this rule:

javascript
x <= y;
x >= y;

References

Released under the MIT License.