docs: enforce Promise.withResolvers() more explicitly.

This commit is contained in:
webreflection
2026-08-31 12:04:14 +02:00
parent f4b7c41507
commit c09ec41b19
+1 -1
View File
@@ -93,7 +93,7 @@ Examples: `fix(tui): simplify thinking toggle styling`, `docs: update contributi
- Prefer single word variable names where possible
- Use Bun APIs when possible, like `Bun.file()`
- Rely on type inference when possible; avoid explicit type annotations or interfaces unless necessary for exports or clarity
- Prefer `Promise.withResolvers<T>()` for deferreds when runtime/types support it; allow callback/event executors, not async executors or redundant Promise wrapping.
- Always use `Promise.withResolvers<T>()` to create deferred promises; all supported runtimes provide it. Never capture `resolve` and `reject` from a `new Promise` executor in external variables or object properties.
### Avoid let statements