no-extra-parens never reports double parens
See original GitHub issueTell 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?
default
Please show your full configuration:
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:
- Created 4 years ago
- Reactions:2
- Comments:11 (10 by maintainers)
Top GitHub Comments
I think that to handle this issue as a bug makes sense.
Whoops, thanks @platinumazure