Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

🐛 Various spacing/line length formatting incompatibilities with Prettier #3531

Closed
1 task done
nstepien opened this issue Oct 28, 2022 · 12 comments · Fixed by #3686, #3732 or #3842
Closed
1 task done

🐛 Various spacing/line length formatting incompatibilities with Prettier #3531

nstepien opened this issue Oct 28, 2022 · 12 comments · Fixed by #3686, #3732 or #3842
Assignees
Labels
A-Formatter Area: formatter S-Bug: confirmed Status: report has been confirmed as a valid bug

Comments

@nstepien
Copy link
Contributor

nstepien commented Oct 28, 2022

Environment information

OS: win11, 64bit
install: `npm i rome@nightly`

What happened?

  1. Open this playground
  2. 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

  • I agree to follow Rome's Code of Conduct
@nstepien nstepien added the S-To triage Status: user report of a possible bug that needs to be triaged label Oct 28, 2022
@ematipico ematipico added S-Bug: confirmed Status: report has been confirmed as a valid bug A-Formatter Area: formatter and removed S-To triage Status: user report of a possible bug that needs to be triaged labels Oct 28, 2022
@unvalley
Copy link
Contributor

unvalley commented Nov 3, 2022

I'll take a look. We can split this task to:

@nstepien
Copy link
Contributor Author

nstepien commented Nov 8, 2022

I have found some more incompatibility with prettier: playground

@nstepien
Copy link
Contributor Author

nstepien commented Nov 11, 2022

Yet another example: playground

@MichaReiser
Copy link
Contributor

MichaReiser commented Nov 14, 2022

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?

@unvalley
Copy link
Contributor

unvalley commented Nov 14, 2022

@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.

@unvalley
Copy link
Contributor

unvalley commented Nov 16, 2022

I'll work on fixing to named import line break.

@denbezrukov
Copy link
Contributor

I have found some more incompatibility with prettier: playground

I can help with this =)

@nstepien
Copy link
Contributor Author

Probably the last prettier incompatibility I'll find, seems very very minor though: playground

@MichaReiser
Copy link
Contributor

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.

@nstepien
Copy link
Contributor Author

Yeah I personally don't mind if this doesn't get fixed.
Maybe it affects other repos differently.

@nstepien
Copy link
Contributor Author

Does anyone want to look into the single-character-in-jsx formatting incompatibility?

Otherwise I'm happy with closing this issue, thank you everyone!

@denbezrukov
Copy link
Contributor

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 =)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Formatter Area: formatter S-Bug: confirmed Status: report has been confirmed as a valid bug
Projects
Status: Done
6 participants