Reputation: 7539
I was reading a tutorial, and found that the lines
/*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */
/*global define, $, brackets, window, Mustache */
So my problem is, what i learn is that /* */
is used as multiline comments, so why this is used as global definition?
NB: Google deletes my // or /* from search, i dont know why it dont escape them!
Upvotes: 0
Views: 52
Reputation: 361
The jshint error "From within your code, you've access to some global variables:" indicated that you are using global variables in your code (your actual code, not the flags in comments you have posted).
The line "/*global define, $, brackets, window, Mustache */" is telling jshint to define variables called $, brackets, window and Mustache. This will prevent jshint from generating errors based on these global variables. If your still getting the error then you must be using other global variables.
You are probably missing a var statement somewhere. Post your whole code if you still need help.
Upvotes: 1
Reputation:
some external libraries/frameworks (jslint in this case) read comments.
Basically the comments are notes to jslint, turning on flags and telling it what variables are global.
Upvotes: 3