prettier / prettier/plugin-xml
Feature request: Allow the first attribute to stay on the same line as the tag
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 278
- Forks
- 46
- Avg merge
- 1m
- Merged PRs (30d)
- 13
Description
bracketSameLine
true
printWidth
No response
singleAttributePerLine
true
tabWidth
4
xmlWhitespaceSensitivity
strict
xmlSelfClosingSpace
true
Input XML
<Button id="idCancelCommentBtn" press=".cancelComment" text="{i18n>cancelBtn}" />
Current output XML
<Button
id="idCancelCommentBtn"
press=".cancelComment"
text="{i18n>cancelBtn}" />
Expected output XML
<Button id="CancelCommentBtn"
press=".cancelComment"
text="{i18n>cancelBtn}" />
First of all, thank you for creating and maintaining this plugin. It's very helpful for our CI pipeline and pre-commit hook. And I understand that as a prettier plugin, it has the right to be opinionated, so I am not sure if it's a huge ask...
Anyways, I am trying to migrate a project that's formatted with Red Hat's XML VS Code plugin, and the current XML format is the same as the "Expected out XML". So I am hoping maybe the prettier plugin can offer such a configuration option. Thank you!
Contributor guide
No contributing guide indexed for this repository
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
No file, test, or entry point is named. Start by reproducing the supplied XML with the listed options, then trace the plugin's formatting behavior for wrapped attributes; done means the first attribute stays beside the tag while the remaining attributes retain the shown indentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100