-
-
Notifications
You must be signed in to change notification settings - Fork 71
Closed
Labels
Description
[
prettier-plugin-tailwind] uses Prettier APIs that can only be used by one plugin at a time, making it incompatible with other Prettier plugins implemented the same way. [...] One limitation with this approach is thatprettier-plugin-tailwindcssmust be loaded last.
Currently, sv instead pushes it to the top of the prettier plugin list:
cli/packages/sv/lib/addons/prettier/index.ts
Lines 51 to 60 in 0b25394
| const plugins: string[] = data.plugins; | |
| if (tailwindcssInstalled) { | |
| if (!plugins.includes('prettier-plugin-tailwindcss')) { | |
| data.plugins.unshift('prettier-plugin-tailwindcss'); | |
| } | |
| data.tailwindStylesheet ??= files.getRelative({ to: files.stylesheet }); | |
| } | |
| if (!plugins.includes('prettier-plugin-svelte')) { | |
| data.plugins.push('prettier-plugin-svelte'); | |
| } |
At minimum, it should definitely come after prettier-plugin-svelte, as it's one of the plugins called out in the plugin README, and currently prevents prettier-plugin-tailwind from sorting class names.