prettier / prettier/plugin-xml
Please include option not to auto-self-close empty nodes
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 278
- Forks
- 46
- Avg merge
- 1m
- Merged PRs (30d)
- 13
Description
There are some situations (Salesforce metadata) where the metadata should not self-close:
This is the desired XML:
<searchLayouts></searchLayouts>
but the plugin auto-closes it to
<searchLayouts/>
I realize that maybe this isn't a best practice, but it is causing a ton of changes in our VCS that we'd rather not have to deal with, and it clutters IDEs until the commit is cleaned with Husky and Prettier.
Could we please have a boolean to prevent this kind of cleanup?
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
Start by locating the plugin's XML formatting path that converts empty paired elements into self-closing elements. Use the issue's searchLayouts examples to define the expected behavior, then identify where a boolean option would be configured and tested. Done means the option preserves while existing cleanup remains unchanged by default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100