tools
tools copied to clipboard
🐛 Various spacing/line length formatting incompatibilities with Prettier
Environment information
OS: win11, 64bit
install: `npm i rome@nightly`
What happened?
- Open this playground
- Notice the multiple formatting differences between the Rome output and Prettier output
Expected result
Prettier compatibility.
I've tested Nightly Rome's formatter in our biggest codebase, and these were the only differences I found.
Code of Conduct
- [X] I agree to follow Rome's Code of Conduct
I'll take a look. We can split this task to:
- [x] shothanded named import line break with default
- #3826
- [x] export line break
- #3726
- [x] jsx comment to props (specifically props count is 2, and comment to 2nd)
- [x] jsx whitespace is meaningful jsx text
- [x] jsx whitespace in childNodes with long strings
- #3732
- [x] object destructing in arguments (playground) from nsteien's comment
- #3802
- [ ] single-character-in-jsx formatting
- #3842
I have found some more incompatibility with prettier: playground
Yet another example: playground
I'll take a look. We can split this task to:
* [ ] imports/exports line break * [ ] JSX comment to props (specifically props count is 2, and comment to 2nd) * [ ] JSX space in childNodes * [ ] JSX space in childNodes with long strings
@unvalley Are you looking into all these issues or some of them? Can other contributors help you with some of the work?
@MichaReiser
Can other contributors help you with some of the work?
Yes, thanks. I'm working on import/exports line break now. Other tasks remain.
I'll work on fixing to named import line break.
Probably the last prettier incompatibility I'll find, seems very very minor though: playground
Probably the last prettier incompatibility I'll find, seems very very minor though: playground
That might be a tough one. Prettier has some special handling for single character texts that we don't fully support yet.
Yeah I personally don't mind if this doesn't get fixed. Maybe it affects other repos differently.
Does anyone want to look into the single-character-in-jsx formatting incompatibility?
Otherwise I'm happy with closing this issue, thank you everyone!
Does anyone want to look into the single-character-in-jsx formatting incompatibility?
Otherwise I'm happy with closing this issue, thank you everyone!
I'll check it =)