Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP2stack specificStack: Tailwind CSS / Prettier
tailwindprettiertoolingformatting
Configure Tailwind class sorting for custom class-holding attributes
When Tailwind classes move out of `className` into custom props/variables, Prettier no longer sorts them; configure `tailwindAttributes`/regex so sorting keeps working.
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | // classes stored in *Class props are no longer auto-sorted |
| 2 | type HeaderTheme = { backgroundClass: string; loginButtonClass: string }; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejson
| 1 | // prettier config |
| 2 | { "tailwindAttributes": [], "tailwindFunctions": [], "...": "add regex matching props ending in 'Class'" } |
Explanation (EN)
Objašnjenje (HR)