eslint-plugin-tailwindcss: [BUG] Prettier class order don't match with eslint-plugin-tailwindcss
Describe the bug With the prettier and eslint plugin installed in some cases the class order don’t match.
To Reproduce
Steps to reproduce the behavior:
In a div element add the classes top-0 left-0
prettier will not change the class orders but there will be an eslint error
applying eslint fix will satisfy both eslint and prettier plugin the class names should now be left-0 top-0
Expected behavior when I format with prettier, this error should go away
Screenshots
If applicable, add screenshots to help explain your problem.
With prettier formating:

With eslint fix applied (prettier is ok as well with this one):

About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 8
- Comments: 18 (3 by maintainers)
There is no need for a Prettier plugin if this ESLint plugin is installed. But if you still want to use both, you can disable a ESLint rule that sorts class names:
Note that what
prettier-plugin-tailwindcssdoes is outside the scope of Prettier:Here it conflicts both ways, brandPrimary is a custom color
prettier
outline-brandPrimary p-2eslint-config-tailwindcss
p-2 outline-brandPrimaryI’ll look if i can find an example with no custom themes
+1 conflicting
mx-2 flexvsflex mx-2