vetkit.js.quality.async-foreach
An async callback is passed to forEach. forEach ignores the returned promises, so the surrounding code does not wait for them and their rejections are unhandled.
Last updated:
Suite: Code quality
javascript, typescript
An async callback is passed to forEach. forEach ignores the returned promises, so the surrounding code does not wait for them and their rejections are unhandled.
Category: QUALITY · Engine rule severity: WARNING
How to fix it
Use for (const x of items) { await ... } for sequential work, or await Promise.all(items.map(async (x) => ...)) for concurrent work.
References
Source: packages/engine/rules/quality/javascript.yml.
Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.