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).
backend ruleP2project specificStack: TypeScript
consistencyarchitectureimages
Keep image scaling/CDN-wrapping transforms in one consistent layer
Apply imaginary/resize/CDN-wrap transforms in a single, predictable place (e.g. the repository) rather than sometimes returning raw full-resolution URLs and transforming elsewhere.
PR: hegnar-ws · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | return leadImageAsset.renditions.highRes.uri; // raw 4K, not wrapped/resized |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | return ScaleImage.Instance.getScaledUrl(leadImageAsset.renditions.highRes.uri, { width: 800 }); |
Explanation (EN)
Objašnjenje (HR)