-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Copy link
Labels
lang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
Prettier 2.8.1
Playground link
--parser babel
Input:
var let = [1];
(let[0] = 2);
Output:
var let = [1];
let[0] = 2;
Second Output:
SyntaxError: Unexpected token (2:5)
1 | var let = [1];
> 2 | let[0] = 2;
| ^
3 |
Expected behavior:
Do not remove the brackets, as they are necessary to make the assignment not destructuring. This is a very niche bug, but it seems like a fairly trivial oversight.
For context, I'm documenting expression statements at mdn/content#22994, and this tripped me up when I was trying to document a workaround.
Metadata
Metadata
Assignees
Labels
lang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.