Parentheses missing on `OptionalMemberExpression`
See original GitHub issuePrettier 1.19.1 Playground link
--parser babel
Input:
(foo?.bar)();
Output:
foo?.bar();
A case found in #7470
I think they are equal, so we should modify AST to pass test?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Missing parentheses around LogicalExpression when used in ...
Hello! So I have a transform that transforms a.getIn(['b', 'c']) to a?.b?.c (and some more stuff). If instead of a there is a...
Read more >Why is the parenthesis missing in this anonymous function call?
Since the syntax for function declarations and function expressions is identical, JS tells which one you are using from the code around the ......
Read more >@babel/types | Yarn - Package Manager
#11325 fix: check parentheses between optional chain and other types (@JLHwung) ... #8751 Fix some missing parens cases with OptionalMemberExpression in ...
Read more >babel/types
AST Node OptionalMemberExpression shape: ... FunctionParent did not include Program since Babel 7. t.isFunctionParent(node);. Copy. Covered nodes:.
Read more >parentheses missing from iPhone keypad in Messages app
When you are typing a message, that appears. As iW00 has indicated, typing the parentheses around the area code is not necessary, only...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
They’re not equal. If
foo
is undefined,foo?.bar();
does nothing whereas(foo?.bar)();
turns intoundefined()
and throws aTypeError
(“… is not a function”).fixed by #7500