You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 screwed
This does not happen in .js files, and wrapping in square brackets works as intended (Shift + [)
This 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
The text was updated successfully, but these errors were encountered:
laszlo1337
changed the title
Prettier breaks file when wrapping text in curly braces [WebStorm]
Prettier breaks file when wrapping variables in curly braces [WebStorm]
Oct 15, 2023
Closing as duplicate of #233 and #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
The text was updated successfully, but these errors were encountered: