Skip to main content

js/noCompareNegZero

disallow comparing against -0

ESLint Equivalent: no-compare-neg-zero

Examples

Invalid

(1 >= -0)

 file.ts:1:1 lint/js/noCompareNegZero ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Do not use the >= operator to compare against -0.

    (1 >= -0)
     ^^^^^^^

Valid

(1 >= 0)