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
typescriptdeclarationsconventionsorganization
Follow one consistent convention for type declaration files
When a project keeps one ambient type per file, keep adding new ones the same way (e.g. svg.d.ts) rather than dumping unrelated types into a catch-all file.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | // custom.d.ts |
| 2 | declare module '*.svg' { /* ... */ } |
| 3 | declare module '*.scss' { /* ... */ } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // svg.d.ts |
| 2 | declare module '*.svg' { /* ... */ } |
| 3 | // style.d.ts |
| 4 | declare module '*.scss' { /* ... */ } |
Explanation (EN)
Objašnjenje (HR)