Remove parentheses of sequence expressions breaks code
See original GitHub issuePrettier 1.19.1 Playground link
--parser babel
Input:
export default (1, 2);
Output:
export default 1, 2;
Second Output:
SyntaxError: Unexpected token, expected ";" (1:17)
> 1 | export default 1, 2;
| ^
2 |
Expected behavior:
A case found in #7470
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Remove Invalid Parentheses - GeeksforGeeks
Below code has a method isValidString to check validity of string, it counts open and closed parenthesis at each index ignoring ...
Read more >How can I remove text within parentheses with a regex?
If you don't absolutely need to use a regex, useconsider using Perl's Text::Balanced to remove the parenthesis.
Read more >Removes parentheses in expressions with mixed operators
Simplifying an expression (double parens) is one thing, but removing them is hurtful (for readability). After all, shouldn't prettier prioritize ...
Read more >Is there a function in Mathematica which removes brackets ...
If you wish to strip the brackets from a single expression in a nontrivial case please consider Delete as described in my answer...
Read more >Regular Expressions: Regexes in Python (Part 1)
A regex is a special sequence of characters that defines a pattern for ... Now suppose you need to write Python code to...
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
I wrote yesterday, No answer so far.
Honestly, I do not know, maybe this really only works for the master, need to write in support