minor adjustment to readme
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / eslint / lib / rules / no-process-exit.js
1 /**
2  * @fileoverview Disallow the use of process.exit()
3  * @author Nicholas C. Zakas
4  */
5 "use strict";
6
7 //------------------------------------------------------------------------------
8 // Rule Definition
9 //------------------------------------------------------------------------------
10
11 module.exports = {
12     meta: {
13         type: "suggestion",
14
15         docs: {
16             description: "disallow the use of `process.exit()`",
17             category: "Node.js and CommonJS",
18             recommended: false,
19             url: "https://eslint.org/docs/rules/no-process-exit"
20         },
21
22         schema: []
23     },
24
25     create(context) {
26
27         //--------------------------------------------------------------------------
28         // Public
29         //--------------------------------------------------------------------------
30
31         return {
32             "CallExpression > MemberExpression.callee[object.name = 'process'][property.name = 'exit']"(node) {
33                 context.report({ node: node.parent, message: "Don't use process.exit(); throw an error instead." });
34             }
35         };
36
37     }
38 };