How to set .eslintrc to recognize 'require'?
Adding amd
to env
inside .eslintrc
will enable you to use define()
and require()
, as per the amd
spec:
{
"env": {
"amd": true
}
}
The problem is not with ESLint. If you look closely at your message, it says JSHint.
Since you're trying to configure ESLint, simplest solution would be to disable or remove JSHint plugin form your IDE.
If you still want to use JSHint along with ESLint, you can do the following:
Single file solution: add /* global require */
at the top of your file.
General solution for all files: add "node": true
line to your .jshintrc
.