Another destructuring oddity (assigning from computed properties on Objects) #4092
Labels
area:destructuring
lang:javascript
Issues affecting JS
type:bug
Issues identifying ugly output, or a defect in the program
Prettier 1.11.1
Playground link
Input:
Output:
Expected behavior:
I expect the LHS of the assignment to be broken out rather than the RHS, as it does when accessing an Array item by index:
Input:
Output:
This happens with both Array and Object destructuring, but only when accessing an object property with bracket notation and the print-width is exceeded after an opening bracket.
I imagine the assigned reference should never be broken out unless the last line (
} = some.thing
) exceeds the print-width itself.The text was updated successfully, but these errors were encountered: