Krinkle has uploaded a new change for review.

Change subject: JSHint: Catch some big fish.
......................................................................

JSHint: Catch some big fish.

Warnings fixed:

* lqt.js: line 257: 'del' is not defined.
* lqt.js: line 1407: 'sel' is not defined.
* lqt.js: line 1407: 'i' is not defined.
* lqt.js: line 1407: 'code' is not defined.
* lqt.js: line 1407: 'description' is not defined.
  > BANG! Global variable lemon party.

* Unexpected escaped character '<' in regular expression.
* Bad escapement.

* '$j' is not defined.
  > Only use jQuery as global (or local alias thereof, such as $)

* '$' is not defined.
  'mw' is not defined.
  > Add closure (mediaWiki, jQuery)

* 'result' used out of scope.
* 'regex' used out of scope.
  > Declare variable outside `try` block.

* It is not necessary to initialise 'oldParent' to 'undefined'.
  It is not necessary to initialise 'menu' to 'undefined'.
  > Clearly didn't know javascript behaviour on undefined
    variables...

* newmessages.js: Unexpected expression.
* 'bump' is defined but never used.
* 'bump' is defined but never used.
* 'e' is defined but never used.
* 'i' is defined but never used.
* 'isThreadReply' is defined but never used.
* 'msg' is defined but never used.
* 'query' is defined but never used.
* 'reply' is defined but never used.
* 'tooltip' is defined but never used.
* 'type' is defined but never used.
  > Probably copy/paste errors. Ether way, useless now, removed.

Warnings disabled:

These are lower priority and or central to the way lqt is written.
Not useful to wait for to get jshint enabled, so lets consider
these "technical debt" for later and disabled in jshintrc.

* Camel case identifiers
* No trailing underscore in identifiers
* Variable hoisting (onevar)
* Use of arguments.callee (noarg)

Code convention / best practices

* Don't use `size()`, use `length` instead.
* Avoid commenting out code that is no longer relevant
  (there is version control for that).
* Trailing whitespace
* Don't use typeof undefined for local variables or
  properties.
* Consistency:
   Don't use `typeof e.preventDefault` in some place
   and plain `if e.preventDefault` in others.
* Added headers to file to describe what they are
  (which was needed given the cryptic name of some files
  and careless placement in the root of the repo).
* Documented use of deprecated jQuery.browser.

---

There's still some jshint warnings left, but I removed enough
to make the remaining output of jshint manageable and usable
to know whether a future commit introduces a new warning.

Change-Id: Ifb5f013235c674b63694e6a72c4a8af4e8711ca3
---
M .jshintrc
M jquery/jquery.thread_collapse.js
M js/lqt.toolbar.js
M lqt.js
M newmessages.js
5 files changed, 614 insertions(+), 607 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/16/47316/1
--
To view, visit https://gerrit.wikimedia.org/r/47316
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb5f013235c674b63694e6a72c4a8af4e8711ca3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Krinkle <ttij...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to