diff options
author | Jake Spurlock <whyisjake@git.wordpress.org> | 2020-07-27 23:33:51 +0000 |
---|---|---|
committer | Jake Spurlock <whyisjake@git.wordpress.org> | 2020-07-27 23:33:51 +0000 |
commit | 9ed92faaca92f66ec9e2979c9d896ddab3e4e993 (patch) | |
tree | 6eb6989411e67d7bef774d4db3690d51da9a0ec0 /src/js/_enqueues/wp/api.js | |
parent | a1a1173250df598ba12523132743dfdf41770f9b (diff) | |
download | wordpress-9ed92faaca92f66ec9e2979c9d896ddab3e4e993.tar.gz wordpress-9ed92faaca92f66ec9e2979c9d896ddab3e4e993.zip |
Build/Test Tools: Enable JSDocs to be linted with ESLint.
As part of the [Javascript Inline Docs Initiative](https://make.wordpress.org/core/handbook/docs/inline/js/) this add some tooling to lint Javascript docblocks. Two new commands:
* `npm run lint:jsdoc`
* `npm run lint:jsdoc:fix`
The latter will run the linter and try to fix an possible issues automatically.
Fixes #43828.
Props netweb, atimmer, kamataryo, whyisjake.
git-svn-id: https://develop.svn.wordpress.org/trunk@48650 602fd350-edb4-49c9-b593-d223f7449a82
Diffstat (limited to 'src/js/_enqueues/wp/api.js')
-rw-r--r-- | src/js/_enqueues/wp/api.js | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/js/_enqueues/wp/api.js b/src/js/_enqueues/wp/api.js index f92218a621..6484e9d2b6 100644 --- a/src/js/_enqueues/wp/api.js +++ b/src/js/_enqueues/wp/api.js @@ -186,7 +186,7 @@ * Extract a route part based on negative index. * * @param {string} route The endpoint route. - * @param {int} part The number of parts from the end of the route to retrieve. Default 1. + * @param {number} part The number of parts from the end of the route to retrieve. Default 1. * Example route `/a/b/c`: part 1 is `c`, part 2 is `b`, part 3 is `a`. * @param {string} [versionString] Version string, defaults to `wp.api.versionString`. * @param {boolean} [reverse] Whether to reverse the order when extracting the route part. Optional, default false. @@ -234,7 +234,7 @@ /** * Add args and options to a model prototype from a route's endpoints. * - * @param {array} routeEndpoints Array of route endpoints. + * @param {Array} routeEndpoints Array of route endpoints. * @param {Object} modelInstance An instance of the model (or collection) * to add the args to. */ @@ -361,7 +361,7 @@ * Build a helper function to retrieve related model. * * @param {string} parentModel The parent model. - * @param {int} modelId The model ID if the object to request + * @param {number} modelId The model ID if the object to request * @param {string} modelName The model name to use when constructing the model. * @param {string} embedSourcePoint Where to check the embedds object for _embed data. * @param {string} embedCheckField Which model field to check to see if the model has data. @@ -513,7 +513,7 @@ * * @param {string} key The meta key. * - * @return {object} The post meta value. + * @return {Object} The post meta value. */ getMeta: function( key ) { var metas = this.get( 'meta' ); @@ -523,7 +523,7 @@ /** * Get all meta key/values for a post. * - * @return {object} The post metas, as a key value pair object. + * @return {Object} The post metas, as a key value pair object. */ getMetas: function() { return this.get( 'meta' ); @@ -532,7 +532,7 @@ /** * Set a group of meta key/values for a post. * - * @param {object} meta The post meta to set, as key/value pairs. + * @param {Object} meta The post meta to set, as key/value pairs. */ setMetas: function( meta ) { var metas = this.get( 'meta' ); @@ -544,7 +544,7 @@ * Set a single meta value for a post, by key. * * @param {string} key The meta key. - * @param {object} value The meta value. + * @param {Object} value The meta value. */ setMeta: function( key, value ) { var metas = this.get( 'meta' ); @@ -589,7 +589,7 @@ * * Accepts an array of tag slugs, or a Tags collection. * - * @param {array|Backbone.Collection} tags The tags to set on the post. + * @param {Array|Backbone.Collection} tags The tags to set on the post. * */ setTags: function( tags ) { @@ -635,7 +635,7 @@ * * Accepts a Tags collection. * - * @param {array|Backbone.Collection} tags The tags to set on the post. + * @param {Array|Backbone.Collection} tags The tags to set on the post. * */ setTagsWithCollection: function( tags ) { @@ -673,7 +673,7 @@ * * Accepts an array of category slugs, or a Categories collection. * - * @param {array|Backbone.Collection} categories The categories to set on the post. + * @param {Array|Backbone.Collection} categories The categories to set on the post. * */ setCategories: function( categories ) { @@ -720,7 +720,7 @@ * * Accepts Categories collection. * - * @param {array|Backbone.Collection} categories The categories to set on the post. + * @param {Array|Backbone.Collection} categories The categories to set on the post. * */ setCategoriesWithCollection: function( categories ) { @@ -1495,11 +1495,11 @@ /** * Initialize the wp-api, optionally passing the API root. * - * @param {object} [args] + * @param {Object} [args] * @param {string} [args.nonce] The nonce. Optional, defaults to wpApiSettings.nonce. * @param {string} [args.apiRoot] The api root. Optional, defaults to wpApiSettings.root. * @param {string} [args.versionString] The version string. Optional, defaults to wpApiSettings.root. - * @param {object} [args.schema] The schema. Optional, will be fetched from API if not provided. + * @param {Object} [args.schema] The schema. Optional, will be fetched from API if not provided. */ wp.api.init = function( args ) { var endpoint, attributes = {}, deferred, promise; |