noDebugger
Flags debugger statements.
- Category: Core
- Default:
error
Behavior:
- Lint: reports each
debuggerline with configured severity - Lint with
--fix: removes lines containing onlydebuggerstatements
Config:
ts
rules: { noDebugger: 'error' } // 'off' | 'warn' | 'error'Example:
ts
debuggerFix (--fix): line is removed.
Examples
Violation and autofix:
ts
function work() {
debugger
doStuff()
}After pickier lint . --fix:
ts
function work() {
doStuff()
}Best practices
- Keep severity at
errorto prevent shippingdebugger - Use
--fixlocally before committing - Add a pre-commit hook to run
pickier lint --fixto automatically remove straydebuggerlines