Rules Hub
Coding Rules Library
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Use one consistent name per concept, matching the source domain
Don't invent synonyms for an existing concept; reuse the terminology the upstream API/domain already uses.
Bad example
| 1 | // API returns objects it calls "components" |
| 2 | function bumpTemplateVersions(templates) { |
| 3 | return templates.map(template => updateTemplate(template)); |
| 4 | } |
| 5 | // elsewhere the same thing is called "component" — two names, one concept |
Explanation (EN)
Calling the same entity both "template" and "component" forces readers to constantly map between two names for one thing, and drifts from the source-of-truth API vocabulary.
Objašnjenje (HR)
Nazivanje istog entiteta i "template" i "component" tjera citatelja da stalno mapira dva naziva za jednu stvar i udaljava se od vokabulara izvornog API-ja.
Good example
| 1 | // API returns objects it calls "components" — use that name everywhere |
| 2 | function bumpComponentVersions(components) { |
| 3 | return components.map(component => updateComponent(component)); |
| 4 | } |
Explanation (EN)
Adopt the domain/API's own term consistently across files, functions, and variables so there's exactly one name per concept.
Objašnjenje (HR)
Dosljedno preuzmi pojam iz domene/API-ja kroz datoteke, funkcije i varijable tako da postoji tocno jedan naziv po konceptu.
Notes (EN)
Ubiquitous language: rename files, variables, and identifiers together when you align on a term.
Bilješke (HR)
Ujednaceni jezik: kad uskladis pojam, preimenuj zajedno datoteke, varijable i identifikatore.