Skip to content

Unstable comment format in class methods #7745

@fisker

Description

@fisker

Prettier 1.19.1
Playground link

--parser babel

Input:

class x {
  focus() // do nothing
  {
    // do nothing
  }
}

Output:

class x {
  focus() { // do nothing
    // do nothing
  }
}

Second Output:

class x {
  focus() {
    // do nothing
    // do nothing
  }
}

Expected behavior:

Second output should not change


Issue found in #7565

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:commentsIssues with how Prettier prints commentsarea:idempotencyIssues with re-printing Prettier’s outputlang:javascriptIssues affecting JS

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions