Closed laszlo1337 closed 8 months ago
Closing as duplicate of https://github.com/sveltejs/prettier-plugin-svelte/issues/233 and https://github.com/sveltejs/prettier-plugin-svelte/issues/242 TLDR: prettier does not support plugin like prettier-plugin-svelte to partake in the "format range" option properly, and so when your editor does auto-format on code action, it will likely invoke prettier with the range option, resulting in the given gibberish.
Prettier 3.0.3
In WebStorm, when editing .svelte files, when trying to wrap text in {} by selecting the text and pressing shift + { prettier breaks completely. Steps:
Create example component
Select text that needs to be wrapped in {}
Press
Shift + {
and experience the file getting screwedThis does not happen in .js files, and wrapping in square brackets works as intended (
Shift + [
)prettierrc
fileThis happens also when committing with "Reformat code" and "Optimize imports" checkboxes checked. The code was committed in a broken state.
Expected behavior: Should format the component without breaking