Skip to content
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

Fix types #804

Merged
merged 2 commits into from May 21, 2018
Merged

Fix types #804

merged 2 commits into from May 21, 2018

Conversation

blair
Copy link
Contributor

@blair blair commented May 20, 2018

Add some TypeScript improvements.

@@ -275,7 +275,7 @@ declare namespace local {
*
* @param {(str: string) => string} [cb]
*/
help(cb?: (str: string) => string): void;
help(cb?: (str: string) => string): never;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blair never type is incorrect for help function, it doesn't throw or failing to terminate.
https://blog.mariusschulz.com/2016/11/18/typescript-2-0-the-never-type

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vanesyan According to https://github.com/tj/commander.js/#helpcb the method "Output help information and exit immediately" so it terminates the process.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, you're correct. help terminates process.

@roman-vanesyan roman-vanesyan merged commit 89edef0 into tj:master May 21, 2018
@roman-vanesyan
Copy link
Collaborator

Thanks!

@blair blair deleted the fix-types branch May 21, 2018 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants