-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New option in no-unsafe-negation to report ! a < b #12163
Copy link
Copy link
Closed
Closed
Copy link
Labels
HacktoberfestRecommended issue for those participating in Hacktoberfest https://hacktoberfest.digitalocean.com/Recommended issue for those participating in Hacktoberfest https://hacktoberfest.digitalocean.com/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 discussionenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLinthelp wantedThe team would welcome a contribution from the community for this issueThe team would welcome a contribution from the community for this issueruleRelates to ESLint's core rulesRelates to ESLint's core rules
Metadata
Metadata
Assignees
Labels
HacktoberfestRecommended issue for those participating in Hacktoberfest https://hacktoberfest.digitalocean.com/Recommended issue for those participating in Hacktoberfest https://hacktoberfest.digitalocean.com/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 discussionenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLinthelp wantedThe team would welcome a contribution from the community for this issueThe team would welcome a contribution from the community for this issueruleRelates to ESLint's core rulesRelates to ESLint's core rules
What rule do you want to change?
no-unsafe-negationThe rule currently targets only
inandinstanceof.<,>,<=,>=are also relational operators.! a < bis equivalent to(a ? 0 : 1) < b(I think), which is rarely the intended meaning:Does this change cause the rule to produce more or fewer warnings?
More if the option is set to
true. Default isfalse.How will the change be implemented? (New option, new default behavior, etc.)?
New option.
Please provide some example code that this change will affect:
What does the rule currently do for this code?
Nothing.
What will the rule do after it's changed?
4 errors
Are you willing to submit a pull request to implement this change?
Yes.