jshint functions with dots in the name-Collection of common programming errors
I’m running jshint on a javascript file, and some of the functions have dots in their names (as a way of namespacing). In particular, I’m using the d3 library, and I have a lot of code that looks like
d3.select("something")
Do I just need to turn off jshint’s checking of using undefined variables? Or is there a way to suppress just certain variable names from being checked. I’m using grunt to build the project.
- 
Wrong. You are calling the selectmethod on thed3variable.
 You’re getting a warning because JSHint doesn’t know about thed3variable.You need to tell it that the d3global has been defined elsewhere, like this:/*global d3:false */The :falsewill tell it to complain if you ever overwrite the global.
Originally posted 2013-11-09 21:08:38.