I was expecting that when I hit save it will automatically work as expected which is to sort tailwind classes but the plugin only works if run the prettier using npx prettier --write index.html
Things I tried:
I set the format on save to true and set the paths but it didn't resolve the problem.
Go to Settings > Text Editor > Formatting
and select "Format on Save".
EDIT:Also, I found out that if there's invalid html, prettier will spit errors and no formatting will happen. You can check for those errors in the terminal 'CTRL + SHIFT + U'. Probably more of a 'Prettier' thing rather than TailwindCSS thing.
I've had this issue for the past few days and I've managed to solve it after hours of wasted time and I still don't know what precisely fixed it, but here's what I did, hopefully it will help someone else out.
Just note, everything was working normally for me, then it stopped for no apparent reason, in the end I solved it by getting frustrated and I just brute forcing my way out, here's the finals steps I took:
This resulted in a prompt I hadn't had previously which asked me to choose my default formatter
-> Choose 'Prettier'.
One of those things did it, now I'm back in business.