home
This commit is contained in:
parent
a71a3b5593
commit
cb52890889
16657 changed files with 1483086 additions and 1 deletions
34
home/ags/node_modules/eslint-plugin-n/lib/rules/no-process-exit.js
generated
vendored
Normal file
34
home/ags/node_modules/eslint-plugin-n/lib/rules/no-process-exit.js
generated
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/**
|
||||
* @author Nicholas C. Zakas
|
||||
* See LICENSE file in root directory for full license.
|
||||
*/
|
||||
"use strict"
|
||||
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
docs: {
|
||||
description: "disallow the use of `process.exit()`",
|
||||
recommended: false,
|
||||
url: "https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-process-exit.md",
|
||||
},
|
||||
fixable: null,
|
||||
schema: [],
|
||||
messages: {
|
||||
noProcessExit: "Don't use process.exit(); throw an error instead.",
|
||||
},
|
||||
},
|
||||
|
||||
create(context) {
|
||||
return {
|
||||
"CallExpression > MemberExpression.callee[object.name = 'process'][property.name = 'exit']"(
|
||||
node
|
||||
) {
|
||||
context.report({
|
||||
node: node.parent,
|
||||
messageId: "noProcessExit",
|
||||
})
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue