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

Update: Fix no-extra-parens false negative (fixes #7229) #7231

Merged

Conversation

not-an-aardvark
Copy link
Member

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

See #7229 for more info on the bug.

Please check each item to ensure your pull request is ready:

  • I've read the pull request guide
  • I've included tests for my change
  • (n/a) I've updated documentation for my change (if appropriate)

What changes did you make? (Give an overview)

Previously, the nestedBinaryExpressions: false option would cause no-extra-parens to ignore all binary expressions, even non-nested ones.

/* eslint no-extra-parens: [2, "all", {"nestedBinaryExpressions": false}]*/

(foo) + baz // foo is not nested, so this should be reported
(foo * bar) + baz // (foo * bar) is itself a binary expression, so this should not be reported.

Is there anything you'd like reviewers to focus on?

@mention-bot
Copy link

@not-an-aardvark, thanks for your PR! By analyzing the annotation information on this pull request, we identified @vitorbal, @mysticatea and @kaicataldo to be potential reviewers

@eslintbot
Copy link

LGTM

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just want another set of eyes on this. (Also, since this isn't a regression from 3.6.0, we may want to hold off until we know if there will be a patch release.)

@kaicataldo
Copy link
Member

kaicataldo commented Sep 24, 2016

Mind adding a test to ensure non-nested LogicalExpressions warn for extra parens with this config in the invalid tests? Otherwise, LGTM!

@not-an-aardvark not-an-aardvark force-pushed the 7229-no-extra-parens-false-negative branch from 5ce94f0 to 1ebd39f Compare September 24, 2016 21:44
@eslintbot
Copy link

LGTM

@not-an-aardvark
Copy link
Member Author

Added some more tests for LogicalExpressions.

@kaicataldo
Copy link
Member

Sorry, one last thing I didn't notice the first time around: the commit message should start with "Fix" instead of "Update", since this is a bug fix. Other than that, LGTM. Thanks for contributing!

@platinumazure
Copy link
Member

@kaicataldo This will introduce more warnings-- bugfixes with more warnings are Updates and semver-minor, I believe.

@kaicataldo
Copy link
Member

Agreed that this is a semver-minor change, but didn't realize we actually label them differently. In that case, LGTM.

@kaicataldo
Copy link
Member

Ah, I see. From http://eslint.org/docs/developer-guide/contributing/pull-requests#step-2-make-your-changesa-namestep2a

Update - for a backwards-compatible enhancement or a change to a rule that increases the number of reported problems.

Makes sense, just something I didn't know. TIL!

@platinumazure
Copy link
Member

Might be an artifact of eslint-release using those tags to determine
whether a release should be major/minor/patch. Not 100% sure though.

On Sep 24, 2016 4:56 PM, "Kai Cataldo" notifications@github.com wrote:

Ah, I see. From http://eslint.org/docs/developer-guide/contributing/
pull-requests#step-2-make-your-changesa-namestep2a

Update - for a backwards-compatible enhancement or a change to a rule that
increases the number of reported problems.

Makes sense, just something I didn't know. TIL!


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#7231 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AARWeo-vO1UG7sVowFOAxtG0bcO1vEgVks5qtZyhgaJpZM4KFvxC
.

@vitorbal
Copy link
Member

@platinumazure you're correct! eslint-release uses those tags to determine which type of release it should be.

@vitorbal vitorbal added bug ESLint is working incorrectly accepted There is consensus among the team that this change meets the criteria for inclusion labels Sep 26, 2016
@kaicataldo kaicataldo merged commit e3f95de into eslint:master Sep 27, 2016
@kaicataldo
Copy link
Member

LGTM. Thanks for contributing to ESLint!

@not-an-aardvark not-an-aardvark deleted the 7229-no-extra-parens-false-negative branch September 27, 2016 19:56
@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
accepted 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 bug ESLint is working incorrectly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants