build: Enable jscs jsDoc rule 'checkRedundantReturns' and make pass
authorJames D. Forrester <jforrester@wikimedia.org>
Sat, 5 Sep 2015 19:15:01 +0000 (12:15 -0700)
committerTimo Tijhof <krinklemail@gmail.com>
Wed, 23 Sep 2015 07:29:43 +0000 (08:29 +0100)
Change-Id: I5006ea3df6798201edfacbf8ad4624266554f064

.jscsrc
resources/src/jquery/jquery.suggestions.js
resources/src/mediawiki.messagePoster/mediawiki.messagePoster.MessagePoster.js
resources/src/mediawiki.widgets/mw.widgets.CalendarWidget.js
resources/src/mediawiki/mediawiki.htmlform.js

diff --git a/.jscsrc b/.jscsrc
index aaa876c..46d98aa 100644 (file)
--- a/.jscsrc
+++ b/.jscsrc
@@ -7,6 +7,7 @@
        "disallowQuotedKeysInObjects": "allButReserved",
        "requireDotNotation": { "allExcept": [ "keywords" ] },
        "jsDoc": {
+               "checkRedundantReturns": true,
                "requireNewlineAfterDescription": true,
                "requireParamTypes": true,
                "requireReturnTypes": true
index dc1c779..4d53546 100644 (file)
  *
  * @class jQuery.plugin.suggestions
  */
+
 /**
  * @method suggestions
- * @return {jQuery}
  * @chainable
+ * @return {jQuery}
  *
  * @param {Object} options
  *
@@ -92,6 +93,7 @@
  * @param {boolean} [options.highlightInput=false] Whether to highlight matched portions of the
  *  input or not.
  */
+
 ( function ( $ ) {
 
 var hasOwn = Object.hasOwnProperty;
index 91366ff..113fb00 100644 (file)
@@ -16,6 +16,7 @@
        /**
         * Post a message (with subject and body) to a talk page.
         *
+        * @abstract
         * @param {string} subject Subject/topic title; plaintext only (no wikitext or HTML)
         * @param {string} body Body, as wikitext.  Signature code will automatically be added
         *   by MessagePosters that require one, unless the message already contains the string
index 49acfef..9535481 100644 (file)
         * @param {string|null} [fade=null] Direction in which to fade out current calendar contents,
         *     'previous', 'next', 'up' or 'down'; or 'auto', which has the same result as 'previous' or
         *     'next' depending on whether the current date is later or earlier than the previous.
-        * @returns {string} Format
         */
        mw.widgets.CalendarWidget.prototype.updateUI = function ( fade ) {
                var items, today, selected, currentMonth, currentYear, currentDay, i, needsFade,
index 8c6f3ab..c323e8d 100644 (file)
         * @param {Function} callback
         * @param {boolean|jQuery.Event} callback.immediate True when the event is called immediately,
         *  an event object when triggered from an event.
-        * @return {jQuery}
         * @chainable
+        * @return {jQuery}
         */
        mw.log.deprecate( $.fn, 'liveAndTestAtStart', function ( callback ) {
-               this
+               return this
                        // Can't really migrate to .on() generically, needs knowledge of
                        // calling code to know the correct selector. Fix callers and
                        // get rid of this .liveAndTestAtStart() hack.