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).
fullstack ruleP1universalStack: any
defaultsconfigurationreusemetadata
Don't overwrite a shared default to serve one specific case
Leave generic/default values (titles, metadata, configs) intact since they apply to many consumers; pass case-specific overrides at the point of use instead of mutating the default.
PR: abcn-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codets
| 1 | // changes the shared default that every page inherits |
| 2 | export const metadata = { |
| 3 | title: 'Section A | Site', |
| 4 | }; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | // keep the generic default |
| 2 | export const metadata = { |
| 3 | title: 'Site | Tagline', |
| 4 | }; |
| 5 | // override per page where needed |
| 6 | export function generateMetadata() { |
| 7 | return { ...defaultMetaTags, title: 'Section A | Site' }; |
| 8 | } |
Explanation (EN)
Objašnjenje (HR)