Search code examples
javascriptgoogle-chromejslint

'debugger' command and JSLint


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
}

Solution

  • JSLint has an explicit option to tolerate debugger statements, called debug:

    debug: true if debugger statements should be allowed.

    You can specify this option via your jslint directive:

    /*jslint browser:true, white: true, debug: true */