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

Replace global return with process.exit(1) #33

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

Conversation

asdofindia
Copy link

ESlint fails with "parsing error return outside function" because of this return. Alternative is to use process.exit.

ESlint fails with "parsing error return outside function" because of this return. Alternative is to use process.exit.
@mikermcneil
Copy link
Member

@asdofindia thanks! I can dig it-- although what I'm not sure about offhand is if there is ever a scenario where process.exit(1) will not necessarily halt execution within the current file-- i.e. I don't know for certain whether or not we'd still potentially want the return to prevent line 54 from being run in a weird scenario (e.g. where someone has a custom process on exit listener bound)

I'm pretty sure that used to be something you had to worry about back in the node <4 days-- I just haven't gotten into the weeds with it for a while. Any ideas?

@mikermcneil
Copy link
Member

Or... actually, much easier: We could also just throw instead of logging err.stack above. That'd kill two birds with one stone, i think (though it would take some fiddling with the error we throw to make the output look nice)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants