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
Add no-process-exit
rule
#1
Conversation
Has anyone filed an issue w/ ESLint requesting the hashbang exception? Seems like a pretty reasonable improvement to core. 👍 for adopting this rule for XO (no matter where it lands). |
if (callee.type === "MemberExpression" && | ||
callee.object.name === "process" && | ||
callee.property.name === "exit") { | ||
context.report(node, "Don't use process.exit(); throw an error instead."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use single-quotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only use
process.exit()
in CLI apps. Instead, throw an error.
3940d21
to
e789d3a
Compare
Adds `no-process-exit` rule. Same as the ESLint core rule, but with the exception of files that start with a hasbang `#!`. @sindresorhus asked me if I could implement this rule, and I thought it was fit to make a PR here.
Adds `no-process-exit` rule. Same as the ESLint core rule, but with the exception of files that start with a hasbang `#!`. @sindresorhus asked me if I could implement this rule, and I thought it was fit to make a PR here.
Glad you're happy with it :) (and I don't think it's possible to have enough of Leo) |
Adds
no-process-exit
rule. Same as the ESLint core rule, but with the exception of files that start with a hasbang#!
.@sindresorhus asked me if I could implement this rule, and I thought it was fit to make a PR here.