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 ruleP2universalStack: javascript
asyncpromisesreadability
Don't mix .then() with async/await in the same flow
Stick to one async style; combining await with .then() chains hurts readability and error handling.
PR: hegnar-web · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codejavascript
| 1 | async function load() { |
| 2 | const data = await fetchData(); |
| 3 | return transform(data).then((r) => save(r)); |
| 4 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejavascript
| 1 | async function load() { |
| 2 | const data = await fetchData(); |
| 3 | const r = await transform(data); |
| 4 | return save(r); |
| 5 | } |
Explanation (EN)
Objašnjenje (HR)