close

no-debugger

Configuration

PresetConfigured Value
✅ js.configs.recommended"error"
✅ ts.configs.recommended"error"
rslint.config.ts
import { defineConfig, js } from '@rslint/core';

export default defineConfig([
  js.configs.recommended,
  {
    rules: {
      'no-debugger': 'error',
    },
  },
]);

Rule Details

Disallows the use of debugger statements. The debugger statement is used to tell the JavaScript runtime to pause execution and open a debugging session. These statements should be removed before deploying code to production, as they can halt execution and are only useful during development.

Examples of incorrect code for this rule:

function check(value) {
  debugger;
  return value > 0;
}

Examples of correct code for this rule:

function check(value) {
  return value > 0;
}

Original Documentation