You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to this issue: #1386 all the functions in the library support both the oldschool callback based approach and async await via needing the async keyword on passed in iterators + internally the library checking that the passed in function is of type/tagged as AsyncFunction.
This all works fine at runtime, but the iterator types exported from the library (AsyncIterator, AsyncForEachIterator etc...) are still all typed as just returning 'void'. This clashes with the @typescript-eslint/no-misused-promise rule (part of @typescript-eslint/recommended-requiring-type-checking - https://www.npmjs.com/package/@typescript-eslint/eslint-plugin) that tries to flag when you're passing an async function as a parameter to something that doesn't actually expect one and therefore isn't likely to await it or handle errors.
I believe this issue could be fixed by just changing the expected all of the Iterator types to be unions of the void returning version + the Promise<void> returning version to correctly match supported usage?
What version of async are you using?
3.2.5
The text was updated successfully, but these errors were encountered:
According to this issue: #1386 all the functions in the library support both the oldschool callback based approach and async await via needing the async keyword on passed in iterators + internally the library checking that the passed in function is of type/tagged as AsyncFunction.
This all works fine at runtime, but the iterator types exported from the library (AsyncIterator, AsyncForEachIterator etc...) are still all typed as just returning 'void'. This clashes with the @typescript-eslint/no-misused-promise rule (part of @typescript-eslint/recommended-requiring-type-checking - https://www.npmjs.com/package/@typescript-eslint/eslint-plugin) that tries to flag when you're passing an async function as a parameter to something that doesn't actually expect one and therefore isn't likely to await it or handle errors.
I believe this issue could be fixed by just changing the expected all of the Iterator types to be unions of the
void
returning version + thePromise<void>
returning version to correctly match supported usage?What version of async are you using?
3.2.5
The text was updated successfully, but these errors were encountered: