1/** 2 * @fileoverview Rule to flag use of a debugger statement 3 * @author Nicholas C. Zakas 4 */ 5 6"use strict"; 7 8//------------------------------------------------------------------------------ 9// Rule Definition 10//------------------------------------------------------------------------------ 11 12module.exports = { 13 meta: { 14 type: "problem", 15 16 docs: { 17 description: "disallow the use of `debugger`", 18 category: "Possible Errors", 19 recommended: true, 20 url: "https://eslint.org/docs/rules/no-debugger" 21 }, 22 23 fixable: null, 24 schema: [], 25 26 messages: { 27 unexpected: "Unexpected 'debugger' statement." 28 } 29 }, 30 31 create(context) { 32 33 return { 34 DebuggerStatement(node) { 35 context.report({ 36 node, 37 messageId: "unexpected" 38 }); 39 } 40 }; 41 42 } 43}; 44