Alignment with multiple adjacent strings
This doesn't seem right. I'd expect the two later literal strings to be indented relative to the named argument. Or better yet, all 3 of the adjacent strings on separate lines, indented relative to the named arguments.
method() => Intl.message("This comes from a method",
name: 'method', desc: 'This is a method with a '
'long description which spans '
'multiple lines.');
Another example.
testHtml('DOM clobbering of attributes with multiple nodes', validator,
"<form onmouseover='alert(1)'><input name='attributes'>"
"<input name='attributes'>", "");
It's very unclear from this formatting that the last two arguments are two strings, the first the concatenation of two long adjacent strings and the second one empty. I'd prefer to have the second string on its own line, but even then it would seem confusing to have
testHtml('DOM clobbering of attributes with multiple nodes', validator,
"<form onmouseover='alert(1)'><input name='attributes'>"
"<input name='attributes'>",
"");
I think I'd rather have subsequent lines of the adjacent string be indented.
Aligning relative to a named argument only works well with short argument names. In the case of long argument names it can look really bad.
In the forthcoming tall style, this code gets formatted as:
method() => Intl.message(
"This comes from a method",
name: 'method',
desc:
'This is a method with a '
'long description which spans '
'multiple lines.',
);
And:
testHtml(
'DOM clobbering of attributes with multiple nodes',
validator,
"<form onmouseover='alert(1)'><input name='attributes'>"
"<input name='attributes'>",
"",
);
I think these both do a good job of making the argument lists clearer (obviously at the expense of more vertical height, hence the name "tall" style).