no-extra-parens false positives with new and member expressions #12740
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
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
Online Demo Link
What did you expect to happen?
No errors.
What actually happened? Please include the actual, raw output from ESLint.
2 errors, and auto-fixed to:
The original expressions are both equivalent to
new (a().b.c)
The expressions produced in the fix are equivalent to
(new a()).b.c
, which is a different thing.Are you willing to submit a pull request to fix this bug?
Yes, but please verify is this a bug.
It seems that
MemberExpression(node)
should do a better check for bothobject
andparent
.(also, this is not a regression from #12302, it's unrelated).
The text was updated successfully, but these errors were encountered: