grunt-contrib-jshint doesn't complain about console.log

gruntjs, jshint

Solution

As far as I can tell, JSHint has never warned about references to `console`. There is no code in there to specifically handle such references.

`console` is simply treated as an identifier that should be defined and accessible from whatever context it is referred to from (which is correct, since that is really all it is).

Therefore, you can get JSHint to warn about usage of `console` by getting it to warn about all undefined variables. Just set the `undef` option to `true`.

Then, if you want to allow the usage of `console`, you can add it to your `globals` directive or set the `devel` option to `true` (which implicitly adds it to your `globals` directive).

Problem

With the following setting the jsHint doesn't complain about `console.log` statements while it still reports `debugger` statements: ``` jshint: { files: [ 'Gruntfile.js', 'js/**/*.js', 'tests/*.js', ], options: { curly: true, immed: true, noarg: true, expr: true, quotmark: 'single', maxdepth: 3, browser: true, eqnull: true } }, ```

Original source