-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: mark action as explicitly accepting promises #33
feat: mark action as explicitly accepting promises #33
Conversation
while typescript allows passing in `() => Promise<void>` as a callback for `() => void`, typescript-eslint catches those as `Promise returned in function argument where a void return was expected.eslint@typescript-eslint/no-misused-promises` (in its type-checking rules) this change allows passing in async functions to `action()`, knowing the returned promise by `parseAsync()` will be handled by the caller.
I expected this would get applied to Commander too, but it is already there: https://github.com/tj/commander.js/blob/8b03ab75b5431fd2d58a24b842ba088d621f12dc/typings/index.d.ts#L498 The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Released in v10.0.3 |
while typescript allows passing in
() => Promise<void>
as a callback for() => void
, typescript-eslint catches those asPromise returned in function argument where a void return was expected.eslint@typescript-eslint/no-misused-promises
(in its type-checking rules)this change allows passing in async functions to
action()
, knowing the returned promise byparseAsync()
will be handled by the caller.