-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
RxJS pipe chaining get formatted on a single line #4172
Copy link
Copy link
Closed
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.status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!Issues with an accompanying pull request. These issues will probably be fixed soon!status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken
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.status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!Issues with an accompanying pull request. These issues will probably be fixed soon!status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken
Prettier 1.11.1
Playground link
Input:
Output:
Expected behavior:
As in the official RxJS documentation, the given input shouldn't be modified as it is considered as methods chaining. The piped functions
filter,mapandscanshould remain on a separate line.I don't know how it can be handled by prettier without too much impacts, but maybe considering that a function call that includes at least 2 function calls as parameters (eg:
fn1(fn2(), fn3())) could be printed as a chain as below:It would also help when using Lo-Dash FP chaining which encounters the same problem.