jshint / jshint.github.io

The homepage for JSHint
http://jshint.com
20 stars 19 forks source link

/*global*/ or /*globals*/? #27

Closed nacin closed 8 years ago

nacin commented 9 years ago

The "Inline configuration" section on the docs page suggests there are two primary inline directives: /*jshint*/ and /*global*/. However, the page proceeds to document /*globals*/ rather than /*global*/. While JSHint supports both, /*global*/ clearly seems preferred, given that it's what is used in JSHint's own JS files. (It's also the only supported option by JSHint.)

Should the docs be corrected? Expanded to note the alternative form?

jugglinmike commented 9 years ago

Thanks for the report! I think /* globals */ is actually preferable because it is consistent with the configuration option of the same name (this is despite the fact that, as you note, the JSHint source code uses /* global */). I've pushed a commit to use "globals" label consistently; here's the commit message:

Although JSHint happens to recognize the sequence global as the beginning of a comment-based directive, the sequence globals is more consistent with JSHint's configuration options (which expose an option of the same name).

Remove references to the global sequence to prevent confusion and promote consistency.

Does this address you concern?

jugglinmike commented 8 years ago

In the absence of a response, I'm going to consider this resolved. Thanks again!