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

YAML: Why --- changes to ... #4920

Closed
maximbaz opened this issue Jul 31, 2018 · 0 comments
Closed

YAML: Why --- changes to ... #4920

maximbaz opened this issue Jul 31, 2018 · 0 comments
Labels
lang:yaml Issues affecting YAML locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. status:has pr Issues with an accompanying pull request. These issues will probably be fixed soon! type:bug Issues identifying ugly output, or a defect in the program
Milestone

Comments

@maximbaz
Copy link

I'm not sure if this is a bug or intended behavior. I noticed that --- changes to ..., and for example kubectl (kubernetes tool) cannot parse my yaml files because of this.

I tried to find what is the difference, found this page, but after reading the description I still have no clue why ... in the example below is better than ---.

Honestly, I have never seen ... being used in YAML files until today. I can easily imagine that it's a problem in kubectl, that it should support ..., but if there is no difference, can we make prettier prefer --- over ...?


Prettier 1.14.0
Playground link

--parser yaml

Input:

one:
  key: 1
---
two:
  key: 2

Output:

one:
  key: 1
...
two:
  key: 2

Expected behavior:

one:
  key: 1
---
two:
  key: 2
@j-f1 j-f1 added type:bug Issues identifying ugly output, or a defect in the program lang:yaml Issues affecting YAML labels Jul 31, 2018
@ikatyang ikatyang added the status:has pr Issues with an accompanying pull request. These issues will probably be fixed soon! label Aug 1, 2018
@azz azz closed this as completed in #4921 Aug 1, 2018
@ikatyang ikatyang added this to the 1.14.1 milestone Aug 2, 2018
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Oct 31, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Oct 31, 2018
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. status:has pr Issues with an accompanying pull request. These issues will probably be fixed soon! type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

No branches or pull requests

3 participants