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 ruleP2universalStack: universal
namingreadabilityconsistency
Name functions, hooks, and types by what they actually do
Pick names that describe behaviour (e.g. useFrontpageData, fetchParameters) rather than vague or misleading words; keep casing of a concept consistent across the codebase.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codets
| 1 | // fetches frontpage data, but named 'navigation' |
| 2 | const useFrontPageNavigation = () => { /* fetching logic */ }; |
| 3 | // param holds dependencies that changed |
| 4 | function fetchThreads({ paramChanged }) {} |
| 5 | // FrontPage vs Frontpage used inconsistently across files |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | const useFrontpageData = () => { /* fetching logic */ }; |
| 2 | function fetchThreads({ fetchParameters }) {} |
| 3 | // pick one casing (Frontpage) and use it everywhere |
Explanation (EN)
Objašnjenje (HR)