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: returning "true" instead of "void" #346

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

berkes
Copy link

@berkes berkes commented Feb 15, 2022

Apparently process.kill() returns a Boolean, so the early return will
return a true||false rather than the void as per the func sig.

This patch ensures we return void regardless of what process.kill() and
process.exit() return. What they return may be dependent on node version
and/or platform.

Apparently process.kill() returns a Boolean, so the early return will
return a true||false rather than the void as per the func sig.

This patch ensures we return void regardless of what process.kill() and
process.exit() return. What they return may be dependent on node version
and/or platform.
@berkes
Copy link
Author

berkes commented Feb 15, 2022

Before, this raised an error for lint, test and basically any command:

TSError: ⨯ Unable to compile TypeScript:
src/signal-termination.ts:92:7 - error TS2322: Type 'true' is not assignable to type 'void'.

92       return process.kill(process.pid, signal)

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

1 participant