Keep multi-line formatting for destructuring assignment
I think multi-line destructuring should not be collapsed by Prettier. Same concept as the [multi-line objects special case](https://github.com/prettier/prettier/blob/master/Rationale.md#multi-line-objects). When doing destructuring (particularly nested) new lines can greatly enhance readability. **Example of current behaviour** Input: ```javascript // Object with multiple lines uncollapsed by Prettier const user = { name: { first: "Zoid", last: "Berg", }, }; // Similar destructuring assignment is collapsed by Prettier const { name: { first, last, }, } = user; ``` Prettier output: ```javascript // Object with multiple lines uncollapsed by Prettier const user = { name: { first: "Zoid", last: "Berg" } }; // Similar destructuring assignment is collapsed by Prettier const { name: { first, last } } = user; ```
Posted by Brian-Gaffney on Jul 27, 2017, 9:40 AM
Tags
Related issues
- [Meta] Feedback on granular control over Copilot changes
- unexpected status 401 Unauthorized issue
- [MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
- [CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
- Video stops playing after some minutes
- [MODEL] Claude verbose code comments by default — ignores instructions to stop.
Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments
github (Software)
[Meta] Feedback on granular control over Copilot changes
unexpected status 401 Unauthorized issue
[MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
[CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
Video stops playing after some minutes
[MODEL] Claude verbose code comments by default — ignores instructions to stop.
Scope Codex VS Code chats to the current workspace/project
Update on "Co-authored-by: Copilot" in commit messages
Keep multi-line formatting for destructuring assignment
I think multi-line destructuring should not be collapsed by Prettier. Same concept as the [multi-line objects special case](https://github.com/prettier/prettier/blob/master/Rationale.md#multi-line-objects). When doing destructuring (particularly nested) new lines can greatly enhance readability. **Example of current behaviour** Input: ```javascript // Object with multiple lines uncollapsed by Prettier const user = { name: { first: "Zoid", last: "Berg", }, }; // Similar destructuring assignment is collapsed by Prettier const { name: { first, last, }, } = user; ``` Prettier output: ```javascript // Object with multiple lines uncollapsed by Prettier const user = { name: { first: "Zoid", last: "Berg" } }; // Similar destructuring assignment is collapsed by Prettier const { name: { first, last } } = user; ```
Comments (0)
No comments yet. Start the discussion.