[flow] Fix union indent inside of function param with a name (#4325)

Fixes #4323

See #4323 for all the context
master
Christopher Chedeau 2018-04-16 18:47:05 -07:00 committed by GitHub
parent 0a22f5ec15
commit 02a1db8c9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 1 deletions

View File

@ -2384,7 +2384,7 @@ function printPathNoParens(path, options, print, args) {
parent.type !== "TSTypeParameterInstantiation" &&
parent.type !== "GenericTypeAnnotation" &&
parent.type !== "TSTypeReference" &&
parent.type !== "FunctionTypeParam" &&
!(parent.type === "FunctionTypeParam" && !parent.name) &&
!(
(parent.type === "TypeAlias" ||
parent.type === "VariableDeclarator") &&

View File

@ -49,6 +49,17 @@ type Props = {
}
) => void
};
declare class FormData {
append(
options?:
| string
| {
filepath?: string,
filename?: string
}
): void;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
type T5 =
| "1"
@ -118,4 +129,15 @@ type Props = {
) => void
};
declare class FormData {
append(
options?:
| string
| {
filepath?: string,
filename?: string
}
): void;
}
`;

View File

@ -46,3 +46,14 @@ type Props = {
}
) => void
};
declare class FormData {
append(
options?:
| string
| {
filepath?: string,
filename?: string
}
): void;
}