-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
In the current TypeScript type definitions, the forEach
function is declared as:
export const forEach: <T>(
array: T[],
callback: (currentValue: T, index: number, array: T[]) => void,
thisArg?: any
) => Promise<void>;
See index.d.ts.
This signature implies that the callback must return void
.
However, the documentation states that it should be asynchronious:
Allow the usage of async functions as callback
See README.md.
I guess, the function should return void | Promise<void>
.
The current definition produces the linter error:
Promise returned in function argument where a void return was expected @typescript-eslint/no-misused-promises
See no-misused-promises.
Could you please consider updating the typing?
Thank you!
Metadata
Metadata
Assignees
Labels
No labels