'require is not defined' (linter-jshint 3.1.5)


#1

I’ve been using /* jshint node: true */ locally to prevent warnings, but ideally I’d like to set something up globally.

I’ve tried adding the following to the .jshintrc file, but to no avail. { "node": true }

Any pointers?


#2

Could we see your .jshintrc?


#3

Sure, cheers. It’s just this:
{ "node": true }

There’s nothing else in the file…


#4

Okay, go to Settings -> Packages -> linter-jshint, click on the package’s card to get to its settings view, and check the setting Disable When No Jshintrc File In Path. If it’s checked, the linter will refuse to run if it doesn’t find your settings. If you check it and the linter turns off, then you know that the .jshintrc isn’t in a directory that jshint is looking in.


#5

Thanks @DamnedScholar It wasn’t checked, i’ve now checked the box and the linter is disabled.

Could you please advise which directory it should be in?

Here’s a screenshot of the linter-jshint file structure, and the settings area.


#6

…very sorry to ask this:
Do you have JSHint installed?
http://jshint.com/install/

Reason for asking: It is easy to overlook that
some packages link Atom and other programs to each other,
as is the case here.


#7

@danPadric Thanks, I wasn’t aware of that. I’ve since installed it but am still encountering the same problem with W117 - ‘require’ is not defined.


#8

@meysuhn The JSHint documentation tells you where to put .jshintrc.