New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSX formatting issue with Sublime Text 3 #1789
Comments
Sorry about this! It is fixed in master, it looks like <p>
one one <b>two</b>, <b>three</b> four <b>five</b> six six six six six six six
six six six six six six six six.
</p>; We're going to do a new release next week. |
Awesome, thanks! |
Please, reopen this is issue because it is not solved with latest release. |
We don't remove |
Well, I believe it is not. I wrote this because I removed these "spaces" manually and prettier did it again. And I just updated it to the latest version for Sublime Text 3. So this bug is out there for ST3. |
Can you look at what version of Sublime is using? |
Sorry, it was my bad with versions, prettier was installed globally, and sublime used it instead of local version. Though, some other ugly thing happening, this
becomes this
Depending on |
cc @karl |
HI @name-k, I've done a fair amount of work on the JSX formatting, so should be able to help with this. The output you are seeing with in your last comment is as expected. Prettier is splitting your line of text to attempt to keep it under the There is a known issue where Prettier sometimes places the Interactive version of @name-k's example: |
Hi @karl, I believe prettier should not break text nodes on spaces, inside of JSX at all. I mean, if it is several sentences, should they be broken? Normally with text nodes you expect them to stay in a single line, like common HTML text, with no workarounds to break a line like I assume the problem is in |
We recently adding support for breaking text within JSX (#1120). This change reduced the number times we added The complex JSX rules mean that in order to break between text and tag/expression nodes we sometimes need to add |
@name-k I'm closing this issue as I don't believe there is anything specific we need to fix. We can re-open it if there is a specific change you feel would improve Prettier. |
What I have
what I get
Configuration
The text was updated successfully, but these errors were encountered: