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 ruleP1universalStack: typescript
abstractiondead-codereadabilityindirection
Don't create a wrapper function that only forwards to another
A function that just calls another with the same arguments and no extra logic adds indirection without value; call the underlying method directly.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codets
| 1 | export const getForumId = async (session: string): Promise<number | null> => |
| 2 | UserService.getUserIdentity(session); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | // call the underlying method directly where needed |
| 2 | const userId = await UserService.getUserIdentity(session); |
Explanation (EN)
Objašnjenje (HR)