Skip to content

noDebugger (JavaScript)

Language JavaScript (and super languages)
biome.json
{
"linter": {
"rules": {
"suspicious": {
"noDebugger": "error"
}
}
}
}

Disallow the use of debugger

debugger;
code-block.js:1:1 lint/suspicious/noDebugger  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

βœ– This is an unexpected use of the debugger statement.

> 1 β”‚ debugger;
β”‚ ^^^^^^^^^
2 β”‚

β„Ή A debugger statement pauses the program when a debugger is open. It is meant for debugging only, and it should not be left in code that is shipped.

β„Ή Unsafe fix: Remove debugger statement

1 β”‚ debugger;
β”‚ ---------
const test = { debugger: 1 };
test.debugger;