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 ruleP2stack specificStack: typescript
typescriptdeclaration-filesnaming
Name .d.ts files after what they declare, not a bare module name
A file like window.d.ts implies `declare module 'window'`; name ambient declaration files to reflect their actual purpose/location.
PR: hegnar-web · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | // src/@types/window.d.ts (looks like declare module 'window') |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // src/typings/window.d.ts -> interface Window { accessLevel: string } |
Explanation (EN)
Objašnjenje (HR)