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

--svelte-bracket-new-line true not working correctly (e.g. button and span) #194

Closed
AllanChain opened this issue Jan 16, 2021 · 0 comments · Fixed by #195
Closed

--svelte-bracket-new-line true not working correctly (e.g. button and span) #194

AllanChain opened this issue Jan 16, 2021 · 0 comments · Fixed by #195

Comments

@AllanChain
Copy link

src/test.svelte:

<button class="bg-green-500  text-gray-100 hover:bg-green-400 flex items-center px-4 py-2 border border-l-0 rounded-r"> Copy </button>
<div class="bg-green-500  text-gray-100 hover:bg-green-400 flex items-center px-4 py-2 border border-l-0 rounded-r"> Copy </div>
<span class="bg-green-500  text-gray-100 hover:bg-green-400 flex items-center px-4 py-2 border border-l-0 rounded-r"> Copy </span>
<p class="bg-green-500  text-gray-100 hover:bg-green-400 flex items-center px-4 py-2 border border-l-0 rounded-r"> Copy </p>
yarn prettier --plugin-search-dir=. src/test.svelte --svelte-bracket-new-line false (works fine):
<button
  class="bg-green-500  text-gray-100 hover:bg-green-400 flex items-center px-4 py-2 border border-l-0 rounded-r">
  Copy
</button>
<div
  class="bg-green-500  text-gray-100 hover:bg-green-400 flex items-center px-4 py-2 border border-l-0 rounded-r">
  Copy
</div>
<span
  class="bg-green-500  text-gray-100 hover:bg-green-400 flex items-center px-4 py-2 border border-l-0 rounded-r">
  Copy
</span>
<p
  class="bg-green-500  text-gray-100 hover:bg-green-400 flex items-center px-4 py-2 border border-l-0 rounded-r">
  Copy
</p>

yarn prettier --plugin-search-dir=. src/test.svelte --svelte-bracket-new-line true (some are on same line):

<button
  class="bg-green-500  text-gray-100 hover:bg-green-400 flex items-center px-4 py-2 border border-l-0 rounded-r">
  Copy
</button>
<div
  class="bg-green-500  text-gray-100 hover:bg-green-400 flex items-center px-4 py-2 border border-l-0 rounded-r"
>Copy</div>
<span
  class="bg-green-500  text-gray-100 hover:bg-green-400 flex items-center px-4 py-2 border border-l-0 rounded-r">
  Copy
</span>
<p
  class="bg-green-500  text-gray-100 hover:bg-green-400 flex items-center px-4 py-2 border border-l-0 rounded-r"
>Copy</p>

Version:

  • prettier-plugin-svelte@2.1.0
  • prettier@2.2.1

Config: official template without config

dummdidumm pushed a commit to dummdidumm/prettier-plugin-svelte that referenced this issue Jan 17, 2021
sveltejs#194
- Don't group body so start and end both break at the same time if they must
- Fix "should hug start?" logic in opening tag attributes
dummdidumm added a commit that referenced this issue Jan 17, 2021
Fixes #194
- Don't group body so start and end both break at the same time if they must
- Fix "should hug start?" logic in opening tag attributes
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

Successfully merging a pull request may close this issue.

1 participant