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 ruleP2universalStack: html
htmlsemanticsaccessibility
Choose HTML elements for their semantic meaning, not by habit
Use article/section/etc. only when the content genuinely is that, and justify the choice over a plain div/span; otherwise prefer the neutral element.
PR: hegnar-web · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codehtml
| 1 | <article className="chip">{label}</article> <!-- not an article --> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codehtml
| 1 | <span className="chip">{label}</span> |
Explanation (EN)
Objašnjenje (HR)