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 some MemberExpressions incorrectly #9156
Comments
May I give this a go? Will start working on this right away. |
Sure, feel free. Thanks for contributing! |
I have been familiarizing myself with the library and investigating the issue. I think I have a few ideas on how to fix them. I do want to confirm the logics with you though. The first line should have a warning because parens around a call expression are unnecessary? The third line should not have a warning because parens are necessary around a member expression within a new expression? |
I think extra parens around a new expression should only be allowed if there are intervening parentheses. new (Foo.Bar.Baz); // unnecessary parens
new (Foo.Bar().Baz); // necessary parens |
I will look into it more to find the necessary or unnecessary aspects of these parens. |
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.
What did you expect to happen?
I expected an error to be reported on line 1, and no error on line 3.
What actually happened? Please include the actual, raw output from ESLint.
An error was reported on line 3, but no error was reported on line 1.
edit: added a false positive case
The text was updated successfully, but these errors were encountered: