Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-line binary expression in call args causes closing paren to be placed on same line as last arg #550

Open
jakebailey opened this issue Aug 14, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@jakebailey
Copy link
Contributor

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());

Playground Link

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: microsoft/TypeScript#54820 (comment)

@dsherret
Copy link
Member

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.

@jakebailey
Copy link
Contributor Author

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.

@dsherret dsherret added the bug Something isn't working label Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants