Skip to content

Composed functions not put on own line anymore after 1.14.0 update #4925

@felixfbecker

Description

@felixfbecker

Getting these diffs a lot after the 1.14 update. Seems like the functional composition detection doesn't work anymore

         this.subscriptions.add(
             this.componentUpdates
-                .pipe(
-                    startWith(this.props),
-                    distinctUntilChanged(isEqual)
-                )
+                .pipe(startWith(this.props), distinctUntilChanged(isEqual))
                 .subscribe((props: Props) => {
                     const newParentPath = props.activePathIsDir ? props.activePath : dirname(props.activePath)
                     const queryParams = new URLSearchParams(this.props.history.location.search)

Prettier 1.14.0
Playground link

Input:

this.subscriptions.add(
            this.componentUpdates
                .pipe(startWith(this.props), distinctUntilChanged(isEqual))
                .subscribe(props => {
                    
                })
        )

Output:

this.subscriptions.add(
  this.componentUpdates
    .pipe(startWith(this.props), distinctUntilChanged(isEqual))
    .subscribe(props => {})
);

Expected behavior:

this.subscriptions.add(
  this.componentUpdates
    .pipe(
      startWith(this.props),
      distinctUntilChanged(isEqual)
     )
    .subscribe(props => {})
);

as it was with 1.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:javascriptIssues affecting JSlocked-due-to-inactivityPlease 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!

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions