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 ruleP2universalStack: javascript
promiseslintasyncnoise
Don't add an empty .then() just to silence floating-promise lint
If you don't need the result and don't need to await, omit the promise chain (or void it) rather than tacking on an empty .then().
PR: hegnar-web · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codejavascript
| 1 | useEffect(() => { |
| 2 | fetchLatestStock().then(); |
| 3 | }, []); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejavascript
| 1 | useEffect(() => { |
| 2 | void fetchLatestStock(); |
| 3 | }, []); |
Explanation (EN)
Objašnjenje (HR)