Skip to content

debuggerStatements

Reports using debugger statements.

✅ This rule is included in the ts logical preset.

The debugger statement causes the JavaScript runtime to pause execution and start a debugger if one is available, such as when browser developer tools are open. While this can be useful during development, it should not be left in production code as it can cause unexpected pauses in execution.

function doubleValues(values: number[]) {
debugger;
return values.map((value) => value * 2);
}

This rule is not configurable.

If your app isn’t shipped to production users, you might choose to disable this rule. For example, if you’re developing a local-only application where pausing in a debugger when dev tools are open is acceptable behavior, this rule might not be useful to you.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.