deno.com

no-debugger

NOTE: this rule is part of the recommended rule set.
Enable full set in deno.json:
{
  "lint": {
    "rules": {
      "tags": ["recommended"]
    }
  }
}
Enable full set using the Deno CLI:
deno lint --rules-tags=recommended
This rule can be explictly included to or excluded from the rules present in the current tag by adding it to the include or exclude array in deno.json:
{
  "lint": {
    "rules": {
      "include": ["no-debugger"],
      "exclude": ["no-debugger"]
    }
  }
}

Disallows the use of the debugger statement.

debugger is a statement which is meant for stopping the javascript execution environment and start the debugger at the statement. Modern debuggers and tooling no longer need this statement and leaving it in can cause the execution of your code to stop in production.

Invalid:

function isLongString(x: string) {
  debugger;
  return x.length > 100;
}

Valid:

function isLongString(x: string) {
  return x.length > 100; // set breakpoint here instead
}

Did you find what you needed?

Privacy policy