IssueRaiser

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

Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments

github (Software)

Prettier does not respect existing method chain breaks

jfairleyMar 26, 2020, 8:23 PM

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.

Comment on this issue