cfjedimaster / brackets-jshint

Adds JSHint support to Brackets
MIT License
130 stars 41 forks source link

window is undefined #29

Closed NoNameProvided closed 9 years ago

NoNameProvided commented 10 years ago

JSLint don't recognize that 'window' (window.navigator.userAgent;) is a global variable, and display a warning like this:

'window' is not defined. (W117)

/*global window */

will supress this warning, but it should know that is a global.

cfjedimaster commented 10 years ago

If you test on the JSHint site yourself, and turn off "Assume browser", you get the same result. I think the extension is doing it right. You may not be writing code for the browser, so it should flag window imo.

NoNameProvided commented 10 years ago

I know that is the correct behaviour from the JSLint, but is this the correct behaviour from the extension? Brackets is mainly a front-end developer tool. "Coding for the web." So maybe it is a good idea to turn on the "Assume browser" option. But it is your's choice.

cfjedimaster commented 10 years ago

My vote would be to make use of .jshintrc at the project level to set the option.