jenkins-bot has submitted this change and it was merged.

Change subject: build: Enable jscs jsDoc rule 'checkTypes' and make pass
......................................................................


build: Enable jscs jsDoc rule 'checkTypes' and make pass

Change-Id: I64c3b5bd7afc4686355c80ef68009d978f7b3097
---
M .jscsrc
M resources/src/jquery/jquery.autoEllipsis.js
M resources/src/jquery/jquery.expandableField.js
M resources/src/jquery/jquery.qunit.completenessTest.js
M resources/src/jquery/jquery.tablesorter.js
M resources/src/mediawiki.special/mediawiki.special.preferences.js
M resources/src/mediawiki.toolbar/toolbar.js
M resources/src/mediawiki/api/edit.js
M resources/src/mediawiki/mediawiki.experiments.js
M resources/src/mediawiki/mediawiki.inspect.js
M resources/src/mediawiki/mediawiki.jqueryMsg.js
M resources/src/mediawiki/mediawiki.js
M resources/src/mediawiki/mediawiki.log.js
M resources/src/mediawiki/mediawiki.storage.js
M resources/src/mediawiki/mediawiki.template.js
M tests/qunit/data/testrunner.js
M tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
M tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js
M tests/qunit/suites/resources/jquery/jquery.textSelection.test.js
19 files changed, 54 insertions(+), 50 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.jscsrc b/.jscsrc
index 7226091..c1fbc9a 100644
--- a/.jscsrc
+++ b/.jscsrc
@@ -9,6 +9,7 @@
        "jsDoc": {
                "checkParamNames": true,
                "checkRedundantReturns": true,
+               "checkTypes": "strictNativeCase",
                "requireNewlineAfterDescription": true,
                "requireParamTypes": true,
                "requireReturnTypes": true
diff --git a/resources/src/jquery/jquery.autoEllipsis.js 
b/resources/src/jquery/jquery.autoEllipsis.js
index e1115d6..fd7e8d1 100644
--- a/resources/src/jquery/jquery.autoEllipsis.js
+++ b/resources/src/jquery/jquery.autoEllipsis.js
@@ -10,11 +10,13 @@
        // Use a separate cache when match highlighting is enabled
        matchTextCache = {};
 
+// Due to <https://github.com/jscs-dev/jscs-jsdoc/issues/136>
+// jscs:disable jsDoc
 /**
  * Automatically truncate the plain text contents of an element and add an 
ellipsis
  *
  * @param {Object} options
- * @param {'center'|'left'|'right'} [options.position='center'] Where to 
remove text.
+ * @param {'left'|'center'|'right'} [options.position='center'] Where to 
remove text.
  * @param {boolean} [options.tooltip=false] Whether to show a tooltip with the 
remainder
  * of the text.
  * @param {boolean} [options.restoreText=false] Whether to save the text for 
restoring
@@ -159,6 +161,7 @@
 
        } );
 };
+// jscs:enable jsDoc
 
 /**
  * @class jQuery
diff --git a/resources/src/jquery/jquery.expandableField.js 
b/resources/src/jquery/jquery.expandableField.js
index 4f67b87..f9db72f 100644
--- a/resources/src/jquery/jquery.expandableField.js
+++ b/resources/src/jquery/jquery.expandableField.js
@@ -41,7 +41,7 @@
                 * Sets the value of a property, and updates the widget 
accordingly
                 *
                 * @param {Object} context
-                * @param {String} property Name of property
+                * @param {string} property Name of property
                 * @param {Mixed} value Value to set property with
                 */
                configure: function ( context, property, value ) {
diff --git a/resources/src/jquery/jquery.qunit.completenessTest.js 
b/resources/src/jquery/jquery.qunit.completenessTest.js
index 25cc057..8d263fb 100644
--- a/resources/src/jquery/jquery.qunit.completenessTest.js
+++ b/resources/src/jquery/jquery.qunit.completenessTest.js
@@ -186,9 +186,9 @@
                 * Depending on the action it either injects our listener into 
the methods, or
                 * reads from our tracker and records which methods have not 
been called by the test suite.
                 *
-                * @param {mixed} currObj The variable to check (initially an 
object,
+                * @param {Mixed} currObj The variable to check (initially an 
object,
                 *  further down it could be anything).
-                * @param {String|Null} currName Name of the given object 
member (Initially this is null).
+                * @param {string|null} currName Name of the given object 
member (Initially this is null).
                 * @param {Object} masterVariable Throughout our interation, 
always keep track of the master/root.
                 *  Initially this is the same as currVar.
                 * @param {Array} parentPathArray Array of names that indicate 
our breadcrumb path starting at
@@ -258,8 +258,8 @@
                 * was called during the test suite (as far as the tracker 
knows).
                 * If not it adds it to missingTests.
                 *
-                * @param {String} fnName
-                * @return {Boolean}
+                * @param {string} fnName
+                * @return {boolean}
                 */
                hasTest: function ( fnName ) {
                        if ( !( fnName in this.methodCallTracker ) ) {
diff --git a/resources/src/jquery/jquery.tablesorter.js 
b/resources/src/jquery/jquery.tablesorter.js
index f6857e8..0eefae6 100644
--- a/resources/src/jquery/jquery.tablesorter.js
+++ b/resources/src/jquery/jquery.tablesorter.js
@@ -426,8 +426,8 @@
         * in default (ascending) order when their header cell is clicked the 
next time.
         *
         * @param {jQuery} $headers
-        * @param {Number[][]} sortList
-        * @param {Number[][]} headerToColumns
+        * @param {number[][]} sortList
+        * @param {number[][]} headerToColumns
         */
        function setHeadersOrder( $headers, sortList, headerToColumns ) {
                // Loop through all headers to retrieve the indices of the 
columns the header spans across:
diff --git a/resources/src/mediawiki.special/mediawiki.special.preferences.js 
b/resources/src/mediawiki.special/mediawiki.special.preferences.js
index bad1c08..9b790e0 100644
--- a/resources/src/mediawiki.special/mediawiki.special.preferences.js
+++ b/resources/src/mediawiki.special/mediawiki.special.preferences.js
@@ -51,8 +51,8 @@
         * It uses document.getElementById for security reasons (HTML 
injections in $()).
         *
         * @ignore
-        * @param {String} name the name of a tab without the prefix 
("mw-prefsection-")
-        * @param {String} [mode] A hash will be set according to the current
+        * @param {string} name the name of a tab without the prefix 
("mw-prefsection-")
+        * @param {string} [mode] A hash will be set according to the current
         *  open section. Set mode 'noHash' to surpress this.
         */
        function switchPrefTab( name, mode ) {
diff --git a/resources/src/mediawiki.toolbar/toolbar.js 
b/resources/src/mediawiki.toolbar/toolbar.js
index 0469cc5..bb26c0f 100644
--- a/resources/src/mediawiki.toolbar/toolbar.js
+++ b/resources/src/mediawiki.toolbar/toolbar.js
@@ -115,7 +115,7 @@
                 *     addButtons( [ { .. }, { .. }, { .. } ] );
                 *     addButtons( { .. }, { .. } );
                 *
-                * @param {Object|Array...} [buttons] An array of button 
objects or the first
+                * @param {...Object|Array} [buttons] An array of button 
objects or the first
                 *  button object in a list of variadic arguments.
                 */
                addButtons: function ( buttons ) {
diff --git a/resources/src/mediawiki/api/edit.js 
b/resources/src/mediawiki/api/edit.js
index e43285f..22affb1 100644
--- a/resources/src/mediawiki/api/edit.js
+++ b/resources/src/mediawiki/api/edit.js
@@ -33,7 +33,7 @@
                 * Post a new section to the page.
                 *
                 * @see #postWithEditToken
-                * @param {mw.Title|String} title Target page
+                * @param {mw.Title|string} title Target page
                 * @param {string} header
                 * @param {string} message wikitext message
                 * @param {Object} [additionalParams] Additional API 
parameters, e.g. `{ redirect: true }`
diff --git a/resources/src/mediawiki/mediawiki.experiments.js 
b/resources/src/mediawiki/mediawiki.experiments.js
index 75b1f80..b62e8d1 100644
--- a/resources/src/mediawiki/mediawiki.experiments.js
+++ b/resources/src/mediawiki/mediawiki.experiments.js
@@ -9,8 +9,8 @@
         *
         * @see http://en.wikipedia.org/wiki/Jenkins_hash_function
         *
-        * @param {String} string String to hash
-        * @return {Number} The hash as a 32-bit unsigned integer
+        * @param {string} string String to hash
+        * @return {number} The hash as a 32-bit unsigned integer
         * @ignore
         *
         * @author Ori Livneh <[email protected]>
@@ -68,15 +68,15 @@
                 * This function is based on the deprecated `mw.user.bucket` 
function.
                 *
                 * @param {Object} experiment
-                * @param {String} experiment.name The name of the experiment
-                * @param {Boolean} experiment.enabled Whether or not the 
experiment is
+                * @param {string} experiment.name The name of the experiment
+                * @param {boolean} experiment.enabled Whether or not the 
experiment is
                 *  enabled. If the experiment is disabled, then the user is 
always assigned
                 *  to the control bucket
                 * @param {Object} experiment.buckets A map of bucket name to 
probability
                 *  that the user will be assigned to that bucket
-                * @param {String} token A token that uniquely identifies the 
user for the
+                * @param {string} token A token that uniquely identifies the 
user for the
                 *  duration of the experiment
-                * @returns {String} The bucket
+                * @returns {string} The bucket
                 */
                getBucket: function ( experiment, token ) {
                        var buckets = experiment.buckets,
diff --git a/resources/src/mediawiki/mediawiki.inspect.js 
b/resources/src/mediawiki/mediawiki.inspect.js
index 4859953..514a3dd 100644
--- a/resources/src/mediawiki/mediawiki.inspect.js
+++ b/resources/src/mediawiki/mediawiki.inspect.js
@@ -170,7 +170,7 @@
                 * Generate and print one more reports. When invoked with no 
arguments,
                 * print all reports.
                 *
-                * @param {string...} [reports] Report names to run, or unset 
to print
+                * @param {...string} [reports] Report names to run, or unset 
to print
                 *  all available reports.
                 */
                runReports: function () {
diff --git a/resources/src/mediawiki/mediawiki.jqueryMsg.js 
b/resources/src/mediawiki/mediawiki.jqueryMsg.js
index 9463ac8..c9c0455 100644
--- a/resources/src/mediawiki/mediawiki.jqueryMsg.js
+++ b/resources/src/mediawiki/mediawiki.jqueryMsg.js
@@ -1008,7 +1008,7 @@
                 *
                 * @param {Array} nodes List of one element, integer, n >= 0
                 * @param {Array} replacements List of at least n strings
-                * @return {String} replacement
+                * @return {string} replacement
                 */
                replace: function ( nodes, replacements ) {
                        var index = parseInt( nodes[ 0 ], 10 );
@@ -1033,7 +1033,7 @@
                 * from the server, since the replacement is done at save time.
                 * It may, though, if the wikitext appears in 
extension-controlled content.
                 *
-                * @param {String[]} nodes
+                * @param {string[]} nodes
                 */
                wikilink: function ( nodes ) {
                        var page, anchor, url;
@@ -1097,7 +1097,7 @@
                 *
                 * TODO: throw an error if nodes.length > 2 ?
                 *
-                * @param {Array} nodes List of two elements, 
{jQuery|Function|String} and {String}
+                * @param {Array} nodes List of two elements, 
{jQuery|Function|String} and {string}
                 * @return {jQuery}
                 */
                extlink: function ( nodes ) {
diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index ed81b0d..2eecbab 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -416,7 +416,7 @@
                 *
                 * @since 1.25
                 * @param {string} formatString Format string
-                * @param {Mixed...} parameters Values for $N replacements
+                * @param {...Mixed} parameters Values for $N replacements
                 * @return {string} Formatted string
                 */
                format: function ( formatString ) {
@@ -558,7 +558,7 @@
                 *
                 * @see mw.Message
                 * @param {string} key Key of message to get
-                * @param {Mixed...} parameters Values for $N replacements
+                * @param {...Mixed} parameters Values for $N replacements
                 * @return {mw.Message}
                 */
                message: function ( key ) {
@@ -573,7 +573,7 @@
                 *
                 * @see mw.Message
                 * @param {string} key Key of message to get
-                * @param {Mixed...} parameters Values for $N replacements
+                * @param {...Mixed} parameters Values for $N replacements
                 * @return {string}
                 */
                msg: function () {
@@ -599,7 +599,7 @@
                         * Write a message the console's warning channel.
                         * Actions not supported by the browser console are 
silently ignored.
                         *
-                        * @param {string...} msg Messages to output to console
+                        * @param {...string} msg Messages to output to console
                         */
                        log.warn = function () {
                                var console = window.console;
@@ -615,7 +615,7 @@
                         * is a caught Error object.
                         *
                         * @since 1.26
-                        * @param {Error|string...} msg Messages to output to 
console
+                        * @param {Error|...string} msg Messages to output to 
console
                         */
                        log.error = function () {
                                var console = window.console;
@@ -2528,7 +2528,7 @@
                                        /**
                                         * Register a hook handler
                                         *
-                                        * @param {Function...} handler 
Function to bind.
+                                        * @param {...Function} handler 
Function to bind.
                                         * @chainable
                                         */
                                        add: list.add,
@@ -2536,7 +2536,7 @@
                                        /**
                                         * Unregister a hook handler
                                         *
-                                        * @param {Function...} handler 
Function to unbind.
+                                        * @param {...Function} handler 
Function to unbind.
                                         * @chainable
                                         */
                                        remove: list.remove,
@@ -2544,7 +2544,7 @@
                                        /**
                                         * Run a hook.
                                         *
-                                        * @param {Mixed...} data
+                                        * @param {...Mixed} data
                                         * @chainable
                                         */
                                        fire: function () {
diff --git a/resources/src/mediawiki/mediawiki.log.js 
b/resources/src/mediawiki/mediawiki.log.js
index 053fb1a..93fb470 100644
--- a/resources/src/mediawiki/mediawiki.log.js
+++ b/resources/src/mediawiki/mediawiki.log.js
@@ -22,7 +22,7 @@
         * messages to that, instead of the console.
         *
         * @member mw.log
-        * @param {string...} msg Messages to output to console.
+        * @param {...string} msg Messages to output to console.
         */
        mw.log = function () {
                // Turn arguments into an array
diff --git a/resources/src/mediawiki/mediawiki.storage.js 
b/resources/src/mediawiki/mediawiki.storage.js
index 3958392..cb62fbf 100644
--- a/resources/src/mediawiki/mediawiki.storage.js
+++ b/resources/src/mediawiki/mediawiki.storage.js
@@ -30,7 +30,7 @@
                  *
                  * @param {string} key Key name to store under
                  * @param {string} value Value to be stored
-                 * @returns {boolean} Whether the save succeeded or not
+                 * @return {boolean} Whether the save succeeded or not
                  */
                set: function ( key, value ) {
                        try {
@@ -44,7 +44,7 @@
                  * Remove a value from device storage.
                  *
                  * @param {string} key Key of item to remove
-                 * @returns {boolean} Whether the save succeeded or not
+                 * @return {boolean} Whether the save succeeded or not
                  */
                remove: function ( key ) {
                        try {
diff --git a/resources/src/mediawiki/mediawiki.template.js 
b/resources/src/mediawiki/mediawiki.template.js
index c3db69e..91f1aff 100644
--- a/resources/src/mediawiki/mediawiki.template.js
+++ b/resources/src/mediawiki/mediawiki.template.js
@@ -24,7 +24,7 @@
                 * Get the name of the compiler associated with a template 
based on its name.
                 *
                 * @param {string} templateName Name of template (including 
file suffix)
-                * @return {String} Name of compiler
+                * @return {string} Name of compiler
                 */
                getCompilerName: function ( templateName ) {
                        var templateParts = templateName.split( '.' );
diff --git a/tests/qunit/data/testrunner.js b/tests/qunit/data/testrunner.js
index 01f9625..e7b45bd 100644
--- a/tests/qunit/data/testrunner.js
+++ b/tests/qunit/data/testrunner.js
@@ -8,9 +8,9 @@
        /**
         * Add bogus to url to prevent IE crazy caching
         *
-        * @param {String} value a relative path (eg. 'data/foo.js'
+        * @param {string} value a relative path (eg. 'data/foo.js'
         * or 'data/test.php?foo=bar').
-        * @return {String} Such as 'data/foo.js?131031765087663960'
+        * @return {string} Such as 'data/foo.js?131031765087663960'
         */
        QUnit.fixurl = function ( value ) {
                return value + ( /\?/.test( value ) ? '&' : '?' )
diff --git 
a/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js 
b/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
index 1726a48..cab4080 100644
--- a/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
+++ b/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
@@ -44,9 +44,9 @@
        /**
         * For a value, check if the parser recognizes it and how it transforms 
it
         *
-        * @param {String} msg text to pass on to qunit describing the test case
-        * @param {String[]} parserId of the parser that will be tested
-        * @param {String[][]} data Array of testcases. Each testcase, array of
+        * @param {string} msg text to pass on to qunit describing the test case
+        * @param {string[]} parserId of the parser that will be tested
+        * @param {string[][]} data Array of testcases. Each testcase, array of
         *              inputValue: The string value that we want to test the 
parser for
         *              recognized: If we expect that this value's type is 
detectable by the parser
         *              outputValue: The value the parser has converted the 
input to
diff --git a/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js 
b/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js
index 054bf01..6805eab 100644
--- a/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js
+++ b/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js
@@ -209,8 +209,8 @@
         * Create an HTML table from an array of row arrays containing text 
strings.
         * First row will be header row. No fancy rowspan/colspan stuff.
         *
-        * @param {String[]} header
-        * @param {String[][]} data
+        * @param {string[]} header
+        * @param {string[][]} data
         * @return {jQuery}
         */
        function tableCreate( header, data ) {
@@ -242,7 +242,7 @@
         * Extract text from table.
         *
         * @param {jQuery} $table
-        * @return {String[][]}
+        * @return {string[][]}
         */
        function tableExtract( $table ) {
                var data = [];
@@ -261,10 +261,10 @@
         * Run a table test by building a table with the given data,
         * running some callback on it, then checking the results.
         *
-        * @param {String} msg text to pass on to qunit for the comparison
-        * @param {String[]} header cols to make the table
-        * @param {String[][]} data rows/cols to make the table
-        * @param {String[][]} expected rows/cols to compare against at end
+        * @param {string} msg text to pass on to qunit for the comparison
+        * @param {string[]} header cols to make the table
+        * @param {string[][]} data rows/cols to make the table
+        * @param {string[][]} expected rows/cols to compare against at end
         * @param {function($table)} callback something to do with the table 
before we compare
         */
        function tableTest( msg, header, data, expected, callback ) {
@@ -286,9 +286,9 @@
         * Run a table test by building a table with the given HTML,
         * running some callback on it, then checking the results.
         *
-        * @param {String} msg text to pass on to qunit for the comparison
-        * @param {String} html HTML to make the table
-        * @param {String[][]} expected Rows/cols to compare against at end
+        * @param {string} msg text to pass on to qunit for the comparison
+        * @param {string} html HTML to make the table
+        * @param {string[][]} expected Rows/cols to compare against at end
         * @param {function($table)} callback Something to do with the table 
before we compare
         */
        function tableTestHTML( msg, html, expected, callback ) {
diff --git a/tests/qunit/suites/resources/jquery/jquery.textSelection.test.js 
b/tests/qunit/suites/resources/jquery/jquery.textSelection.test.js
index 2e6f05e..1001679 100644
--- a/tests/qunit/suites/resources/jquery/jquery.textSelection.test.js
+++ b/tests/qunit/suites/resources/jquery/jquery.textSelection.test.js
@@ -11,7 +11,7 @@
         * @param {string} options.output Output
         * @param {int} options.start Starting char for selection
         * @param {int} options.end Ending char for selection
-        * @param {object} options.params Additional parameters for 
$().textSelection( 'encapsulateText' )
+        * @param {Object} options.params Additional parameters for 
$().textSelection( 'encapsulateText' )
         */
        function encapsulateTest( options ) {
                var opt = $.extend( {

-- 
To view, visit https://gerrit.wikimedia.org/r/236344
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I64c3b5bd7afc4686355c80ef68009d978f7b3097
Gerrit-PatchSet: 9
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: Daniel Friesen <[email protected]>
Gerrit-Reviewer: Edokter <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to