Improve dangling comment handling in flow hooks (#18630)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-01-15 03:01:56 +08:00
1 parent 48f7598e57
commit 4cfb8bc9b8
4 files changed
+156 -7

No files matched your search

+32
View File
@@ -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;
```