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

Add no-process-exit rule #1

Closed
wants to merge 1 commit into from

Conversation

jfmengels
Copy link
Contributor

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.

@jamestalmage
Copy link
Contributor

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.");
Copy link
Owner

Choose a reason for hiding this comment

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

Use single-quotes

Copy link
Owner

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.

sindresorhus pushed a commit that referenced this pull request Apr 12, 2016
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.
sindresorhus pushed a commit that referenced this pull request Apr 12, 2016
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.
@jfmengels jfmengels deleted the no-process-exit branch April 12, 2016 22:28
@sindresorhus
Copy link
Owner

Woo! Glad to finally be able to use this rule :)

leo-smile

(Can you ever have enough Leo? I don't think so 😝)

@jfmengels
Copy link
Contributor Author

Glad you're happy with it :)

(and I don't think it's possible to have enough of Leo)

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