Files
test-repo/tests/flow/method/consistent-breaking.js
T
Georgii Dolzhykov ec27ade49b Heuristic for grouping parameters in method signatures (#10357)
* 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
2021-02-23 16:38:56 +02:00

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 } {
// ...
}
}