Skip to content
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

Unstable JSX formatting #1703

Closed
karl opened this issue May 24, 2017 · 3 comments
Closed

Unstable JSX formatting #1703

karl opened this issue May 24, 2017 · 3 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:bug Issues identifying ugly output, or a defect in the program

Comments

@karl
Copy link
Collaborator

karl commented May 24, 2017

@vjeux found a case where JSX formatting is not stable (#1671 (comment)).

<div className="yourScore">
  Your score: <span className="score">{`${mini.crosstable.users[sessionUserId]} - ${mini.crosstable.users[user.id]}`}</span>
</div>
<div className="yourScore">
  Your score:
  {" "}
  <span className="score">{`${mini.crosstable.users[sessionUserId]} - ${mini
    .crosstable.users[user.id]}`}</span>
</div>;
<div className="yourScore">
  Your score:
  {" "}
  <span className="score">{`${mini.crosstable.users[sessionUserId]} - ${mini.crosstable.users[user.id]}`}</span>
</div>;
@k15a k15a added the type:bug Issues identifying ugly output, or a defect in the program label May 24, 2017
@piotrfonte
Copy link

piotrfonte commented May 24, 2017

I have the same issue where:

<ul>
  <li><code>children</code> — meant to make space for <code>StatusSymbol</code> (required)</li>
</ul>

is being turned into this:

<ul>
  <li>
    <code>children</code>
    {' '}
    —&nbsp;meant to make space for
    {' '}
    <code>StatusSymbol</code>
    {' '}
    (required)
  </li>
</ul>

@karl
Copy link
Collaborator Author

karl commented May 24, 2017

@PiotrF That formatting should be fixed up as part of #1120. With this your example code would be formatted as:

<ul>
  <li>
    <code>children</code> — meant to make space for <code>StatusSymbol</code>
    {" "}
    (required)
  </li>
</ul>

The next release of Prettier will have this fix.

@karl
Copy link
Collaborator Author

karl commented May 31, 2017

☝🏻 I have a PR that should fix the unstable formatting issue.

@karl karl closed this as completed Jun 2, 2017
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 7, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

No branches or pull requests

3 participants