Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Exclude test files from Tailwind content scanning
Add a negated test-file glob to Tailwind's content config so class names appearing only in tests are not scanned into the build.
Bad example
| 1 | content: ['./src/**/*.{ts,tsx}'] |
Explanation (EN)
Test-only class literals can add unused utilities to a production bundle.
Objašnjenje (HR)
Good example
| 1 | content: ['./src/**/*.{ts,tsx}', '!**/*.test.{ts,tsx}'] |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
When production class discovery includes test-only files, exclude them using the installed Tailwind version's source configuration after verifying no runtime fixtures depend on them.
Exceptions / Tradeoffs (EN)
Storybook/component-test builds may intentionally scan those fixtures. Tailwind v4 source configuration differs from v3 content globs; verify generated CSS.