Fix misplacement of comments after arrow (#17421)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
This commit is contained in:
authored and GitHub committed 2025-11-17 21:10:01 +08:00
1 parent 18c0f26bec
commit 81859299b9
5 files changed
+152

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
#### Fix misplacement of comments after arrow (#17421 by @o-m12a, @t-mangoe)
<!-- prettier-ignore -->
```ts
// Input
export const test = (): any => /* first line
second line
*/
null;
// Prettier stable
export const test = (): any /* first line
second line
*/ => null;
// Prettier stable (Second format)
SyntaxError: Unexpected token (1:22)
> 1 | export const test = (): any /* first line
| ^
2 | second line
3 | */ => null;
4 |
// Prettier main
export const test = (): any =>
/* first line
second line
*/
null;
```