Skip to content

Whitespace and duplicate classes not removed in Liquid files #349

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

Open
ryanleichty opened this issue Feb 28, 2025 · 3 comments
Open

Whitespace and duplicate classes not removed in Liquid files #349

ryanleichty opened this issue Feb 28, 2025 · 3 comments

Comments

@ryanleichty
Copy link

What version of prettier-plugin-tailwindcss are you using?

v0.6.11

What version of Tailwind CSS are you using?

v4.0.9

What version of Node.js are you using?

v22.14.0

What package manager are you using?

npm

What operating system are you using?

macOS

Reproduction URL

A public GitHub repo that includes a minimal reproduction of the bug. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private/confidential, since we want a link to a separate, isolated reproduction anyways. Unfortunately we can't provide support without a reproduction, and your issue will be closed with no comment if this is not provided.

Describe your issue

I'm using @shopify/prettier-plugin-liquid with prettier-plugin-tailwindcss and it's correctly sorting classes, but it's not removing whitespace or duplicate classes.

@fret2buzz
Copy link

I have the same issue.

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

using html parser removes white space and duplicate classes but it breaks liquid tags indentation so it can not be used both at the same time

@fret2buzz
Copy link

        // Whitespace removal is disabled for Liquid
        // due to the way Liquid prints the AST
        // (the length of the output MUST NOT change)

https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/63c22ded61a2b5b9eefe1646e5321b1ae0adde19/tests/plugins.test.ts

Disabled whitespace and duplicate class removal for Liquid and Svelte #276

@ryanleichty
Copy link
Author

Nice, good find! That makes sense

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

No branches or pull requests

2 participants