Astro extension doesn't use `prettier-plugin-tailwindcss` when formatting
Ran into a weird issue when setting up automatic Tailwind class sorting inside a pnpm-based Astro project. I tried to resolve it, but I was unable to find a solution myself; could anyone point me in the right direction, please
I have
I am using
And formatting with Prettier CLI works:
However, when I format the code inside VSCode using the Astro extension, it only pretty prints the code, but doesn't sort Tailwind classes. I can't use the Prettier extension as a formatter, because
Is this a configuration problem, or is it an issue with the Astro extension?
I have
prettier and prettier-plugin-tailwindcss installed as devDependencies:I am using
prettier-plugin-{astro,tailwindcss} inside my prettier.config.cjs, configured as the docs (https://github.com/tailwindlabs/prettier-plugin-tailwindcss#compatibility-with-other-prettier-plugins) say:And formatting with Prettier CLI works:
However, when I format the code inside VSCode using the Astro extension, it only pretty prints the code, but doesn't sort Tailwind classes. I can't use the Prettier extension as a formatter, because
it cannot format 'Astro'-files. This is a big annoyance, since I'm used to classes auto sorting on save, so it's painful having to run prettier in a terminal.Is this a configuration problem, or is it an issue with the Astro extension?
GitHub
A Prettier plugin for Tailwind CSS that automatically sorts classes based on our recommended class order. - GitHub - tailwindlabs/prettier-plugin-tailwindcss: A Prettier plugin for Tailwind CSS tha...
