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

Unexpectedly doubles a blank line before a YAML comment (2.1.0 regression) #9130

Closed
andersk opened this issue Sep 2, 2020 · 4 comments · Fixed by #9143
Closed

Unexpectedly doubles a blank line before a YAML comment (2.1.0 regression) #9130

andersk opened this issue Sep 2, 2020 · 4 comments · Fixed by #9143
Labels
lang:yaml Issues affecting YAML 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

@andersk
Copy link
Contributor

andersk commented Sep 2, 2020

Prettier 2.1.1
Playground link

--parser yaml

Input:

- foo: 0
  bar: 1

  # baz: 2
- quux: 3

Output:

- foo: 0
  bar: 1


  # baz: 2
- quux: 3

Expected behavior:

Prettier should preserve the single blank line, not add a second blank line.

I bisected this issue to commit ea84392 YAML: Preserve blank lines in comments (#8356). Cc @fisker.

@sosukesuzuki sosukesuzuki added lang:yaml Issues affecting YAML type:bug Issues identifying ugly output, or a defect in the program labels Sep 3, 2020
@ghost
Copy link

ghost commented Sep 4, 2020

@andersk this seems interesting. Can i take it up?

@alexander-akait
Copy link
Member

Yes, PR welcome

@fisker
Copy link
Sponsor Member

fisker commented Sep 4, 2020

@sosukesuzuki already on it #9143

@ghost
Copy link

ghost commented Sep 4, 2020

Okay

@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 Dec 7, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang:yaml Issues affecting YAML 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.

4 participants