Closed rChaoz closed 1 month ago
With attributes such as 'class' this works fine:
<!-- stays the same after formatting --> <Component class="my-class {condition ? 'a' : 'b'}" />
But it fails with directives, such as:
<Component style:transform="translateX({condition ? '10%' : '20%'})" />
gets formatted to
<Component style:transform="translateX({condition ? "10%" : "20%"})" />
which breaks the code because of the quotes.
Use raw strings instead, which are kept as-is:
<Component style:transform="translateX({condition ? `10%` : `20%`})" />
With attributes such as 'class' this works fine:
But it fails with directives, such as:
gets formatted to
which breaks the code because of the quotes.
Workaround
Use raw strings instead, which are kept as-is: