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

Prettier adds unwanted line breaks inserted between TextNodes and MustacheStatements #54

Closed
GavinJoyce opened this issue Jun 6, 2019 · 6 comments

Comments

@GavinJoyce
Copy link
Collaborator

see prettier/prettier#6184

Input:

<p>You username is @{{name}}</p>
<p>Hi {{firstName}} {{lastName}}</p>

Output:

<p>
  You username is @
  {{name}}
</p>
<p>
  Hi
  {{firstName}}
  {{lastName}}
</p>

Expected behavior:

I think this is the desired output:

<p>
  You username is @{{name}}
</p>
<p>
  Hi {{firstName}} {{lastName}}
</p>
@rwjblue
Copy link
Member

rwjblue commented Jun 6, 2019

I agree with your expected output. This issue is for tracking the prettier fix, right?

@GavinJoyce
Copy link
Collaborator Author

Yes, I'm working on a fix there. I opened an issue here mostly for discoverability

@mfeckie
Copy link

mfeckie commented Jun 13, 2019

In a similar vein, prettier also does some breaking things to nested if/else scenarios. prettier/prettier#5340 (comment)

Would be nice to be able to skip prettier in the codemod and leave to the user to reformat as necessary / desired

@GavinJoyce
Copy link
Collaborator Author

For speed and so that I can experiment easily, I'm working on a fork of prettier here which I'm running in conjunction with this codemod over Intercom's codebase:

GavinJoyce/prettier#1

I'm hoping that this will enable me to:

  • Quickly and incrementally codemod our large codebase to angle bracket invocation
  • Merge most of the changes back into prettier

@lolmaus
Copy link
Contributor

lolmaus commented Jul 29, 2019

More cases of this bug are described in #95 (duplicate of subj).

@Turbo87
Copy link
Collaborator

Turbo87 commented Oct 1, 2019

resolved by #97

@Turbo87 Turbo87 closed this as completed Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants