Skip to content

YAML: a comment after an anchor doesn't stay on a separate line #10518

@thorn0

Description

@thorn0

After fixing #10510, we have this issue.

Prettier pr-10516
Playground link

--parser yaml

Input:

key1: &default

  # This key ...
  subkey1: value1

key2:
  <<: *default

Output:

key1: &default # This key ...
  subkey1: value1

key2:
  <<: *default

Expected behavior:

key1: &default
  # This key ...
  subkey1: value1

key2:
  <<: *default

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedWe're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!lang:yamlIssues affecting YAML

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions