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

Spurious {" "} introduced #1072

Closed
houshuang opened this issue Mar 22, 2017 · 7 comments
Closed

Spurious {" "} introduced #1072

houshuang opened this issue Mar 22, 2017 · 7 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. status:needs discussion Issues needing discussion and a decision to be made before action can be taken

Comments

@houshuang
Copy link

Currently, this line (which compiles fine, and does what it's supposed to)

<font size={-3}><i>Starting at minute {graphActivity.startTime}, running for {graphActivity.length} to minute {graphActivity.startTime + graphActivity.length}</i></font>

gets transformed into this:

<font size={-3}>
  <i>
    Starting at minute
    {" "}
    {graphActivity.startTime}
    , running for
    {" "}
    {graphActivity.length}
    {" "}
    to minute
    {" "}
    {graphActivity.startTime + graphActivity.length}
  </i>
</font>;

...which is not what I had expected.

https://prettier.github.io/prettier/#%7B%22content%22%3A%22%3Cfont%20size%3D%7B-3%7D%3E%3Ci%3EStarting%20at%20minute%20%7BgraphActivity.startTime%7D%2C%20running%20for%20%7BgraphActivity.length%7D%20to%20minute%20%7BgraphActivity.startTime%20%2B%20graphActivity.length%7D%3C%2Fi%3E%3C%2Ffont%3E%5Cn%22%2C%22options%22%3A%7B%22printWidth%22%3A80%2C%22tabWidth%22%3A2%2C%22singleQuote%22%3Afalse%2C%22trailingComma%22%3A%22none%22%2C%22bracketSpacing%22%3Atrue%2C%22jsxBracketSameLine%22%3Afalse%2C%22parser%22%3A%22babylon%22%2C%22doc%22%3Afalse%7D%7D

@houshuang
Copy link
Author

houshuang commented Mar 22, 2017

@for some reason, this gets left alone:

<font size={-3}>
  <i>
    Starting at minute {graphActivity.startTime}, running for
    {graphActivity.length} to minute
    {graphActivity.startTime + graphActivity.length}
  </i>
</font>

@yamafaktory
Copy link
Contributor

Hi @houshuang, I guess this is related to this closed issue #1061.

@houshuang
Copy link
Author

Yeah, I realize it makes sense... And why the second example gets "left alone" :) However, it looks horrible, and is definitively not what I expected... Not sure how to fix it. Would prefer to just leave the line alone, but understand that Prettier wants to enforce line-length...

@jlongster
Copy link
Member

I've actually noticed this too. @rattrayalex Do you have any strong opinions about this? Is there any way we could be a little more lenient on this? I don't know what we could do without actually changing semantics, but it's worth talking about.

@rattrayalex
Copy link
Collaborator

Yeah, this has been discussed in a couple other threads... mostly #1021 and #963 (#1061 is actually different).

It'd be nice to merge the conversation before further discussion – @jlongster would you be willing to pick a thread to merge into so we can close the other two issues?

@rattrayalex
Copy link
Collaborator

(tl;dr, I hope we fix this, but we'll probably need to introduce a new primitive)

@vjeux vjeux added the status:needs discussion Issues needing discussion and a decision to be made before action can be taken label Mar 23, 2017
@jlongster
Copy link
Member

Let's merge on #963 as it seems to have the most discussion. Thanks!

@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 8, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 8, 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. status:needs discussion Issues needing discussion and a decision to be made before action can be taken
Projects
None yet
Development

No branches or pull requests

5 participants