Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot sort class in .liquid file when passing "functions" #141

Closed
andershagbard opened this issue Mar 30, 2023 · 2 comments · Fixed by #143
Closed

Cannot sort class in .liquid file when passing "functions" #141

andershagbard opened this issue Mar 30, 2023 · 2 comments · Fixed by #143
Assignees

Comments

@andershagbard
Copy link

andershagbard commented Mar 30, 2023

Config:

{
  "plugins": ["@shopify/prettier-plugin-liquid", "prettier-plugin-tailwindcss"]
}

Input:

<div class="flex bg-green-500 px-2 gap-10 py-10 pb-14 -mx-10 {{ foo }}"></div>
<div class="flex bg-green-500 px-2 gap-10 py-10 pb-14 -mx-10 {% render 'foo' %}"></div>
<div class="flex bg-green-500 px-2 gap-10 py-10 pb-14 -mx-10 {% render 'foo', bar: true %}"></div>
<div class="flex bg-green-500 px-2 gap-10 py-10 pb-14 -mx-10 {% include 'foo' %}"></div>
<div class="flex bg-green-500 px-2 gap-10 py-10 pb-14 -mx-10 {% include 'foo', bar: true %}"></div>

Expected output:

<div class="-mx-10 flex gap-10 bg-green-500 px-2 py-10 pb-14  {{ foo }}"></div>
<div class="-mx-10 flex gap-10 bg-green-500 px-2 py-10 pb-14  {% render 'foo' %}"></div>
<div class="-mx-10 flex gap-10 bg-green-500 px-2 py-10 pb-14  {% render 'foo', bar: true %}"></div>
<div class="-mx-10 flex gap-10 bg-green-500 px-2 py-10 pb-14  {% include 'foo' %}"></div>
<div class="-mx-10 flex gap-10 bg-green-500 px-2 py-10 pb-14  {% include 'foo', bar: true %}"></div>

Actual output:

<div class="-mx-10 flex gap-10 bg-green-500 px-2 py-10 pb-14 {{ foo }}"></div>
<div class="flex bg-green-500 px-2 gap-10 py-10 pb-14 -mx-10 {% render 'foo' %}"></div>
<div class="flex bg-green-500 px-2 gap-10 py-10 pb-14 -mx-10 {% render 'foo', bar: true %}"></div>
<div class="flex bg-green-500 px-2 gap-10 py-10 pb-14 -mx-10 {% include 'foo' %}"></div>
<div class="flex bg-green-500 px-2 gap-10 py-10 pb-14 -mx-10 {% include 'foo', bar: true %}"></div>
@thecrypticace
Copy link
Contributor

Hey, thanks for reporting this. I've merged a fix for this in #143 and will be in the next release (will be soon).

You can try it out before we do a release by using our insiders build: npm install prettier-plugin-tailwindcss@insiders

@andershagbard
Copy link
Author

Thanks for the fast fixes. Very appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants