rustywind
rustywind copied to clipboard
Conditional operator in class wrongly formatted
Input: (Vue Html Syntax)
:class="
activeTab
? ' bg-opacity-30 bg-blue-300 rounded text-blue-500 font-medium'
: 'hover:bg-gray-200 bg-gray-100 font-normal text-gray-700 hover:text-gray-900'
"
After I run rusty --write .
Output:
:class="? activeTab'bg-opacity-30 bg-blue-300 rounded text-blue-500 font-medium'
: 'hover:bg-gray-200 bg-gray-100 font-normal text-gray-700 hover:text-gray-900'
"
I have two more examples to add:
input:
x-bind:class="open ? 'rotate-180' : ''" role="decoration">
output:
x-bind:class="open ?'rotate-180' : ''" role="decoration">
input:
:class="submenu == 'hours' ? 'sr-only'">
output:
:class="submenu =='hours' ? 'sr-only'">
(note the lack of space between ==
and '