tailwindlabs/prettier-plugin-tailwindcss

Inconsistent formatting results when ran per file/per project

Closed this issue · 2 comments

The problem

I'm using WebStorm with the "run prettier on save" option. Now, I'm not exactly sure how it runs prettier, but the result differs from running prettier --write <path>. More specifically, my custom variants are sorted first when saving the file, and sorted last when running the command manually. This is a problem because the CI fails when I use the IDE formatting, so I need to format on every commit manually.

It doesn't call the CLI script, so I'm guessing it calls the format API directly, and it ends up not loading the tailwind.config.ts file like it should, but this is just my guess.

Versions and stuff

What version of prettier-plugin-tailwindcss are you using? v0.5.14

What version of Tailwind CSS are you using? v3.4.1

What version of Node.js are you using? 20.8.0

What package manager are you using? yarn 4.1.1

What operating system are you using? Windows

Duplicate of #270

Closing in favor of #270 — if you can provide an example project that would be fantastic.