466 B
466 B
Fix parenthesis for optional function as return type (#11004 by @vjeux, @fisker)
// Input
const fun = (a: number): (?(string => string)) => {
return a > 0 ? s => `${s}: ${a}` : null;
};
// Prettier stable
const fun = (a: number): ?(string) => string => {
return a > 0 ? (s) => `${s}: ${a}` : null;
};
// Prettier main
const fun = (a: number): (?(string) => string) => {
return a > 0 ? (s) => `${s}: ${a}` : null;
};