Keeping long type signatures on a single line apart from the type body helps me read the functions. I will resort to the multiline version eventually but there is a threshold before giving into that. For me, at least, vertical space is precious.
Even in a short[er] sig case I still think separating sig from body with a line break is more readable:
// What dprint does
type AddFnMerge<$FluentFn extends FnFluent<any>> = FnCallFluent<
$FluentFn,
State<$State['context'], $State['properties'], [...$State['merges'], $MergeFn]>
>
// What I prefer
type AddFnMerge<$FluentFn extends FnFluent<any>> =
FnCallFluent<
$FluentFn,
State<$State['context'], $State['properties'], [...$State['merges'], $MergeFn]>
>
I think the only time I would want no line break is when there are no type variables.
type ThisIsFine = string
What do you think? If my proposal is not strictly better, then could it at least be an option. E.g. newlineAfterTypeVariablesSignature
I find myself doing this often:
Dprint would format that as:
Note if I insert a newline after
type addFnMerge<
then this happens (which I approve of):Keeping long type signatures on a single line apart from the type body helps me read the functions. I will resort to the multiline version eventually but there is a threshold before giving into that. For me, at least, vertical space is precious.
Even in a short[er] sig case I still think separating sig from body with a line break is more readable:
I think the only time I would want no line break is when there are no type variables.
What do you think? If my proposal is not strictly better, then could it at least be an option. E.g.
newlineAfterTypeVariablesSignature