-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Missing this
type for action
#2145
Comments
I had seen this recommended in the Effective TypeScript book, but not acted on it as I was not familiar with the pattern (Item 49: Provide a Type for this in Callbacks). |
We have more advanced typings and try out some typing improvements in: https://github.com/commander-js/extra-typings If you open a PR there, we can make it available there first before bringing it back to Commander. |
Done with commander-js/extra-typings#59 🎉 |
The change has been out for a couple of months in https://github.com/commander-js/extra-typings without causing reported issues. Would you still like to make a PR here @matthyk ? |
Absolutely! |
A prerelease is available for v13. The release is tagged as next and can be installed with:
|
commander.js/lib/command.js
Lines 511 to 527 in 83c3f4e
The passed
action
functionfn
receives the current command asthis
context in line 523. However, this context is missing in the current typings.commander.js/typings/index.d.ts
Line 525 in 83c3f4e
Happy to provide a PR for this!
The text was updated successfully, but these errors were encountered: