dprint-plugin-typescript
dprint-plugin-typescript copied to clipboard
Multi-line binary expression in call args causes closing paren to be placed on same line as last arg
Describe the bug
dprint-plugin-typescript version: 0.86.1
Input Code
forEach(arr, f =>
a()
&& b()
);
Expected Output
Maybe...
forEach(arr, f => a() && b());
forEach(
arr,
f => a() && b()
);
Actual Output
forEach(arr, f =>
a()
&& b());
Truthfully, I'm not sure what the bug is here, but it seems a little odd to me in the first code snippet that the paren would get moved up a line.
See also: https://github.com/microsoft/TypeScript/pull/54820#discussion_r1246068978
FWIW, you can manually fix this by moving the binary expression to be on one line or by moving the first parameter to the second line if you want it on multiple lines.
Indeed, I'm just trying to close the loop on all of the "oddities" on the TS PR before we merge it and forget about them.