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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 BUG: prettier-plugin-tailwindcss doesn't work in .astro files #202

Closed
inwardmovement opened this issue May 28, 2022 · 10 comments
Closed
Labels
ecosystem: compiler Issue is caused by a bug in the Astro compiler

Comments

@inwardmovement
Copy link

inwardmovement commented May 28, 2022

Describe the Bug

prettier-plugin-tailwindcss doesn't work in .astro files.

Steps to Reproduce

  1. In an Astro project, run npm i -D prettier prettier-plugin-astro prettier-plugin-tailwindcss.
  2. Add Tailwind classes and save: classes are not reordered according to the recommended class order.
@christian-hackyourshack

I am not sure, but it might be, that we are running into the same problem as the svelte plugin. This is a known issue with the tailwind plugin (or actually with the prettier architecture): tailwindlabs/prettier-plugin-tailwindcss#31

@Princesseuh Princesseuh added the ecosystem: compiler Issue is caused by a bug in the Astro compiler label Jun 24, 2022
@Princesseuh
Copy link
Member

Princesseuh commented Aug 8, 2022

Hey, I made a PR to their plugin to get this working: tailwindlabs/prettier-plugin-tailwindcss#87

Hope we can get it merged!

EDIT: PR got merged and it should be available in the coming days

@Princesseuh
Copy link
Member

Update on this, the main branch of the Tailwind plugin support Astro nicely, however the Tailwind team would like to find a more consistent way to support different frameworks before releasing. As such, the release of it will be delayed

More information here tailwindlabs/prettier-plugin-tailwindcss#87 (comment)

@fandy
Copy link

fandy commented Aug 25, 2022

This is sweet @Princesseuh! Can you post an update when the release is deployed?

@Princesseuh
Copy link
Member

This is sweet @Princesseuh! Can you post an update when the release is deployed?

Yep, no worries! I'll post a message here and close this issue when they'll release it. You can also follow their PR here: tailwindlabs/prettier-plugin-tailwindcss#90

@Princesseuh
Copy link
Member

Hi everyone, we are still waiting on the Tailwind team. Adam recently posted an answer saying they would take a look in early November

Hope we can get this working soon 馃

@Temez1
Copy link

Temez1 commented Nov 22, 2022

There's a beta version that can be used for now :) See the comment

@Princesseuh
Copy link
Member

Tailwind has officially released a version of their plugin with Astro support. Make sure to follow this section on compatibility and everything should work!

Please note that there's currently an issue in our VS Code extension that prevents plugins from being loaded correctly, it'll be fixed by withastro/language-tools#454 shortly.

Thank you everyone!

@limisc
Copy link

limisc commented Jul 27, 2023

It doesn't work with
"prettier": "3.0.0",
"prettier-plugin-astro": "^0.11.0",
"prettier-plugin-tailwindcss": "^0.4.1",

@Princesseuh
Copy link
Member

It doesn't work with
"prettier": "3.0.0",
"prettier-plugin-astro": "^0.11.0",
"prettier-plugin-tailwindcss": "^0.4.1",

tailwindlabs/prettier-plugin-tailwindcss#186 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ecosystem: compiler Issue is caused by a bug in the Astro compiler
Projects
None yet
Development

No branches or pull requests

6 participants