Jforrester has uploaded a new change for review.
https://gerrit.wikimedia.org/r/247736
Change subject: build: Enable jscs-jsdoc's 'requireReturnTypes' rule and make
pass
......................................................................
build: Enable jscs-jsdoc's 'requireReturnTypes' rule and make pass
Change-Id: I3c9fe9d435f7048baad4f79d1302b7718f8fd947
---
M .jscsrc
M resources/mw.GroupProgressBar.js
M resources/mw.LanguageUpWiz.js
M resources/mw.UploadWizard.js
M resources/mw.UploadWizardDeed.js
M resources/mw.UploadWizardDescription.js
M resources/mw.UploadWizardLicenseInput.js
M resources/mw.UploadWizardUpload.js
M resources/mw.canvas.js
M resources/mw.fileApi.js
M resources/transports/mw.FormDataTransport.js
11 files changed, 20 insertions(+), 19 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard
refs/changes/36/247736/1
diff --git a/.jscsrc b/.jscsrc
index 527b20c..f049b84 100644
--- a/.jscsrc
+++ b/.jscsrc
@@ -7,7 +7,8 @@
"extra": {
"see": true
}
- }
+ },
+ "requireReturnTypes": true
},
"excludeFiles": [ "resources/jquery/**" ]
diff --git a/resources/mw.GroupProgressBar.js b/resources/mw.GroupProgressBar.js
index f784f3f..4b5ec17 100644
--- a/resources/mw.GroupProgressBar.js
+++ b/resources/mw.GroupProgressBar.js
@@ -155,7 +155,7 @@
* Calculate remaining time for all uploads to complete.
*
* @param fraction fraction of progress to show
- * @return estimated time remaining (in milliseconds)
+ * @return {number} estimated time remaining (in milliseconds)
*/
getRemainingTime: function ( fraction ) {
var elapsedTime, rate;
diff --git a/resources/mw.LanguageUpWiz.js b/resources/mw.LanguageUpWiz.js
index 25a38f2..441e2b6 100644
--- a/resources/mw.LanguageUpWiz.js
+++ b/resources/mw.LanguageUpWiz.js
@@ -87,7 +87,7 @@
*
* @param name desired name of select element
* @param code selected language code
- * @return HTML select element configured as desired
+ * @return {HTML} select element configured as desired
*/
getMenu: function ( name, code ) {
var $select;
@@ -133,7 +133,7 @@
*
* @param code A string representing a language code, which we
may or may not have.
* Expected to be separated with
dashes as codes from ISO 639, e.g. "zh-tw" for Chinese ( Traditional )
- * @return a language code which is close to the supplied
parameter, or fall back to mw.LanguageUpWiz.defaultCode
+ * @return {string} a language code which is close to the
supplied parameter, or fall back to mw.LanguageUpWiz.defaultCode
*/
getClosest: function ( code ) {
mw.LanguageUpWiz.initialize();
diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js
index 035f597..14ea458 100644
--- a/resources/mw.UploadWizard.js
+++ b/resources/mw.UploadWizard.js
@@ -248,7 +248,7 @@
* and UI for the upload itself and the "details" at the
second step of the wizard.
* we don't yet add it to the list of uploads; that only
happens when it gets a real file.
*
- * @return the new upload
+ * @return {UploadWizardUpload|false} the new upload
*/
newUpload: function () {
var upload,
diff --git a/resources/mw.UploadWizardDeed.js b/resources/mw.UploadWizardDeed.js
index 6717d85..ffeb646 100644
--- a/resources/mw.UploadWizardDeed.js
+++ b/resources/mw.UploadWizardDeed.js
@@ -59,7 +59,7 @@
/**
* Get wikitext representing the licenses selected in the
license object
*
- * @return wikitext of all applicable license templates.
+ * @return {string} wikitext of all applicable license
templates.
*/
getLicenseWikiText: function () {
return this.licenseInput.getWikiText();
@@ -106,7 +106,7 @@
/**
* Is this correctly set, with side effects of causing
errors to show in interface.
*
- * @return boolean true if valid, false if not
+ * @return {boolean} true if valid, false if not
*/
valid: function () {
// n.b. valid() has side effects and both
should be called every time the function is called.
@@ -429,7 +429,7 @@
* this is exactly the same as the ownwork valid()
function... hopefully we can reduce these to nothing if we make
* all validators work the same.
*
- * @return boolean true if valid, false if not
+ * @return {boolean} true if valid, false if not
*/
valid: function () {
// n.b. valid() has side effects and both
should be called every time the function is called.
@@ -519,7 +519,7 @@
/**
* Check if this form is filled out correctly, with side
effects of showing error messages if invalid
*
- * @return boolean; true if valid, false if not
+ * @return {boolean} true if valid, false if not
*/
valid: function () {
// we assume there is always a deed available, even if
it's just the null deed.
diff --git a/resources/mw.UploadWizardDescription.js
b/resources/mw.UploadWizardDescription.js
index 6845c41..2f56fc4 100644
--- a/resources/mw.UploadWizardDescription.js
+++ b/resources/mw.UploadWizardDescription.js
@@ -122,7 +122,7 @@
/**
* defer adding rules until it's in a form
*
- * @return validator
+ * @return {Object|false} validator
*/
addValidationRules: function ( required ) {
// Make sure the keyup event doesn't bubble...we don't
care
diff --git a/resources/mw.UploadWizardLicenseInput.js
b/resources/mw.UploadWizardLicenseInput.js
index 5af7be5..cbcdf7f 100644
--- a/resources/mw.UploadWizardLicenseInput.js
+++ b/resources/mw.UploadWizardLicenseInput.js
@@ -431,7 +431,7 @@
/**
* Gets the wikitext associated with all selected inputs. Some
inputs also have associated textareas so we append their contents too.
- * @return string of wikitext (empty string if no inputs set)
+ * @return {string} of wikitext (empty string if no inputs set)
*/
getWikiText: function () {
var input = this,
@@ -477,7 +477,7 @@
* Side effect: if no valid value, add error notices to the
interface. Add listeners to interface, to revalidate and remove notices
* If I was sufficiently clever, most of these could just be
dynamically added & subtracted validation rules.
* Instead this is a bit of a recapitulation of jquery.validate
- * @return boolean; true if a value set and all is well, false
otherwise
+ * @return {boolean} true if a value set and all is well, false
otherwise
*/
valid: function () {
var input = this,
@@ -535,7 +535,7 @@
/**
* Returns true if any license is set
- * @return boolean
+ * @return {boolean}
*/
isSet: function () {
return this.getSelectedInputs().length > 0;
diff --git a/resources/mw.UploadWizardUpload.js
b/resources/mw.UploadWizardUpload.js
index 935ef06..b9b8059 100644
--- a/resources/mw.UploadWizardUpload.js
+++ b/resources/mw.UploadWizardUpload.js
@@ -786,7 +786,7 @@
/**
* Get the upload handler per browser capabilities
- * @return upload handler object
+ * @return {ApiUploadHandler} upload handler object
*/
mw.UploadWizardUpload.prototype.getUploadHandler = function () {
var constructor; // must be the name of a function in 'mw'
namespace
diff --git a/resources/mw.canvas.js b/resources/mw.canvas.js
index dcbae0a..43b09e3 100644
--- a/resources/mw.canvas.js
+++ b/resources/mw.canvas.js
@@ -2,7 +2,7 @@
mw.canvas = {
/**
- * @return boolean
+ * @return {boolean}
*/
isAvailable: function () {
return !!( document.createElement( 'canvas'
).getContext );
diff --git a/resources/mw.fileApi.js b/resources/mw.fileApi.js
index 0bbfbfd..910bd15 100644
--- a/resources/mw.fileApi.js
+++ b/resources/mw.fileApi.js
@@ -19,7 +19,7 @@
* TODO put SVG back after working around Firefox 7 bug
<https://bugzilla.wikimedia.org/show_bug.cgi?id=31643>
*
* @param {File} file
- * @return boolean
+ * @return {boolean}
*/
isPreviewableFile: function ( file ) {
var known = [ 'image/png', 'image/gif',
'image/jpeg' ],
@@ -31,7 +31,7 @@
* Check if this is a recognizable video type...
*
* @param {File} file
- * @return boolean
+ * @return {boolean}
*/
isPreviewableVideo: function ( file ) {
var video = document.createElement( 'video' );
diff --git a/resources/transports/mw.FormDataTransport.js
b/resources/transports/mw.FormDataTransport.js
index c1e56c0..e60b94f 100644
--- a/resources/transports/mw.FormDataTransport.js
+++ b/resources/transports/mw.FormDataTransport.js
@@ -56,7 +56,7 @@
/**
* Creates an XHR and sets some generic event handlers on it.
* @param {jQuery.Deferred} deferred Object to send events to.
- * @return XMLHttpRequest
+ * @return {XMLHttpRequest}
*/
mw.FormDataTransport.prototype.createXHR = function ( deferred ) {
var xhr = new XMLHttpRequest(),
@@ -77,7 +77,7 @@
* Creates a FormData object suitable for upload.
* @param {string} filename
* @param {number} [offset] For chunked uploads
- * @return FormData
+ * @return {FormData}
*/
mw.FormDataTransport.prototype.createFormData = function ( filename,
offset ) {
var formData;
--
To view, visit https://gerrit.wikimedia.org/r/247736
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c9fe9d435f7048baad4f79d1302b7718f8fd947
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits