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: html
htmlperformanceresource-hintspremature-optimization
Only use resource hints on the tags they actually affect
Attributes like `fetchpriority` are ignored on `preconnect` links; apply them only to tags that honor them (e.g. preload/scripts), and don't pre-optimize without evidence it helps.
PR: hegnar-bellsheep-web · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codehtml
| 1 | <link rel="preconnect" href="https://cdn.example.com" crossorigin fetchpriority="high" /> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codehtml
| 1 | <link rel="preconnect" href="https://cdn.example.com" crossorigin /> |
| 2 | <!-- use fetchpriority on preload/script tags where it has effect --> |
Explanation (EN)
Objašnjenje (HR)