`prettier-ignore` in YAML seems to apply to all following nodes instead of just the immediate next node
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 52.3k
- Forks
- 5k
- Avg merge
- 19h 2m
- Merged PRs (30d)
- 117
Description
Prettier 2.6.2
Playground link
# Options (if any):
--prose-wrap always
(happens regardless of --prose-wrap setting, but it's easier to see with it set to always)
Input:
# prettier-ignore
x:
1
2
3
y:
1
2
3
Output:
# prettier-ignore
x:
1
2
3
y:
1
2
3
Expected behavior:
# prettier-ignore
x:
1
2
3
y: 1 2 3
Personally I think the expected behaviour makes more sense, but it could be the current behaviour is intended in which case I think the documentation could make it more obvious.
Currently it says:
# prettier-ignoreshould be placed on the line immediately above the ignored node:
which to me implies it'll only affect that node, rather than the nodes after it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the YAML case in the linked Prettier Playground and compare the current output with the expected output. Verify whether prettier-ignore should affect only the immediate next node; done means the behavior is corrected or the documentation clearly explains the intended scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, yaml
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100