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).
frontend ruleP1universalStack: typescript
correctnessvalidationthird-partyforms
Verify you are calling third-party APIs as documented
When using a library's validation/config API, follow its documented shape (e.g. an object/array of callbacks) rather than guessing a signature that silently no-ops.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codets
| 1 | register('title', { validate: FormValidator.isNotEmpty && FormValidator.maxLength(64) }); |
| 2 | // only checks that the reference exists; validation never runs |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | register('title', { validate: FormValidator.all(FormValidator.isNotEmpty, FormValidator.maxLength(64)) }); |
Explanation (EN)
Objašnjenje (HR)