Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upYAML: long property names/keys get prefixed with question mark `?`, and colon `:` gets wrapped onto the next line #5599
Comments
|
The code for this should be in |
|
@deltaidea Are you working on this? I was wondering if I could fix this. Thanks! |
|
Go ahead! I completely forgot about this issue. :D |
|
Hey @byronluk are you still working on this? |
|
You can take it. I spent some time looking into it but haven't came up with a solution. prettier/src/language-yaml/printer-yaml.js Lines 437 to 440 in 5847c16 This is what adds the "?" and ":" prefix if that helps. |
|
I have also not been able to find a solution. In particular, the conditional group on line 434 and the ifBreak on 439 of printer-yaml.js seem to behave differently than as described in commands.md. |
|
I think this label should be changed to |
|
We are currently having this issue, and it is breaking our YAML. Some clarification questions:
|
|
/cc @ikatyang i think it is bug, not feature, right? |
|
|
Does it mean that the generated example is valid?
The yaml documentation is hard to read... |
|
Yes, it's valid. It seems the library you used only implemented part of the spec. |
|
@nasht00 |
|
@deltaidea Does not look to be a good option according to this: #3468 (comment) It produce not wanted behavior on files part getting in-lined when I don't want to. This is a quite stuck situation. Apart of totally remove prettier from my tools, I don't see any other workaround. |
Prettier 1.15.3
Playground link
Input:
Output:
Expected behavior:
Doesn't wrap the
:to the second line, i.e. leaves the whole thing intact.This issue looks simple to fix, where would I look for the related code if I wanted to make a PR?