Files
test-repo/changelog_unreleased/javascript/18147.md
T

49 lines
580 B
Markdown

#### Fix inconsistent comment print between class methods and object methods (#18147 by @fisker)
<!-- prettier-ignore -->
```jsx
// Input
class x {
method() // Class method
{
return 1
}
}
const object = {
method() // Object method
{
return 1
}
}
// Prettier stable
class x {
method() { // Class method
return 1;
}
}
const object = {
method() {
// Object method
return 1;
},
};
// Prettier main
class x {
method() {
// class method
return 1;
}
}
const object = {
method() {
// object method
return 1;
},
};
```