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 ignores template literal's expressions #11906

Closed
mdjermanovic opened this issue Jun 25, 2019 · 0 comments · Fixed by #11909

Comments

@mdjermanovic
Copy link
Member

commented Jun 25, 2019

Tell us about your environment

  • ESLint Version: 6.0.0 (same with 5.16.0)
  • Node Version: 10.16.0
  • npm Version: 6.9.0

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

default

Please show your full configuration:

Configuration
module.exports = {
  parserOptions: {
    ecmaVersion: 6,
  },
  rules: {
    "no-extra-parens": "error",
  }
};

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

let foo = `${(a)}`
eslint index.js

What did you expect to happen?

1 error.

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

Nothing, no errors.

Are you willing to submit a pull request to fix this bug?

Yes, I'll do it.

Inner expressions are fine (e.g. ((b * c) + d) would be reported as one error), only the top level is missing.

Found this while working on #11848, the "TemplateLiteral" handler is missing. It should check its expressions.

Is there a single case where these parens could be necessary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.