Prettier 2.7.1
Playground link
Input:
type Foo<T> = T extends (...a: any[]) => (infer R extends string) ? R : never;
Output:
type Foo<T> = T extends (...a: any[]) => infer R extends string ? R : never;
Expected behavior:
The parentheses around (infer R extends string) should be preserved. Removing them results in an error with TypeScript, as shown in the TS Playground (link):
