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:
5 files changed
+152
No files matched your search
@@ -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;
|
||||
```
|
||||
Reference in new issue
Block a user