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
Fix: new-parens
false negative (fixes #6997)
#6999
Conversation
@mysticatea, thanks for your PR! By analyzing the annotation information on this pull request, we identified @vitorbal, @pmcelhaney and @ilyavolodin to be potential reviewers |
LGTM |
Minor bumps should have "Update:" instead of "Fix:" for the commit message. |
Code LGTM. Can you also update the docs to show this? |
LGTM |
LGTM |
Oops, I'm sorry, I had misunderstood that |
Yeah, we changed it to also be when a rule produces more warnings. From http://eslint.org/docs/developer-guide/contributing/pull-requests#step-2-make-your-changesa-namestep2a:
|
@nzakas Does that also imply that we should label issues with enhancement as well? I think the docs mention somewhere else that you can/should use the issue label to determine your commit summary prefix. |
Fixes #6997.
This PR changes the logic of
new-parens
.Old logic counts parentheses in a
NewExpression
node. Then OK if it's 2 or more.New logic checks a token (except
)
) preceded by the callee of aNewExpression
. Then OK if the token is an opening parenthesis and is inside of theNewExpression
node.NOTE: this needs minor bump.