Skip to content

Comment in chained method return statement adds parenthesis #1959

@dotlouis

Description

@dotlouis

Hi,
first of all thank you for the amazing work !

I ran prettier on my entire codebase and found only one thing that probably should not behave as it is.

demo

Input

    getShop(arg) {
        return this.firebase.object(`/shops/${shopLocation.shop}`)
            // keep distance info
            .first((shop: ShopQueryResult, index: number, source: Observable<ShopQueryResult>): any => {
                // add distance to result
                const s = shop;
                s.distance = shopLocation.distance;
                return s;
            });
    }

Output

getShop(arg) {
    return ( // <= why is this in parenthesis ?
      this.firebase.object(`/shops/${shopLocation.shop}`)// keep distance info
      .first(
        (
          shop: ShopQueryResult,
          index: number,
          source: Observable<ShopQueryResult>,
        ): any => {
          // add distance to result
          const s = shop;
          s.distance = shopLocation.distance;
          return s;
        },
      )
    );
  }

When I remove the // keep distance info the output is fine without any parenthesis
Any ideas ?
Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions