Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow comparing against -0 (no-compare-neg-zero) #812

Closed
feross opened this Issue Mar 5, 2017 · 1 comment

Comments

1 participant
@feross
Copy link
Member

commented Mar 5, 2017

The rule should warn against code that tries to compare against -0, since that will not work as intended. That is, code like x === -0 will pass for both +0 and -0. The author probably intended Object.is(x, -0).

http://eslint.org/docs/rules/no-compare-neg-zero

@feross feross added the enhancement label Mar 5, 2017

@feross feross added this to the standard v11 milestone Mar 5, 2017

@feross feross modified the milestones: standard v10, standard v11 Apr 4, 2017

@feross

This comment has been minimized.

Copy link
Member Author

commented Apr 4, 2017

Moving this up to standard v10 since it's not likely to affect anyone's code.

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.