Web App Development

How to allow debugger statements when using ng-boilerplate

ng-boilerplate uses jsHint to warn developers about potential low-quality code. One of jsHint's features is that it prevents debugger; breakpoints from slipping into production.

When trying to compile an ng-boilerplate project containing a debugger statement you'll see this error:
Forgotten 'debugger' statement?
To remove this warning open your Gruntfile.js and search for the third occurance of "jsHint":

jshint: {
  src: [
    '<%= app_files.js %>'
  ],
  test: [
    '<%= app_files.jsunit %>'
  ],
  gruntfile: [
    'Gruntfile.js'
  ],
  options: {
    curly: true,
    immed: true,
    newcap: true,
    noarg: true,
    sub: true,
    boss: true,
    eqnull: true
  },
  globals: {}
},

In the options set `debug` to true allow the use of  `debugger`:
debug: true
 You can find a complete list of options on the jsHint website.

Comments


Follow me on Twitter
I'm building monitoring tool for site speed and Core Web Vitals.
➔ Start monitoring your website or run a free site speed test