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).
backend ruleP2universalStack: typescript
typescriptconfigtoolingtypes
Declare config keys in the type definition so IDE/type tooling resolves them
Add new configuration fields to the typed config definition (not just the runtime config object) so editors get hints and type checking covers their use.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | // runtime config has dataSources.currency, but config.d.ts doesn't declare it |
| 2 | const { ttl } = config.dataSources.currency; // no type hints |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // config.d.ts |
| 2 | interface Config { dataSources: { currency: ICurrencyConfig } } |
Explanation (EN)
Objašnjenje (HR)