jshint: resources/jquery/*
authorTimo Tijhof <ttijhof@wikimedia.org>
Tue, 3 Jul 2012 15:21:32 +0000 (17:21 +0200)
committerTimo Tijhof <ttijhof@wikimedia.org>
Sun, 15 Jul 2012 15:13:20 +0000 (11:13 -0400)
commit089c58d2327e1c3b260f70bbe4683a36460675a0
tree9a1f8d8a28f6934a31427bc2eae9b432b7b84128
parent87524b1e751d52bb17d016da60ca1be010ef8f70
jshint: resources/jquery/*

* .jshintrc: Updated to include more strict options that match
  our code conventions.
  Also separated into 3 groups:
  - stricter (curly, eqeqeq etc.)
  - laxer (smarttabs, laxbreak)
  - envrionment (browser)

* .jshintignore: Updated to include more third-party/upstream files
   that should not be linted.

* Most of it is just routine cleanup, a few notable points:

 - jquery.autoEllipsis: Removed unused variable $protectedText.

 - jquery.arrowSteps.js: Remove <!-- --> and language="javascript"
   that hasn't been needed for almost a decade.

 - jquery.byteLimit: Use dashToCamel key for .data(), this already
   happens internally in jQuery data(), since data storage should use
   keys that are usable as identifiers. The dashed versions are to
   populate these from data-attribute-names, which then becomes
   data.attributeNames. jQuery data() takes both forms as
   convenience.

 - jquery.client.js: To avoid a rewrite of it, allowing unexpected
   assignments (boss) and eval (evil) in the functions that use that.
   Left as it is for now, could use a rewrite later.

 - jquery.color.js: Tolerate unexpected assignment for now (boss).
   Left as it is for now, should perhaps be refactored later.
   Also re-ordered per jshint/jslint to put definition before
   invocation. This option can be disabled, but then it doesn't
   warn for invoking undefined functions (or typos) at all.

 - jquery.expandableField.js: Remove empty switch/case.

 - jquery.localize.js: Alias mw global.

 - jquery.suggestions.js: Use e.which; jQuery.Event normalizes
   e.keyCode etc.

 - jquery.tablesorter.js: Alias mw global.

 - jquery.textSelection.js: Fix leakage of variable in global scope
   of var "i" and "j".

 - mediawiki.util.test.js: Fixed implied global `pCustom`.

* Review with -w for your own sanity.

Change-Id: Ia972f79539a96a38357ec4e92b0b6e38cc301681
28 files changed:
.jshintignore
.jshintrc
resources/jquery/jquery.arrowSteps.css
resources/jquery/jquery.arrowSteps.js
resources/jquery/jquery.autoEllipsis.js
resources/jquery/jquery.byteLength.js
resources/jquery/jquery.byteLimit.js
resources/jquery/jquery.checkboxShiftClick.js
resources/jquery/jquery.client.js
resources/jquery/jquery.collapsibleTabs.js
resources/jquery/jquery.color.js
resources/jquery/jquery.colorUtil.js
resources/jquery/jquery.delayedBind.js
resources/jquery/jquery.expandableField.js
resources/jquery/jquery.getAttrs.js
resources/jquery/jquery.highlightText.js
resources/jquery/jquery.localize.js
resources/jquery/jquery.makeCollapsible.js
resources/jquery/jquery.messageBox.js
resources/jquery/jquery.mwExtension.js
resources/jquery/jquery.placeholder.js
resources/jquery/jquery.qunit.completenessTest.js
resources/jquery/jquery.spinner.js
resources/jquery/jquery.suggestions.js
resources/jquery/jquery.tabIndex.js
resources/jquery/jquery.tablesorter.js
resources/jquery/jquery.textSelection.js
tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js