Aller au contenu

noCompareNegZero

Ce contenu n’est pas encore disponible dans votre langue.

Diagnostic Category: lint/suspicious/noCompareNegZero

Since: v1.0.0

Sources:

Disallow comparing against -0

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

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

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

Safe fix: Replace -0 with 0

1 │ (1·>=·-0)
-
(1 >= 0)