The plugin isn't sorting the classes when I hit save but it works when npx prettier --write index.html #10717
-
What version of prettier-plugin-tailwindcss are you using? 0.2.4 What version of Tailwind CSS are you using? 3.2.7 What version of Node.js are you using? v18.13.0 What package manager are you using? NPM What operating system are you using? Ubuntu Describe your issue I just realized that I didn't set the "prettier.prettierPath" option in my VS Code settings to the path of the Prettier binary installed in my project's node_modules folder. I tried this path but still the plugin is not working as expected when i hit save. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 28 replies
-
Beta Was this translation helpful? Give feedback.
-
TAILWIND FUCKING PIGS, I HAVE THE SAME PROBLEM, NO CLASS SORTING!!!! DO NORMAL INSCRUCTION PIDORASЫ ЕБУЧИЕ |
Beta Was this translation helpful? Give feedback.
-
use other version and it's work for me with npm install [email protected] [email protected] and restard VS Code |
Beta Was this translation helpful? Give feedback.
-
dont know what the heck with my tailwind sorting plugin, after trying to install older version, remove all the prettier configuration file, remove all plugin in my tailwind.config.js file, it actually works . I use prettier 2.7.1 and tailwind prettier 0.1.13 |
Beta Was this translation helpful? Give feedback.
-
I found the solution. first of all you remove all your theme config, and then add 'prettier-plugin-tailwindcss' to plugins, restart vscode and add the theme config again :) |
Beta Was this translation helpful? Give feedback.
-
In case you are using other plugins as well, try changing the order of them, for example: This doesn't work: {
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-organize-imports"]
} This works: {
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-tailwindcss"]
} |
Beta Was this translation helpful? Give feedback.
-
Wow, and I've been wondering what I broke... |
Beta Was this translation helpful? Give feedback.
-
I had the same issue, with classes not being sorted. But The solution was to add Prettier as the default formatter in VSCode, specifically for HTML files. "editor.defaultFormatter": "esbenp.prettier-vscode",
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}, I have no explanation as to why this works, but I wasted an hour trying to figure this out. Hope this helps. |
Beta Was this translation helpful? Give feedback.
It's not Tailwind's fault, Prettier updated. You need a
.prettierrc
.