no-compare-neg-zero
Configuration
rslint.config.ts
Rule Details
Disallows comparing against -0 using equality and relational operators (==, ===, !=, !==, >, >=, <, <=). Comparing directly to -0 does not work as intended because +0 === -0 is true. To check whether a value is -0, use Object.is(x, -0) instead.
Examples of incorrect code for this rule:
Examples of correct code for this rule: