'debugger' Command And JSLint
Solution 1:
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 */
Solution 2:
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 */
}
Solution 3:
Appears debug
is gone, and this is now tolerated with the devel
option, with the side effect that // TODO:
etc are also tolerated with the single devel
option.
devel
:true
if browser globals that are useful in development should be predefined, and ifdebugger
statements andTODO
comments should be allowed. It adds the same globals as this directive:
/*global alert, confirm, console, prompt */
Be sure to turn this option off before going into production.
This lints:
/*jslint white, devel */
function test() {
"use strict";
debugger; // JSLint reports the "Unexpected 'debugger'" error
}
Solution 4:
in react I used to do it during development like this:
debugger // eslint-disable-line
Solution 5:
Disable no-debugger
to make it work! (only applicable in Typescript tslint)
"rules": {
"no-debugger": false
}
Post a Comment for "'debugger' Command And JSLint"