Lint Rules

noCompareNegZero (since v0.7.0)

This rule is recommended by Rome.

Disallow comparing against -0

Examples

Invalid

(1 >= -0)
correctness/noCompareNegZero.js:1:2 lint/correctness/noCompareNegZero  FIXABLE  ━━━━━━━━━━━━━━━━━━━━

   Do not use the >= operator to compare against -0.
  
  > 1 │ (1 >= -0)
    ^^^^^^^
    2 │ 
  
   Safe fix: Replace -0 with 0
  
    1 │ (1·>=·-0)
        -  

Valid

(1 >= 0)