* Heuristic for grouping parameters in method signatures * Apply the same logic to function declaration and Flow types * Group only if there is only one parameter * Don't group if type param has constraints/default or >1 type param
22 lines
518 B
JavaScript
22 lines
518 B
JavaScript
class Foo1 {
|
|
flowParseFunctionTypeParams(
|
|
params: N.FlowFunctionTypeParam[] = [],
|
|
): { params: N.FlowFunctionTypeParam[], rest: ?N.FlowFunctionTypeParam } {
|
|
// ...
|
|
}
|
|
}
|
|
|
|
type Foo2 = {
|
|
flowParseFunctionTypeParams(
|
|
params: N.FlowFunctionTypeParam[]
|
|
): { params: N.FlowFunctionTypeParam[], rest: ?N.FlowFunctionTypeParam }
|
|
}
|
|
|
|
{
|
|
function flowParseFunctionTypeParams(
|
|
params: N.FlowFunctionTypeParam[]
|
|
): { params: N.FlowFunctionTypeParam[], rest: ?N.FlowFunctionTypeParam } {
|
|
// ...
|
|
}
|
|
}
|