-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Support Number.NaN within use-isnan #14715
Copy link
Copy link
Closed
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyESLint is working incorrectlyrepro:yesIssues with a reproducible exampleIssues with a reproducible exampleruleRelates to ESLint's core rulesRelates to ESLint's core rules
Metadata
Metadata
Assignees
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyESLint is working incorrectlyrepro:yesIssues with a reproducible exampleIssues with a reproducible exampleruleRelates to ESLint's core rulesRelates to ESLint's core rules
Type
Projects
Status
Complete
What rule do you want to change?
use-isnanDoes this change cause the rule to produce more or fewer warnings?
More.
How will the change be implemented? (New option, new default behavior, etc.)?
Perhaps as a default behaviour, as
NaNandNumber.NaNare equivalent.Please provide some example code that this change will affect:
What does the rule currently do for this code?
Only the first line is reported as a NaN comparison. Second line does not report.
What will the rule do after it's changed?
Both lines will report as NaN comparisons. (Maybe recommending
Number.isNaNinstead ofisNaNbut that is aside)Are you willing to submit a pull request to implement this change?
I would prefer if someone else send a PR.
At
lib/rules/use-isnan.js:24: