Improve dangling comment handling in flow hooks (#18630)
This commit is contained in:
1 parent
48f7598e57
commit
4cfb8bc9b8
4 files changed
+156
-7
No files matched your search
@@ -0,0 +1,32 @@
|
||||
#### Fix dangling comment print in hooks (#18630 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```jsx
|
||||
// Input
|
||||
hook A(
|
||||
// comment
|
||||
) {}
|
||||
declare hook B(// comment
|
||||
): void
|
||||
type C = hook (// comment
|
||||
)=> void
|
||||
|
||||
// Prettier stable
|
||||
hook A() // comment
|
||||
{}
|
||||
declare hook B(): // comment
|
||||
void;
|
||||
type C = hook () => // comment
|
||||
void;
|
||||
|
||||
// Prettier main
|
||||
hook A(
|
||||
// comment
|
||||
) {}
|
||||
declare hook B(
|
||||
// comment
|
||||
): void;
|
||||
type C = hook (
|
||||
// comment
|
||||
) => void;
|
||||
```
|
||||
Reference in new issue
Block a user