Latest Results
feat(linter): implement `no-promise-executor-return` rule (#16779)
## Summary
Implements ESLint's `no-promise-executor-return` rule which disallows
returning values from Promise executor functions.
The return value of a Promise executor is ignored, so returning a value
is likely a mistake. This rule detects:
- Implicit returns from arrow function expression bodies (`new Promise(r
=> r(1))`)
- Explicit return statements with values (`return 1`, `return
resolve(1)`)
- Returns inside control flow (if, switch, loops, try-catch, etc.)
### Configuration
- `allowVoid` (default: `false`): When `true`, allows `return void expr`
pattern (both explicit and implicit returns)
### Design Notes
This rule only checks executors passed directly as arrow/function
expressions. It does not track references like `new Promise(executor)`
where `executor` is defined elsewhere — this is an intentional design
choice consistent with ESLint's implementation.
## Test Plan
- [x] Added 12 pass cases (empty return, no return, nested functions,
allowVoid, non-Promise)
- [x] Added 16 fail cases (implicit return, explicit return, control
flow, return resolve/reject)
- [x] `cargo test -p oxc_linter no_promise_executor_return` passes
- [x] `cargo clippy -p oxc_linter` passes Active Branches
#167870%
#16785-3%
#16782-1%
© 2025 CodSpeed Technology