-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
{name}
attributes get formatted to name="name"
#474
Comments
Obviously (if anyone has this problem), the current workaround would just be to make sure that the {
...,
"svelteAllowShorthand": true,
...
} |
This is a problem with the prettier plugin which is tracked here sveltejs/prettier-plugin-svelte#110 |
Ah interesting. Thank you for the info. I feel like as many developers as possible should be aware of this bug. |
This should be fixed with the latest |
This issue was about a specific shorthand bug, not not being able to use shorthands in general. Did you turn on svelteStrictMode? If so that's the answer. Else I suggest to open a separate issue over at the prettier plugin svelte repo. |
@dummdidumm yes that was what was causing the issue: Now it works fine! Also sorry for mentioning this up on the wrong issue. |
Describe the bug
When formatting on save in VS Code, the
svelte.svelte-vscode
extension formats{name}
attributes incorrectly when.prettierrc
'ssvelteAllowShorthand
is false.To Reproduce
Steps to reproduce the behavior:
1. Set the prettier configuration to the following:
2. Configure the VS Code settings like so:
3. Use
{name}
attribute somewhere in your code like so...Expected behavior
When shorthand is not allowed,
{name}
attributes, like in<Router {routes} />
, are not allowed because it is considered shorthand. This has to be formatted in a non-shorthand manner, such as<Router routes={routes} />
, but instead formats to<Routes routes="routes" />
which is not the intention of the developer whatsoever.System (please complete the following information):
The text was updated successfully, but these errors were encountered: