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).
backend ruleP2universalStack: TypeScript / JavaScript
asyncclean-coderedundancy
Drop redundant return await on a returned promise
When you immediately return a promise, `return await` adds an extra microtask and no value (outside try/catch). Just return the promise.
PR: hegnar-user-ws · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | public fetch(): Promise<Data[]> { |
| 2 | return await lastValueFrom(this.http.get(url)); |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | public fetch(): Promise<Data[]> { |
| 2 | return lastValueFrom(this.http.get(url)); |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)