From c09ec41b19f3c5eafbf0709fa05423b9741bc457 Mon Sep 17 00:00:00 2001 From: webreflection Date: Mon, 31 Aug 2026 12:04:14 +0200 Subject: [PATCH] docs: enforce Promise.withResolvers() more explicitly. --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 3e2954cb776..74313687735 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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()` for deferreds when runtime/types support it; allow callback/event executors, not async executors or redundant Promise wrapping. +- Always use `Promise.withResolvers()` 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