Skip to content

JavaScript: Incorrect formatting for conditional expression when there is a block comment between consequent node and : #8709

@sosukesuzuki

Description

@sosukesuzuki

Prettier 2.0.5
Playground link

--parser babel

Input:

test
  ? first
  // comment
  : second

Output:

test
  ? first
  : // comment
    second;

Expected behavior:

test
  ? first
  // comment
  : second

Metadata

Metadata

Assignees

Labels

area:commentsIssues with how Prettier prints commentslang:javascriptIssues affecting JS

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions