Fix formatting for auto-accessors with comments (#14038)

Fixes https://github.com/prettier/prettier/issues/14036
This commit is contained in:
fisker Cheung authored and GitHub committed 2022-12-29 17:17:54 +08:00
1 parent d798b55486
commit ef707da0a2
6 files changed
+128

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
#### Fix formatting for auto-accessors with comments (#14038 by @fisker)
<!-- prettier-ignore -->
```jsx
// Input
class A {
@dec()
// comment
accessor b;
}
// Prettier stable
class A {
@dec()
accessor // comment
b;
}
// Prettier stable (second format)
class A {
@dec()
accessor; // comment
b;
}
// Prettier main
class A {
@dec()
// comment
accessor b;
}
```