Closed michaeljb closed 10 years ago
src/ext/kingdom_generator.js
and src/ext/templates.js
are configured to be excluded from JSLint because they feature machine-generated code which neither responds well to linting, nor does it need to.
I was under the impression that the silly-looking
typeof x !== 'undefined'
was necessary for cross-browser compatibility. Is this not the case?
This is an excellent change, btw. Many thanks!
I was not aware of it being a cross-browser issue before. From the first article I opened after Googling, it seems it's a problem with "older browsers", which I don't think we need to worry about.
Unrelated to that question -- JSLint hates declaring variables that don't get used, and in some places (especially automatch.js
) it seemed like the vars might be used for debugging stuff or something (as opposed to just being old cruft), so I commented them out instead of killing them completely.
Okay. I learned it from a JS book that's undoubtedly less up to date than random Googling. I won't worry about it.
I'd rather just delete unused variables and any other unused or outdated code than commenting it out. Is there any reason to keep old code in comments when we've got git versioning?
Is there any reason to keep old code in comments when we've got git versioning?
No, not really. I'll get it deleted.
The Development page on the Wiki asks developers to follow JSLint, and now a runnable task to do just that can be part of the project!
npm install
will downloadgrunt-contrib-jslint
andgrunt-contrib-watch
grunt jslint
lintsGruntfile.js
and all of the .js files insrc/ext/
Gruntfile.js
grunt watch:jslint
will start a process to watch for file changes and automatically rungrunt jslint