sveltejs / prettier-plugin-svelte

Format your svelte components using prettier.
MIT License
735 stars 95 forks source link

svelteStrictMode: true adds quotes around attributes for Svelte 5 #454

Closed Tagman closed 1 month ago

Tagman commented 2 months ago

Hi,

If I understood the documentation right. svelteStrictMode: true should format attributes like this <Checkbox bind:checkState={toolbox.expertMode}></Checkbox>.

But running npx prettier --write . adds the quotes back to the attribute.

When I disable the strict mode, the quotes get removed. Is the documentation wrong?

.prettierrc ``` { "trailingComma": "es5", "tabWidth": 4, "arrowParens": "always", "bracketSpacing": true, "endOfLine": "lf", "printWidth": 120, "singleQuote": false, "svelteSortOrder": "options-scripts-markup-styles", "svelteStrictMode": false, "bracketSameLine": true, "svelteAllowShorthand": true, "semi": true, "plugins": ["prettier-plugin-svelte"], "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] } ```
dummdidumm commented 1 month ago

I'm not able to reproduce this. Are you sure you're on the lastest version? If so, please provide a reproduction repository

Tagman commented 1 month ago

Weirdly enough, I also cannot reproduce it anymore. I updated to "svelte": "^5.0.0-next.225". This was the only change.

Thanks for the response, though. I guess this can be closed now. :)