Skip to content

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

@andersk

Description

@andersk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:yamlIssues affecting YAMLlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions