Skip to content
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

New: no-unsafe-negation rule (fixes #2716) #6789

Merged
merged 2 commits into from Aug 2, 2016
Merged

New: no-unsafe-negation rule (fixes #2716) #6789

merged 2 commits into from Aug 2, 2016

Conversation

mysticatea
Copy link
Member

Fixes #2716.

This PR adds no-unsafe-negation rule, and deprecates no-negated-in-lhs rule.

no-unsafe-negation rule is:

  • It reports ! expression in the left operand of relational expressions (in or instanceof).
  • It's fixable. The fixing would enclose the relational expression except !. (!a in b!(a in b))

This PR should follow #6746 for the deprecation way.

@mention-bot
Copy link

@mysticatea, thanks for your PR! By analyzing the annotation information on this pull request, we identified @nzakas, @michaelficarra and @vitorbal to be potential reviewers

@eslintbot
Copy link

LGTM

@eslintbot
Copy link

LGTM

@nzakas
Copy link
Member

nzakas commented Aug 2, 2016

LGTM.

@nzakas nzakas merged commit aef18b4 into master Aug 2, 2016
@mysticatea mysticatea deleted the issue2716 branch August 3, 2016 02:47
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule suggestion: disallow !a instanceof b
5 participants