/ eslint Public
use-isnan options for implicit Strict Equality Comparison #12207
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
This change enhances an existing feature of ESLint
Relates to ESLint's core rules
What rule do you want to change?
This rule targets
foo === NaN(Strict Equality Comparison)
Currently, the rule checks only
BinaryExpressionnodes, i.e. only explicit comparisons.
This is a proposal to also check the following:
case NaNwill never match and it's a possible error.
foo.indexOf(NaN)will never match and it's a possible error. The same applies to Array.prototype.lastIndexOf.
Does this change cause the rule to produce more or fewer warnings?
More if an option is set to
true. Defaults are
How will the change be implemented? (New option, new default behavior, etc.)?
Please provide some example code that this change will affect:
What does the rule currently do for this code?
What will the rule do after it's changed?
Are you willing to submit a pull request to implement this change?
Yes. (there is PR #12106 for
The text was updated successfully, but these errors were encountered: