noCompareNegZero
Este conteúdo não está disponível em sua língua ainda.
Diagnostic Category: lint/suspicious/noCompareNegZero
Since: v1.0.0
Sources:
- Same as:
no-compare-neg-zero
Disallow comparing against -0
Examples
Section titled ExamplesInvalid
Section titled Invalidcode-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)
│ -