Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Apply mechanical/codemod refactors uniformly across the change
When a refactor applies the same transformation repeatedly (renaming, prefixing, swapping utilities), convert every occurrence consistently or document why specific ones are intentionally left as-is.
Bad example
| 1 | // Most occurrences prefixed, a few left unprefixed with no explanation |
| 2 | className="zp:relative zp:block focus:outline-none" |
| 3 | className="zp:flex zp:items-center space-x-1" |
Explanation (EN)
A partial mechanical conversion leaves inconsistent behavior when the missed occurrence has the same meaning.
Objašnjenje (HR)
Djelomična mehanička zamjena ostavlja neusklađeno ponašanje kada propuštena pojava ima isto značenje.
Good example
| 1 | // Either convert everything... |
| 2 | className="zp:relative zp:block zp:focus:outline-none" |
| 3 | // ...or leave it out deliberately with a reason |
| 4 | // keep space-x here: this element is not a flex container, gap would not apply |
| 5 | className="zp:flex zp:items-center space-x-1" |
Explanation (EN)
Every token is either consistently transformed or explicitly annotated with the reason it was skipped, removing ambiguity for reviewers.
Objašnjenje (HR)
Svaki token je ili dosljedno transformiran ili eksplicitno oznacen razlogom zasto je preskocen, cime se uklanja dvosmislenost za recenzente.
Notes (EN)
After a mechanical rename or utility conversion, search the whole intended scope for the old pattern and verify each remaining use against its semantics.
Bilješke (HR)
Nakon mehaničkog preimenovanja ili zamjene pomoćne funkcije pretraži cijeli namjeravani opseg i provjeri semantiku svakog preostalog starog obrasca.
Exceptions / Tradeoffs (EN)
Leave unsupported contexts unchanged with review evidence; a comment is needed only if the reason will remain non-obvious. Tailwind prefix syntax depends on the configured version.