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: react
formsvalidationuxcorrectness
Validate required input before advancing a multi-step flow
Run validation at the step that owns the input so errors surface next to the fields, not behind a later dialog.
PR: vinify-frontend · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codetsx
| 1 | const handleContinue = () => openMethodDialog(); // validation only runs after a later Confirm |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | const handleContinue = () => { |
| 2 | if (!isWineNameColumnMapped()) { showError(); return; } |
| 3 | openMethodDialog(); |
| 4 | }; |
Explanation (EN)
Objašnjenje (HR)