How to tell JSHint to ignore all undefined variables in one file?

The correct way to tell JSHint about globals is to use the globals directive. For example:

/*globals globalFunction, anotherGlobal, oneMore */

This will prevent “{a} is not defined” warnings when JSHint encounters any of the listed identifiers.

Alternatively, if you really want to ignore all “not defined” warnings in that file, and you’re using JSHint 1.0.0 or above, you can simply turn off that specific warning:

/*jshint -W117 */

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)