New option in no-unsafe-negation to report ! a < b #12163
Closed
Comments
|
This has now been accepted. |
|
@mdjermanovic do you still want to do the PR for this? If not I could take it on |
|
@samrae7 feel free to claim this. PR is welcome, thanks! |
|
@mdjermanovic thank you. I will work on it over the weekend |
samrae7
added a commit
to samrae7/eslint
that referenced
this issue
Oct 13, 2019
samrae7
added a commit
to samrae7/eslint
that referenced
this issue
Oct 13, 2019
samrae7
added a commit
to samrae7/eslint
that referenced
this issue
Oct 13, 2019
samrae7
added a commit
to samrae7/eslint
that referenced
this issue
Oct 13, 2019
This was referenced Nov 9, 2019
This was referenced Mar 11, 2020
This was referenced Mar 26, 2020
This was referenced Apr 3, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The text was updated successfully, but these errors were encountered: