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

[bug]: @component documentation sorted with style tag #410

Open
brittneypostma opened this issue Nov 21, 2023 · 2 comments
Open

[bug]: @component documentation sorted with style tag #410

brittneypostma opened this issue Nov 21, 2023 · 2 comments

Comments

@brittneypostma
Copy link

I am assuming this is a bug. When using @component to write component documentation in a Svelte file, prettier plugin Svelte thinks it belongs with the style block. When updating the svelteSortOrder it will continue to move around with the style block.

Here is a minimal Stackblitz reproduction showing some documentation in the Counter component. I have the sort order updated from the default and ran format. You can continue to change the sort order and rerun format to see the bug in action.

@dummdidumm
Copy link
Member

dummdidumm commented Nov 22, 2023

Where was the comment originally? If I put it atop the script tag it isn't moved elsewhere.
In general

  • the comment above a script/style tag is treated as belonging to that tag, so when you change the sort order, it moves with it
  • the @component comment block isn't treated in any way special, so it will stay above style/script or inbetween html, depending on where you put it

@dummdidumm
Copy link
Member

I cannot reproduce this. Can you give detailed reproduction steps along with the reproduction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants