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 ruleP0universalStack: TypeScript
validationcorrectnessapiregression
Don't drop validation that filters out no-op requests
Removing a filter that excludes empty/zero-amount entries can send no-op requests to the backend (wasteful calls, possible errors, misleading success messages). Keep the guard or validate server-side.
PR: vinify-frontend · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | return items.map(toRequest); // sends entries where quantity === 0 && litres === 0 |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | return items |
| 2 | .filter(i => i.quantity > 0 || i.remainingLitres > 0) |
| 3 | .map(toRequest); |
Explanation (EN)
Objašnjenje (HR)