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.
Examples
Section titled “Examples”function doubleValues(values: number[]) { debugger; return values.map((value) => value * 2);}
function doubleValues(values: number[]) { return values.map((value) => value * 2);}
Options
Section titled “Options”This rule is not configurable.
When Not To Use It
Section titled “When Not To Use It”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.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- Biome:
noDebugger
- Deno:
no-debugger
- ESLint:
no-debugger
- Oxlint:
eslint/no-debugger
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.