summaryrefslogtreecommitdiff
path: root/tools/eslint/lib/rules/no-process-exit.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/lib/rules/no-process-exit.js')
-rw-r--r--tools/eslint/lib/rules/no-process-exit.js12
1 files changed, 2 insertions, 10 deletions
diff --git a/tools/eslint/lib/rules/no-process-exit.js b/tools/eslint/lib/rules/no-process-exit.js
index c0c2455545..04e423b88f 100644
--- a/tools/eslint/lib/rules/no-process-exit.js
+++ b/tools/eslint/lib/rules/no-process-exit.js
@@ -26,17 +26,9 @@ module.exports = {
//--------------------------------------------------------------------------
return {
-
- CallExpression(node) {
- const callee = node.callee;
-
- if (callee.type === "MemberExpression" && callee.object.name === "process" &&
- callee.property.name === "exit"
- ) {
- context.report({ node, message: "Don't use process.exit(); throw an error instead." });
- }
+ "CallExpression > MemberExpression.callee[object.name = 'process'][property.name = 'exit']"(node) {
+ context.report({ node: node.parent, message: "Don't use process.exit(); throw an error instead." });
}
-
};
}