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

no-extra-parens handles precedence incorrectly in some cases #7978

Assignees
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 rule Relates to ESLint's core rules

Comments

@not-an-aardvark
Copy link
Member

Tell us about your environment

  • ESLint Version: master
  • Node Version: 7.4.0
  • npm Version: 4.0.5

What parser (default, Babel-ESLint, etc.) are you using?

default

Please show your full configuration:

rules:
  no-extra-parens: error
parserOptions:
  ecmaVersion: 2016

What did you do? Please include the actual source code causing the issue.

(new Foo)();

-(foo ** bar);

(-foo) ** bar;

What did you expect to happen?

I expected no errors to be reported, because removing parentheses from each of those cases results in a change in behavior or a syntax error.

What actually happened? Please include the actual, raw output from ESLint.

3 errors were reported:

<text>
  1:1  error  Gratuitous parentheses around expression  no-extra-parens
  3:2  error  Gratuitous parentheses around expression  no-extra-parens
  5:1  error  Gratuitous parentheses around expression  no-extra-parens
@not-an-aardvark not-an-aardvark added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly rule Relates to ESLint's core rules labels Jan 25, 2017
@alberto alberto self-assigned this Jan 29, 2017
@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 rule Relates to ESLint's core rules
Projects
None yet
2 participants