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 ruleP1stack specificStack: Sequelize
typesdatabasegenerics
Provide the generic type on raw/select query calls
Pass the expected row shape as a generic to raw query/select methods so the result is typed instead of any/unknown.
PR: vinify-backend · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | const rows = await this.db.select(query); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | const rows = await this.db.select<{ profileId: number }>(query); |
Explanation (EN)
Objašnjenje (HR)