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: node
validationdtoboundssecurity
Add Min/Max and MaxLength validators to bounded DTO fields
IsInt/IsString alone do not bound a value; add Min/Max and MaxLength so out-of-range or oversized input is rejected.
PR: vinify-backend · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codetypescript
| 1 | @IsInt() |
| 2 | public points: number; // no Min/Max |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | @IsInt() |
| 2 | @Min(0) |
| 3 | @Max(100) |
| 4 | public points: number; |
Explanation (EN)
Objašnjenje (HR)