Skip to content

End-of-line comment inside object literal moved to next line #7155

@glen-84

Description

@glen-84

Prettier 1.19.1
Playground link

--parser babel

Input:

const x = {
  c: { // Very important key.
      a: 123
  }
};

Output:

const x = {
  c: {
    // Very important key.
    a: 123
  }
};

Expected behavior:

The comment should not be moved down.

Also affects TypeScript.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions