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
service-layerapireadabilityfunctions
Prefer a single explicit method over a function that returns a function
Avoid curried/partial-application service methods when one method with clear parameters is simpler to read and call.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codets
| 1 | const getTickerThreads = (tickerName: string) => |
| 2 | async (page: number, size: number) => fetchThreads(tickerName, page, size); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | const getTickerThreads = async (tickerName: string, page: number, size: number) => |
| 2 | fetchThreads(tickerName, page, size); |
Explanation (EN)
Objašnjenje (HR)