Google Chrome supports debugger command as a tool to setup a breakpoint in code. How can I hide warnings for the following code in JSLint:
/*globals $, console, */
/*jslint browser:true, white: true */
function test() {
"use strict";
debugger; // JSLint reports the "Unexpected 'debugger'" error
}
JSLint has an explicit option to tolerate debugger
statements, called debug
:
debug
:true
ifdebugger
statements should be allowed.
You can specify this option via your jslint
directive:
/*jslint browser:true, white: true, debug: true */
This error is raised to highlight a lack of convention and possible oversight by the developer.
You can disable it via:
function test() {
/* ignore jslint start */
debugger;
/* ignore jslint end */
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With