prettier / prettier/plugin-xml
move comment before
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 278
- Forks
- 46
- Avg merge
- 1m
- Merged PRs (30d)
- 13
Description
given
<module name="IllegalImport" /><!-- defaults to sun.* packages -->
I would like the reformat to be
<!-- defaults to sun.* packages -->
<module name="IllegalImport" />
instead of
<module name="IllegalImport" />
<!-- defaults to sun.* packages -->
note: obviously I've turned off whitespace sensitivity.
I feel like this would be a sensible default with whitespace sensitivity turned off, but an option would be nice too. I feel like programming convention is, comments to the right affect code to the left. Comments before affect code below. So moving the comment to be after changes the ... semantics.
Alternative, or maybe in addition to, if you could leave the comment alone if it's not making the line too long.
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 tracing the XML formatter behavior for comments adjacent to elements, using the examples in this issue as the expected ordering cases. Compare behavior with whitespace sensitivity disabled, then define tests for moving comments before elements and preserving comments when keeping them inline avoids an overlong line.
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