[Prettier Plugin] Incompatible with @ianvs/prettier-plugin-sort-imports
when using prettier.config.js
#11051
Replies: 1 comment 1 reply
-
@chrissantamaria did you ever find a good workaround for this? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
👋 I noticed that, despite being listed as a compatible plugin in the README,
@ianvs/prettier-plugin-sort-imports
is incompatible withprettier-plugin-tailwindcss
. With the Tailwind plugin listed last in theplugins
array (as instructed in the README), it still takes precedence over the sort plugin and effectively disables it.Notably, this only occurs when using a JS-based
prettier.config.js
file (where plugins arerequire
'd) rather than a JSON-based.prettierrc
. I suspect this is due to therequire
changing how plugins are loaded, but I'm not familiar with the internals of either plugin to be sure.Some alternatives I tried:
@trivago/prettier-plugin-sort-imports
instead - this has the same issueprettier-plugin-tailwindcss
v0.2.3, as this was the first version to officially support@ianvs/prettier-plugin-sort-imports
- no luckI've created a minimal reproduction repo to demonstrate my particular setup a bit more clearly.
If this is expected functionality, it may be a good idea to make a note of the differences between
prettier.config.js
and.prettierrc
inprettier-plugin-tailwindcss
's README (especially given that it shows examples using both).Happy to open a GitHub issue if that's easier, though I used a discussion since that was advised before a bug is confirmed. Happy to clarify any details - thanks!
Beta Was this translation helpful? Give feedback.
All reactions