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-vscode's readme is confusing because it is incomplete and/or outdated, Edit: actually the entire prettier setup is confusing #2234
Comments
just wondering, why cant we do a setup where the og prettier plugin deals with svelte files? why does this need to be in svelte-vscode? because the user might be overwhelmed installing two extensions? |
I will explain the general problem to you, and you can ask about the details of the part you don't understand. Then, we can discuss what part of the documentation we can improve. First, Neither the prettier VSCode extension nor the prettier npm package supports Svelte. You must install The prettier status bar is provided by the prettier extension, over which we have no control. It'll have the forbidden icon when you haven't set it up. The Svelte extension is "meant to" provide formatting out of the box. Of course, there are cases where it can't. It bundles a version of What makes the problem more complex is the recent prettier v3 breaking changes. The plugin system is incompatible with v2 and v3. So there are cases where you'll need to manually install the And to answer your questions:
It's needed because some people make the default formatter for everything, which, of course, sometimes doesn't work.
Yes, you can. It's just way more complex than just installing the prettier VSCode extension. |
you must have in your
.prettier.rc
:(this is stated in prettier-plugin-svelte readme but latter is not the one you see when installing the extension and also there they ask to put the plugins line which is also not needed)
what the svelte-vscode readme states: adjust your VS Code settings:
is not needed and doesn't help without the .prettier.rc additions above
and most important: since prettier isn't formatting your .svelte files but this plugin does, do not be confused by this:
THIS IS NORMAL for svelte files yeah super confusing ux but yeah, i still find the reasoning more than confusing, so prettier does not deal with your svelte file directly but behind the curtains it does (just not as the prettier extension 39.4 million users have installed)
since this readme is also used in the store and it's the first thing you see once you install it, i find that the current version should be updated because i wasted one hour to get this working. in contrast most lang-tools for other langs just work in vs code after one click
but that's your call, i can do the pr if time is short on your side
Reproduction
n.a.
Expected behaviour
n.a.
System Info
n.a.
Which package is the issue about?
svelte-vscode
Additional Information, eg. Screenshots
No response
The text was updated successfully, but these errors were encountered: