-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[Vue][Bug] Long v-if condition break the code after reformat #5561
Copy link
Copy link
Closed
Labels
lang:vueIssues affecting VueIssues affecting Vuelocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!scope:externalThis is not an issue with Prettier, it’s an issue with external software, like an editor integrationThis is not an issue with Prettier, it’s an issue with external software, like an editor integration
Metadata
Metadata
Assignees
Labels
lang:vueIssues affecting VueIssues affecting Vuelocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!scope:externalThis is not an issue with Prettier, it’s an issue with external software, like an editor integrationThis is not an issue with Prettier, it’s an issue with external software, like an editor integration
Prettier 1.15.2
Vue 2.5.17
Playground link
# Options (if any): --parser vueInput:
A
v-ifis used on atemplateelement which is also declared as aslot.Output:
In this particular case (usage on template element which is a slot renderer), the resulting code will break.
Expected behavior:
The code must be encapsulated in parenthesis to properly work. (And indentation may be better imho.)