tools
tools copied to clipboard
🐛 Formatter might remove intentionally set spaces in TSX files
Environment information
IDE: VSCode
Extension: rome.rome v0.10.0
Package: "rome": "^0.7.0-next"
OS: Windows
What happened?
- TSX file contains spaces between two spans
<h1
className="..."
>
Some Text<br />
<span
className="..."
>
Text 1{' '}
</span>
and{' '}
<span
className="..."
>
Text 2
</span>
</h1>
- The spaces ({' '}) are getting removed
Expected result
I would expect the spaces to be preserved.
Code of Conduct
- [X] I agree to follow Rome's Code of Conduct
https://play.rome.tools/?lineWidth=80&indentStyle=tab"eStyle=double&indentWidth=2&sourceType=module&treeStyle=0&typescript=false&jsx=true#IAAgACAAIAAgACAAIAAgACAAIAA8AGgAMQAKACAAIAAgACAAIAAgACAAIAAgACAAIAAgAGMAbABhAHMAcwBOAGEAbQBlAD0AIgAuAC4ALgAiAAoAIAAgACAAIAAgACAAIAAgACAAIAA+AAoAIAAgACAAIAAgACAAIAAgACAAIAAgACAAUwBvAG0AZQAgAFQAZQB4AHQAPABiAHIAIAAvAD4ACgAgACAAIAAgACAAIAAgACAAIAAgACAAIAA8AHMAcABhAG4ACgAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAYwBsAGEAcwBzAE4AYQBtAGUAPQAiAC4ALgAuACIACgAgACAAIAAgACAAIAAgACAAIAAgACAAIAA+AAoAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAFQAZQB4AHQAIAAxAHsAJwAgACcAfQAKACAAIAAgACAAIAAgACAAIAAgACAAIAAgADwALwBzAHAAYQBuAD4ACgAgACAAIAAgACAAIAAgACAAIAAgACAAIABhAG4AZAB7ACcAIAAnAH0ACgAgACAAIAAgACAAIAAgACAAIAAgACAAIAA8AHMAcABhAG4ACgAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAYwBsAGEAcwBzAE4AYQBtAGUAPQAiAC4ALgAuACIACgAgACAAIAAgACAAIAAgACAAIAAgACAAIAA+AAoAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAFQAZQB4AHQAIAAyAAoAIAAgACAAIAAgACAAIAAgACAAIAAgACAAPAAvAHMAcABhAG4APgAKACAAIAAgACAAIAAgACAAIAAgACAAPAAvAGgAMQA+AA==, It seems prettier has the same behavior.
Alright. I'll use {` `}
which is apparently not picked up by Prettier / Rome for now.
I am just curious why you prefer to use {' '}
, because this should be transformed to the same HTML finally.
I am just curious why you prefer to use
{' '}
, because this should be transformed to the same HTML finally.
Due to two reasons:
- Spaces got stripped out by something, so the first idea was to make them explicit
- Visibility
I am just curious why you prefer to use
{' '}
, because this should be transformed to the same HTML finally.Due to two reasons:
- Spaces got stripped out by something, so the first idea was to make them explicit
- Visibility
Got it.
This issue is stale because it has been open 14 days with no activity.
The last release seems to have fixed the bug. If there's something else, please feel free to create a new issue.