Prettier does not respect existing method chain breaks
referencing: [Improved method chain breaking heuristic](https://prettier.io/blog/2020/03/21/2.0.0.html#improved-method-chain-breaking-heuristic-6685httpsgithubcomprettierprettierpull6685-by-mmkalhttpsgithubcommmkal) I understand the motivation behind the recent change, and fwiw, I agree with your solution in 2.0 with one exception. I don't think that code expressing chained methods across multiple lines should be automatically collapsed by `prettier`. Through each issue linked (#3197, #4765, #1565 and #4125) I didn't interpret that the community wanted chained methods collapsed; they simply wanted inline chained methods to remain inline. In the [highest rated comment](https://github.com/prettier/prettier/issues/4125#issuecomment-372720659) from #4125, one of @pvdlg's suggestions is `If the user write them on multiple lines => keep on multiple line`. In this comment, I think @pvdlg nailed it, and that's exactly what I'm looking for too. <!-- BEFORE SUBMITTING AN ISSUE: 1. Search for your issue on GitHub: https://github.com/prettier/prettier/issues A large number of opened issues are duplicates of existing issues. If someone has already opened an issue for what you are experiencing, you do not need to open a new issue — please add a 👍 reaction to the existing issue instead. 2. We get a lot of requests for adding options, but Prettier is built on the principle of being opinionated about code formatting. This means we have a very high bar for a
Posted by jfairley on Mar 26, 2020, 8:23 PM
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.3,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
Prettier does not respect existing method chain breaks
referencing: [Improved method chain breaking heuristic](https://prettier.io/blog/2020/03/21/2.0.0.html#improved-method-chain-breaking-heuristic-6685httpsgithubcomprettierprettierpull6685-by-mmkalhttpsgithubcommmkal) I understand the motivation behind the recent change, and fwiw, I agree with your solution in 2.0 with one exception. I don't think that code expressing chained methods across multiple lines should be automatically collapsed by `prettier`. Through each issue linked (#3197, #4765, #1565 and #4125) I didn't interpret that the community wanted chained methods collapsed; they simply wanted inline chained methods to remain inline. In the [highest rated comment](https://github.com/prettier/prettier/issues/4125#issuecomment-372720659) from #4125, one of @pvdlg's suggestions is `If the user write them on multiple lines => keep on multiple line`. In this comment, I think @pvdlg nailed it, and that's exactly what I'm looking for too. <!-- BEFORE SUBMITTING AN ISSUE: 1. Search for your issue on GitHub: https://github.com/prettier/prettier/issues A large number of opened issues are duplicates of existing issues. If someone has already opened an issue for what you are experiencing, you do not need to open a new issue — please add a 👍 reaction to the existing issue instead. 2. We get a lot of requests for adding options, but Prettier is built on the principle of being opinionated about code formatting. This means we have a very high bar for a
Comments (0)
No comments yet. Start the discussion.