Skip to content

Vue: Fix ugly formatting for one line template in SFC#8325

Merged
sosukesuzuki merged 3 commits intoprettier:masterfrom
sosukesuzuki:8151
May 18, 2020
Merged

Vue: Fix ugly formatting for one line template in SFC#8325
sosukesuzuki merged 3 commits intoprettier:masterfrom
sosukesuzuki:8151

Conversation

@sosukesuzuki
Copy link
Copy Markdown
Contributor

@sosukesuzuki sosukesuzuki commented May 16, 2020

Fixes #8151

  • I’ve added tests to confirm my change works.
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/pr-XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@fisker
Copy link
Copy Markdown
Member

fisker commented May 17, 2020

Do you guys think this related? Should we treat every root block as block? Or just wrong solution in #8280 ?

Prettier pr-8325
Playground link

--parser vue

Input:

<docs lang=unknown></docs><docs lang=unknown></docs>

Output:

<docs lang="unknown"></docs>><docs lang="unknown"></docs>

@thorn0
Copy link
Copy Markdown
Member

thorn0 commented May 17, 2020

Should we treat every root block as block?

Sounds like the right thing to do for SFCs.

Or just wrong solution in #8280

Treating root elements as blocks would solve that, right?

@sosukesuzuki sosukesuzuki requested a review from fisker May 18, 2020 09:23
@sosukesuzuki sosukesuzuki merged commit 34bfaf8 into prettier:master May 18, 2020
@sosukesuzuki sosukesuzuki deleted the 8151 branch May 18, 2020 09:50
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vue: ugly formatting for one line template in Vue SFC

3 participants