Jshint: JSHint + `"use strict";` results in spurious "'exports' is not defined." warnings

Created on 9 May 2013  ·  3Comments  ·  Source: jshint/jshint

I'd like to apply both JSHint and "use strict"; to my Node.js code, but when I do, JSHint complains:

$ jshint .
binfix.js: line 14, col 1, 'exports' is not defined.
binfix.js: line 24, col 1, 'exports' is not defined.
binfix.js: line 48, col 1, 'exports' is not defined.

Most helpful comment

I added this:

{
"node" : true
}

in .jshintrc file and it worked well for me. Thank you @mcandre and @valueof !

All 3 comments

use /*jshint node:true */ option.

@antonkovalyov Thanks again! All the warnings went away when I added "node": true to my .jshintrc!

I added this:

{
"node" : true
}

in .jshintrc file and it worked well for me. Thank you @mcandre and @valueof !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timdown picture timdown  ·  7Comments

stefanuddenberg picture stefanuddenberg  ·  7Comments

Daniel-Hug picture Daniel-Hug  ·  3Comments

strugee picture strugee  ·  8Comments

Sriram-Ramaswami picture Sriram-Ramaswami  ·  5Comments