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

isNaN --> Number.isNan #10313

Closed
stevenvachon opened this Issue May 4, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@stevenvachon
Copy link

stevenvachon commented May 4, 2018

Please describe what the rule should do:
Should push us to use Number.isNaN instead of isNaN.

What category of rule is this? (place an "X" next to just one item)

[ ] Enforces code style
[ ] Warns about a potential error
[x] Suggests an alternate way of doing something
[ ] Other (please specify:)

Provide 2-3 code examples that this rule will warn about:

isNaN(1);
isNaN(NaN);

Why should this rule be included in ESLint (instead of a plugin)?
It's native ES2015

See #375

@eslint eslint bot added the triage label May 4, 2018

@platinumazure

This comment has been minimized.

Copy link
Member

platinumazure commented May 4, 2018

Hi @stevenvachon, thanks for the issue.

This can already be done using no-restricted-globals. You can even include a message asking the user to use Number.isNaN.

I don't really want to add a rule in ESLint core just for this case-- we already have too many. But you are more than welcome to use or create a plugin with this rule.

@stevenvachon

This comment has been minimized.

Copy link
Author

stevenvachon commented May 4, 2018

Ok, thank you.

@eslint eslint bot locked and limited conversation to collaborators Nov 1, 2018

@eslint eslint bot added the archived due to age label Nov 1, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.