-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Comments inside decorator arguments are moved to the wrong line #1460
Copy link
Copy link
Labels
area:commentsIssues with how Prettier prints commentsIssues with how Prettier prints commentslocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
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.2Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:commentsIssues with how Prettier prints commentsIssues with how Prettier prints commentslocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.