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

Improve formatting for do expressions #10660

Closed
sosukesuzuki opened this issue Apr 8, 2021 · 0 comments · Fixed by #10693
Closed

Improve formatting for do expressions #10660

sosukesuzuki opened this issue Apr 8, 2021 · 0 comments · Fixed by #10693
Labels
lang:javascript Issues affecting JS locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:bug Issues identifying ugly output, or a defect in the program

Comments

@sosukesuzuki
Copy link
Member

Prettier 2.2.1
Playground link

--parser babel

Input:

expect(do {
  var bar = "foo";
  bar;
}).toBe("foo");

Output:

expect(
  do {
    var bar = "foo";
    bar;
  }
).toBe("foo");

Expected behavior:
Same as input

expect(do {
  var bar = "foo";
  bar;
}).toBe("foo");

Additional context:

Original was reported by @nicolo-ribaudo at babel/babel#13122 (comment)

@sosukesuzuki sosukesuzuki added type:bug Issues identifying ugly output, or a defect in the program lang:javascript Issues affecting JS labels Apr 8, 2021
@github-actions github-actions bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang:javascript Issues affecting JS locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. 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.

1 participant