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

Function call stays in one line that exceeds printWidth #12892

Closed
SutnuiBorshik opened this issue May 18, 2022 · 1 comment · Fixed by #13341
Closed

Function call stays in one line that exceeds printWidth #12892

SutnuiBorshik opened this issue May 18, 2022 · 1 comment · Fixed by #13341
Labels
area:function calls lang:javascript Issues affecting JS type:bug Issues identifying ugly output, or a defect in the program

Comments

@SutnuiBorshik
Copy link

Prettier 2.6.2
Playground link

--parser typescript

Input:

setTimeout(() => {
  console.log('test');
}, someFunctionCall(
  veryLongParameterName1,
  veryLongParameterName2,
  veryLongParameterName3,
  veryLongParameterName4,
));

Output:

setTimeout(() => {
  console.log("test");
}, someFunctionCall(veryLongParameterName1, veryLongParameterName2, veryLongParameterName3, veryLongParameterName4));

someFunctionCall becomes one line no matter what. You can pass other functions or expressions as it's params and it doesn't matter.

Expected behavior:
Function call should be broken into multiple lines. printWidth should be enforced.

@thorn0 thorn0 added type:bug Issues identifying ugly output, or a defect in the program lang:javascript Issues affecting JS area:function calls labels Aug 10, 2022
@thorn0 thorn0 linked a pull request Aug 25, 2022 that will close this issue
4 tasks
@thorn0
Copy link
Member

thorn0 commented Aug 29, 2022

fixed by #13341

@thorn0 thorn0 closed this as completed Aug 29, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:function calls lang:javascript Issues affecting JS type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants