Pass jshint

We expect repositories to pass jshint. This change is conservative in
code change.

Tweak jshint options to suppress the following warnings:

* Prohibit use of loose comparison (eqeqeq:false)
* Prohibit the use of a variable before it was defined (latedef:false)

Tolerate the following:

* Suppress warnings about using [] notation (sub:true)
* Suppress warnings about unsafe line breaks (laxbreak:true)
* Suppress warnings about use of script URLs, like "javascript:" (scripturl:true)

Trivial fixes:

* Mixed spaces and tabs. (W099)
* Missing semicolon. (W033)
* X is already defined. (W004)
* Strict equals. (W041)
* Rename a variable (type -> player_type) to avoid already defined
  warning.
* Invalid typeof value 'String' (W122): using 'string' instead.

The error "Expected a 'break' statement before 'default'. (W086)" Can be
ignored by adding a special comment before the case:

    /* falls through */

Bug: 65487
Change-Id: I775096695d5bd6c099cd97af8a66132ab9d11fd4