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
typescripttsconfigmodule-resolution
Prefer explicit path mappings over a catch-all wildcard
List each alias explicitly in tsconfig paths instead of a single `*` mapping; it avoids resolver overhead and keeps the set of aliases visible.
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codejson
| 1 | { |
| 2 | "compilerOptions": { |
| 3 | "paths": { "*": ["./*"] } |
| 4 | } |
| 5 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejson
| 1 | { |
| 2 | "compilerOptions": { |
| 3 | "paths": { |
| 4 | "components/*": ["./components/*"], |
| 5 | "utils/*": ["./utils/*"] |
| 6 | } |
| 7 | } |
| 8 | } |
Explanation (EN)
Objašnjenje (HR)