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 ruleP2project specificStack: typescript
organizationmock-dataconfigconstants
Move mock and static data into config files
Keep mock datasets, placeholder images, and static lists in dedicated config/.mock files rather than embedding them in components or interface files.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetypescript
| 1 | // interfaces/Instruments.service.ts |
| 2 | const image = 'data:image/png;base64,iVBOR...'; |
| 3 | const mockedData: InstrumentTableRow[] = [ /* ... */ ]; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // config/instrumentTableRows.mock.ts |
| 2 | import image from 'config/placeholderImage'; |
| 3 | export const instrumentTableRows: InstrumentTableRow[] = [ /* ... */ ]; |
Explanation (EN)
Objašnjenje (HR)