arobson/autohost — pull request #1 by ifandelse (2014-08-11 19:47:19+00:00)
Title: Static Analysis & Related Tweaks

This was fun to look through. Even though I know I'll need to dive quite a bit more, I feel like I got a good gist of how you've changed the overall structure compared to v1. A typical part of my workflow these days involves static analysis with settings similar to the `.jshintrc` file I added to the repo. I've heavily leaning towards adding a *mocha/should-focused* `.jshintrc` as well (which would live in the spec directory), since tests is where I find myself using the `//jshint ignore` pragmas more often. I didn't include that in this PR though, since I didn't want to assume too much! This PR focuses on these things:

* Reference errors
* Converting loose equality comparisons to strict
* ASI warning elimination
* Removing unused vars
* Converting multi-line var assignments to var-per-assignment (but preserving multi-line comma-delimited vars where only declaration was occuring, not assignment). I didn't do this in *every* spot where multi line, comma-delimited vars occur, only the ones I touched due to removing unused vars, or (in two cases IIRC), where a semi-colon had snuck into the middle of the multi-line var and gave us magical globals.

The first two bullets are the most important, IMO. The rest are primarily to help provide a foundation of consistency that we can refer other LK JS devs to, and to help remove unnecessary surface area for potential bugs sneaking in.

This is an awesome step forward on autohost - I'm simply putting powdered sugar on top of an already excellent batch of cannolis. That being said, pls let me know if you hate powdered sugar :smile: