main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
959 bytes
|
Rev | Line | |
---|
[d565449] | 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 |
|
---|
| 12 | /** @type {import('../shared/types').Rule} */
|
---|
| 13 | module.exports = {
|
---|
| 14 | meta: {
|
---|
| 15 | type: "problem",
|
---|
| 16 |
|
---|
| 17 | docs: {
|
---|
| 18 | description: "Disallow the use of `debugger`",
|
---|
| 19 | recommended: true,
|
---|
| 20 | url: "https://eslint.org/docs/latest/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 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.