Skip to content

Conversation

@lubien
Copy link
Contributor

@lubien lubien commented Sep 24, 2019

Rule no-process-exit should enable process.exit()
when worker_threads module is required.

Fixes #328


IssueHunt Summary

Referenced issues

This pull request has been submitted to:


IssueHunt has been backed by the following sponsors. Become a sponsor

Rule no-process-exit should enable process.exit()
when worker_threads module is required.
'const {workerData, parentPort} = require(\'worker_threads\')\n\nprocess.exit(1);',
'import {workerData, parentPort} from \'worker_threads\'\n\nprocess.exit(1);',
'import foo from \'worker_threads\'\n\nprocess.exit(1);',
''
Copy link
Collaborator

Choose a reason for hiding this comment

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

this empty code is introduced in #1 , but seems useleess

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought it was meant just to make sure the rule doesn't trigger by nothing. I just left it as is but I can remove it if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually, I'm not sure about it, maybe @sindresorhus need review this.

let's keep it unresolved

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

Copy link
Owner

Choose a reason for hiding this comment

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

Makes sense to me to keep it. Just to be safe. We should really add it to all the rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. I'll restore it later today. Should I do it for others here or in a separate PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh it got merged

Copy link
Owner

Choose a reason for hiding this comment

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

Doesn't matter. We should add it to all the rules.

Copy link
Collaborator

@fisker fisker left a comment

Choose a reason for hiding this comment

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

LGTM

@lubien
Copy link
Contributor Author

lubien commented Sep 24, 2019

Just realized some commit came from another PR. Removed it and pushed again.

@sindresorhus sindresorhus changed the title Closes #328: Enable process.exit on thread files Don't report no-process-exit rule in worker threads Sep 25, 2019
@sindresorhus sindresorhus merged commit 90ca979 into sindresorhus:master Sep 25, 2019
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.

no-process-exit in worker_threads

3 participants