1528, but I think named parameters should gravitate to a trailing comma more than positional ones, and some suggestions there will be bad for named parameters, like this one:
fn([a], [
b
c,
]);
The problem is, with named parameters, a name is very important, and name-value pair should stay coupled and ideally separate from other pairs. If a distinction of a line break is introduced between param2 and its value, at least the same distinction should be introduced between the pairs.
I take the rule of pair distinction further, and my personal preference is to have a trailing comma if we have at least 2 named parameters:
This:
becomes:
This is similar to
1528, but I think named parameters should gravitate to a trailing comma more than positional ones, and some suggestions there will be bad for named parameters, like this one:
The problem is, with named parameters, a name is very important, and name-value pair should stay coupled and ideally separate from other pairs. If a distinction of a line break is introduced between
param2
and its value, at least the same distinction should be introduced between the pairs.I take the rule of pair distinction further, and my personal preference is to have a trailing comma if we have at least 2 named parameters: