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 ruleP2universalStack: TypeScript
api-designsimplicityreadability
Pass a couple of related primitives as parameters, not wrapped in a throwaway object
If a method takes two scalar values that are immediately destructured, accept them as plain parameters instead of wrapping them in an object only to unwrap it inside.
PR: hegnar-ws · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | async getArticleBoxArticles(data: { streamId: string; streamTopId?: string }) { |
| 2 | const { streamId, streamTopId } = data; |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | async getArticleBoxArticles(streamId: string, streamTopId?: string) { ... } |
Explanation (EN)
Objašnjenje (HR)