Prettier 2.8.3
Playground link
Input:
type Test<T> = T extends ((
token: TSESTree.Token
) => token is infer U extends TSESTree.Token)
? U
: TSESTree.Token;
Output:
type Test<T> = T extends (
token: TSESTree.Token
) => token is infer U extends TSESTree.Token
? U
: TSESTree.Token;
Expected behavior:
The parentheses should be retained as they are required.
Without the parentheses it causes a syntax error:
SyntaxError: '?' expected. (5:19)
3 | ) => token is infer U extends TSESTree.Token
4 | ? U
> 5 | : TSESTree.Token;
| ^
6 |
Prettier 2.8.3
Playground link
Input:
Output:
Expected behavior:
The parentheses should be retained as they are required.
Without the parentheses it causes a syntax error: