I'm using Quasar with Vue3 and the vs code extension Vetur and Prettier to help me keep the code well formatted.
I see something I don't really like and I would like to fix it in the configuration, but I cannot find the solution, so I hope you can help me.
The current HTML formatter generate this code:
<q-btn
unelevated
color="secondary"
type="submit"
class="full-width"
>Sign in</q-btn
>
I don't really like to see this: >Text</close, instead, I would like it to be like this:
<q-btn
unelevated
color="secondary"
type="submit"
class="full-width"
>
Sign in
</q-btn>
So that the element and the text are on different lines.
Can you please drive me to the solution? Thanks
I believe it is not possible to do what you want because
prettier(or eveneslint,volar) cannot determine whether now or in the future an element will be able to parent another element if you having aNodebut not aTextinside such formatting changes a lot of things:When you enter a newline then
\nwill definitely appear because it isTextso by default it is rendered asNode<Text>which doesn't sound bad but look at the example below:you will find that adding anything in front of it destroys the expected DOM structure. it is so awful
to fix it you can add
spaceafter>of the opening tag becausespaceorspace - new lineit is just 1Node<Text>only nothing is affected