Browse files

Docs: no-process-exit: recommend process.exitCode (#10478)

* Docs: no-process-exit: recommend process.exitCode

* Docs: added Node.js version info for process.exitCode
  • Loading branch information...
mjomble authored and platinumazure committed Jun 18, 2018
1 parent f93d6ff commit 077358b6ec7d5dd0c531e6db6f217e10c1c791bb
Showing with 2 additions and 0 deletions.
  1. +2 −0 docs/rules/
@@ -19,6 +19,8 @@ if (somethingBadHappened) {
By throwing an error in this way, other parts of the application have an opportunity to handle the error rather than stopping the application altogether. If the error bubbles all the way up to the process without being handled, then the process will exit and a non-zero exit code will returned, so the end result is the same.
If you are using `process.exit()` only for specifying the exit code, you can set [`process.exitCode`]( (introduced in Node.js 0.11.8) instead.
## Rule Details
This rule aims to prevent the use of `process.exit()` in Node.js JavaScript. As such, it warns whenever `process.exit()` is found in code.

0 comments on commit 077358b

Please sign in to comment.