Skip to content

Commit

Permalink
Standardize @return, @param, type case.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Apr 14, 2017
1 parent dab794b commit 8cab18b
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 31 deletions.
13 changes: 12 additions & 1 deletion .eslintrc.json
Expand Up @@ -6,7 +6,18 @@
"no-var": "error",
"strict": "error",
"valid-jsdoc": ["error", {
"requireReturn": false
"requireReturn": false,
"prefer": {
"arg": "param",
"argument": "param",
"returns": "return"
},
"preferType": {
"Boolean": "boolean",
"Number": "number",
"String": "string",
"object": "Object"
}
}]
},
"env": {
Expand Down
4 changes: 2 additions & 2 deletions lib/legacy/class.html
Expand Up @@ -37,7 +37,7 @@
*
* @param {Object|Array} behaviors Behavior object or array of behaviors.
* @param {HTMLElement} klass Element class.
* @returns {HTMLElement} Returns a new Element class extended by the
* @return {HTMLElement} Returns a new Element class extended by the
* passed in `behaviors` and also by `Polymer.LegacyElementMixin`.
* @memberof Polymer
*/
Expand Down Expand Up @@ -110,7 +110,7 @@
* @param {Array} behaviors List of behaviors to flatten.
* @param {Array=} list Target list to flatten behaviors into.
* @param {Array=} exclude List of behaviors to exclude from the list.
* @returns {Array} Returns the list of flattened behaviors.
* @return {Array} Returns the list of flattened behaviors.
*/
function flattenBehaviors(behaviors, list, exclude) {
list = list || [];
Expand Down
30 changes: 15 additions & 15 deletions lib/legacy/legacy-element-mixin.html
Expand Up @@ -192,7 +192,7 @@
*
* @param {string} value String to deserialize
* @param {*} type Type to deserialize the string to
* @returns {*} Returns the deserialized value in the `type` given.
* @return {*} Returns the deserialized value in the `type` given.
*/
deserialize(value, type) {
return this._deserializeValue(value, type);
Expand Down Expand Up @@ -276,7 +276,7 @@
* @param {Object} object The object on which to set the prototype.
* @param {Object} prototype The prototype that will be set on the given
* `object`.
* @returns {Object} Returns the given `object` with its prototype set
* @return {Object} Returns the given `object` with its prototype set
* to the given `prototype` object.
*/
chainObject(object, prototype) {
Expand Down Expand Up @@ -389,7 +389,7 @@
* - 'none': disable scrolling for this node
*
* @method setScrollDirection
* @param {String=} direction Direction to allow scrolling
* @param {string=} direction Direction to allow scrolling
* Defaults to `all`.
* @param {HTMLElement=} node Element to apply scroll direction setting.
* Defaults to `this`.
Expand Down Expand Up @@ -529,7 +529,7 @@
* an optional selector may be passed to choose the desired content.
*
* @method getContentChildNodes
* @param {String=} slctr CSS selector to choose the desired
* @param {string=} slctr CSS selector to choose the desired
* `<slot>`. Defaults to `content`.
* @return {Array<Node>} List of distributed nodes for the `<slot>`.
*/
Expand All @@ -548,7 +548,7 @@
* elements are returned.
*
* @method getContentChildNodes
* @param {String=} slctr CSS selector to choose the desired
* @param {string=} slctr CSS selector to choose the desired
* `<content>`. Defaults to `content`.
* @return {Array<HTMLElement>} List of distributed nodes for the
* `<slot>`.
Expand All @@ -564,7 +564,7 @@
*
* @method isLightDescendant
* @param {?Node} node The element to be checked.
* @return {Boolean} true if node is in this element's light DOM tree.
* @return {boolean} true if node is in this element's light DOM tree.
*/
isLightDescendant(node) {
return this !== node && this.contains(node) &&
Expand All @@ -588,8 +588,8 @@

/**
* Returns the computed style value for the given property.
* @param {String} property The css property name.
* @returns {String} Returns the computed css property value for the given
* @param {string} property The css property name.
* @return {string} Returns the computed css property value for the given
* `property`.
*/
getComputedStyleValue(property) {
Expand All @@ -612,12 +612,12 @@
* }
*
* @method debounce
* @param {String} jobName String to indentify the debounce job.
* @param {string} jobName String to indentify the debounce job.
* @param {function()} callback Function that is called (with `this`
* context) when the wait time elapses.
* @param {number} wait Optional wait time in milliseconds (ms) after the
* last signal that must elapse before invoking `callback`
* @returns {Object} Returns a debouncer object on which exists the
* @return {Object} Returns a debouncer object on which exists the
* following methods: `isActive()` returns true if the debouncer is
* active; `cancel()` cancels the debouncer if it is active;
* `flush()` immediately invokes the debounced callback if the debouncer
Expand All @@ -635,7 +635,7 @@
* Returns whether a named debouncer is active.
*
* @method isDebouncerActive
* @param {String} jobName The name of the debouncer started with `debounce`
* @param {string} jobName The name of the debouncer started with `debounce`
* @return {boolean} Whether the debouncer is active (has not yet fired).
*/
isDebouncerActive(jobName) {
Expand All @@ -648,7 +648,7 @@
* Immediately calls the debouncer `callback` and inactivates it.
*
* @method flushDebouncer
* @param {String} jobName The name of the debouncer started with `debounce`
* @param {string} jobName The name of the debouncer started with `debounce`
*/
flushDebouncer(jobName) {
this._debouncers = this._debouncers || {};
Expand All @@ -662,7 +662,7 @@
* Cancels an active debouncer. The `callback` will not be called.
*
* @method cancelDebouncer
* @param {String} jobName The name of the debouncer started with `debounce`
* @param {string} jobName The name of the debouncer started with `debounce`
*/
cancelDebouncer(jobName) {
this._debouncers = this._debouncers || {}
Expand Down Expand Up @@ -768,7 +768,7 @@
* Toggles an HTML attribute on or off.
*
* @method toggleAttribute
* @param {String} name HTML attribute name
* @param {string} name HTML attribute name
* @param {boolean=} bool Boolean to force the attribute on or off.
* When unspecified, the state of the attribute will be reversed.
* @param {HTMLElement=} node Node to target. Defaults to `this`.
Expand All @@ -790,7 +790,7 @@
* Toggles a CSS class on or off.
*
* @method toggleClass
* @param {String} name CSS class name
* @param {string} name CSS class name
* @param {boolean=} bool Boolean to force the class on or off.
* When unspecified, the state of the class will be reversed.
* @param {HTMLElement=} node Node to target. Defaults to `this`.
Expand Down
2 changes: 1 addition & 1 deletion lib/legacy/templatizer-behavior.html
Expand Up @@ -84,7 +84,7 @@
* by `stamp` to create new instances of the template.
*
* @param {HTMLTemplateElement} template Template to prepare
* @param {Boolean=} mutableData When `true`, the generated class will skip
* @param {boolean=} mutableData When `true`, the generated class will skip
* strict dirty-checking for objects and arrays (always consider them to
* be "dirty"). Defaults to false.
*/
Expand Down
8 changes: 4 additions & 4 deletions lib/mixins/element-mixin.html
Expand Up @@ -384,9 +384,9 @@
* @param {HTMLElement} proto Element class prototype to add accessors
* and effects to
* @param {string} name Name of the property.
* @param {object} info Info object from which to create property effects.
* @param {Object} info Info object from which to create property effects.
* Supported keys:
* @param {object} allProps Flattened map of all properties defined in this
* @param {Object} allProps Flattened map of all properties defined in this
* element (including inherited properties)
* @private
*/
Expand Down Expand Up @@ -529,7 +529,7 @@
* }
* }
*
* @returns {HTMLTemplateElement|string} Template to be stamped
* @return {HTMLTemplateElement|string} Template to be stamped
*/
static get template() {
if (!this.hasOwnProperty(goog.reflect.objectProperty('_template', this))) {
Expand All @@ -551,7 +551,7 @@
* matching this element's static `is` property.
* Note, this path should contain a trailing `/`.
*
* @returns {string} The import path for this element class
* @return {string} The import path for this element class
*/
static get importPath() {
if (!this.hasOwnProperty(goog.reflect.objectProperty('_importPath', this))) {
Expand Down
4 changes: 2 additions & 2 deletions lib/mixins/property-effects.html
Expand Up @@ -482,7 +482,7 @@
* @param {Object} templateInfo Template metadata for current template
* @param {Object} binding Binding metadata
* @param {Object} part Binding part metadata
* @param {Number} index Index into `nodeInfoList` for this node
* @param {number} index Index into `nodeInfoList` for this node
*/
function addEffectForBindingPart(constructor, templateInfo, binding, part, index) {
if (!part.literal) {
Expand Down Expand Up @@ -2280,7 +2280,7 @@
* - Inline computed method (supports negation):
* `[[compute(a, 'literal', b)]]`, `[[!compute(a, 'literal', b)]]`
*
* @param {String} text Text to parse from attribute or textContent
* @param {string} text Text to parse from attribute or textContent
* @param {Object} templateInfo Current template metadata
* @return {Array<Object>} Array of binding part metadata
* @protected
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/flattened-nodes-observer.html
Expand Up @@ -57,7 +57,7 @@
* `<slot>` elements assigned to it, these are flattened as well.
*
* @param {Node} node The node for which to return the list of flattened nodes.
* @returns {Array} The list of flattened nodes for the given `node`.
* @return {Array} The list of flattened nodes for the given `node`.
*/
static getFlattenedNodes(node) {
if (isSlot(node)) {
Expand Down
6 changes: 3 additions & 3 deletions lib/utils/gestures.html
Expand Up @@ -263,7 +263,7 @@
*
* @private
* @param {Event} ev Event.
* @returns {HTMLElement} Returns the event target.
* @return {HTMLElement} Returns the event target.
*/
_findOriginalTarget: function(ev) {
// shadowdom
Expand Down Expand Up @@ -379,7 +379,7 @@
* @param {Node} node Node to add listener on
* @param {string} evType Gesture type: `down`, `up`, `track`, or `tap`
* @param {Function} handler Event listener function to call
* @returns {boolean} Returns true if a gesture event listener was added.
* @return {boolean} Returns true if a gesture event listener was added.
*/
addListener: function(node, evType, handler) {
if (this.gestures[evType]) {
Expand All @@ -396,7 +396,7 @@
* @param {string} evType Gesture type: `down`, `up`, `track`, or `tap`
* @param {Function} handler Event listener function previously passed to
* `addListener`.
* @returns {boolean} Returns true if a gesture event listener was removed.
* @return {boolean} Returns true if a gesture event listener was removed.
*/
removeListener: function(node, evType, handler) {
if (this.gestures[evType]) {
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/mixin.html
Expand Up @@ -23,7 +23,7 @@
* Given a mixin producing function, memoize applications of mixin to base
* @private
* @param {Object} mixin Mixin for which to create a caching mixin.
* @returns {Object} Returns a mixin which when applied multiple times to the
* @return {Object} Returns a mixin which when applied multiple times to the
* same base will always return the same extended class.
*/
function cachingMixin(mixin) {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/configure.html
Expand Up @@ -113,7 +113,7 @@

<dom-module id="x-configure-child">
<template>
<x-configure-gchild id="gchild" content="{{content}}" object="{{object}}"></x-configure-gchild>
<x-configure-gchild id="gchild" content="{{content}}" object="{{Object}}"></x-configure-gchild>
</template>
<script>
HTMLImports.whenReady(function() {
Expand Down

0 comments on commit 8cab18b

Please sign in to comment.