Skip to content

Comments inside decorator arguments are moved to the wrong line #1460

@cmmartin

Description

@cmmartin

Babylon seems to support decorators, but prettier incorrectly relocates comments inside of decorator arguments. Please see this example. Notice that the comments are moved to the wrong lines.

Input

var x = 100

@Hello({
  a: 'a', // Comment is in the wrong place
  // test
  b: '2'
})
class X {
  
}

Output

var x = 100 // Comment is in the wrong place

// test
@Hello({
  a: "a",
  b: "2",
})
class X {}
$ prettier --version
1.2.2

Metadata

Metadata

Assignees

Labels

area:commentsIssues with how Prettier prints commentslocked-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