Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

no-extra-parens never reports double parens

See original GitHub issue

Tell us about your environment

  • ESLint Version: 6.2.0
  • Node Version: 10.16.0
  • npm Version: 6.9.0

same in ESLint 5.16.0, this is not regression.

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


Please show your full configuration:

module.exports = {
  parserOptions: {
    ecmaVersion: 2015

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

This is not reported because of the precedence:

/*eslint no-extra-parens: "error"*/

a * ((b + c));

This is not reported because of the option (does the option allow multiple parens or just one pair?):

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

if (((a = b))) {}

There are many examples like this, seems that double parens are never reported whenever a single pair wouldn’t be.

eslint index.js

What did you expect to happen?

Errors in both cases, I guess.

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

No errors.

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

Yes, if this is indeed a bug. But this needs some analysis and design first, I’m thinking about an additional selector that would catch all double parens regardless of the context.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

mysticateacommented, Aug 31, 2019

I think that to handle this issue as a bug makes sense.

kaicataldocommented, Nov 21, 2019

Whoops, thanks @platinumazure

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-extra-parens - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Possible to disable ESLint/Prettier rule that adds ...
Possible to disable ESLint/Prettier rule that adds parentheses? · is the reason you don't want them because of the two extra bytes in...
Read more >
ESLint v3.6.0 released
... 745343f Update: no-extra-parens supports async/await (refs #7101) (#7178) ... 6ae660b Fix: Don't report comparisons of two typeof expressions (fixes ...
Read more >
enforce line breaks between arguments of a function call ...
This rule has a string option: "always" (default) requires line breaks between arguments; "never" disallows line breaks between arguments; "consistent ...
Read more >
How to Use (Not Abuse) Parentheses | MLA Style Center
Like some other punctuation marks, parentheses are used in prose to ... the afternoon sun (in those days I never bothered with a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found