You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apply website .prettierrc_ by removing underscore.
Try to format the file, see rotate-360 is still sorted.
Describe your issue
Plugin does not sort new classes (rotate-360, h-54.5, ...) in a monorepo setup, where tailwindcss is installed in separate packages, but there is only one .prettierrc in the monorepo root.
As i see from the code, the plugin tries to import tailwindcss package from the base dir (where the prettier config is located):
but it fails (since there is no tailwindcss package in the root) and falls back to the v3 mode.
This can be fixed by recursively resolving tailwindcss in each package from the input file path to the baseDir, or at least the current behavior could be documented.
I can open PR with the fixes, if you are welcome.
The text was updated successfully, but these errors were encountered:
What version of
prettier-plugin-tailwindcss
are you using?v0.6.9
What version of Tailwind CSS are you using?
v4.0.0-beta.9
What version of Node.js are you using?
v23.1.0
What package manager are you using?
pnpm v9.12.3
What operating system are you using?
macOS Version 15.1.1 (24B91)
Reproduction URL
https://github.com/adjsky/tailwind-prettier-monorepo-bug
rotate-360
is not sorted.pnpm add -w [email protected]
.rotate-360
is sorted.package.json
..prettierrc_
by removing underscore.rotate-360
is still sorted.Describe your issue
Plugin does not sort new classes (
rotate-360
,h-54.5
, ...) in a monorepo setup, wheretailwindcss
is installed in separate packages, but there is only one.prettierrc
in the monorepo root.As i see from the code, the plugin tries to import
tailwindcss
package from the base dir (where the prettier config is located):prettier-plugin-tailwindcss/src/config.ts
Line 200 in 9481dd0
but it fails (since there is no
tailwindcss
package in the root) and falls back to the v3 mode.This can be fixed by recursively resolving
tailwindcss
in each package from the input file path to thebaseDir
, or at least the current behavior could be documented.I can open PR with the fixes, if you are welcome.
The text was updated successfully, but these errors were encountered: