From 968e87f36023fc62f8163b7c4a92b2bf8ee09986 Mon Sep 17 00:00:00 2001 From: Stephen Edgar Date: Thu, 18 Jan 2018 20:54:39 +1100 Subject: [PATCH] More JSDoc fixes --- blocks/api/registration.js | 2 +- blocks/api/serializer.js | 6 +++--- blocks/media-upload/index.js | 2 +- components/autocomplete/test/index.js | 2 +- data/index.js | 2 +- editor/store/actions.js | 6 +++--- editor/utils/dom.js | 8 ++++---- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/blocks/api/registration.js b/blocks/api/registration.js index 0afbb701e5dcd..80860c8fc35b4 100644 --- a/blocks/api/registration.js +++ b/blocks/api/registration.js @@ -205,7 +205,7 @@ export function getBlockTypes() { /** * Returns true if the block defines support for a feature, or false otherwise. * - * @param {(String|Object)} nameOrType Block name or type object. + * @param {(string|Object)} nameOrType Block name or type object. * @param {string} feature Feature to test. * @param {boolean} defaultSupports Whether feature is supported by * default if not explicitly defined. diff --git a/blocks/api/serializer.js b/blocks/api/serializer.js index 29fc911efc255..da93b99f2bf73 100644 --- a/blocks/api/serializer.js +++ b/blocks/api/serializer.js @@ -98,10 +98,10 @@ export function getSaveContent( blockType, attributes ) { * This function returns only those attributes which are needed to persist and * which cannot be matched from the block content. * - * @param {Object} allAttributes Attributes from in-memory block data. - * @param {Object} blockType Block type. + * @param {Object} allAttributes Attributes from in-memory block data. + * @param {Object} blockType Block type. * - * @returns {Object} Subset of attributes for comment serialization. + * @returns {Object} Subset of attributes for comment serialization. */ export function getCommentAttributes( allAttributes, blockType ) { const attributes = reduce( blockType.attributes, ( result, attributeSchema, key ) => { diff --git a/blocks/media-upload/index.js b/blocks/media-upload/index.js index 287b999770059..f83b75fa46db0 100644 --- a/blocks/media-upload/index.js +++ b/blocks/media-upload/index.js @@ -19,7 +19,7 @@ const getGalleryDetailsMediaFrame = () => { /** * Create the default states. * - * @returns {void} Void. + * @returns {void} */ createStates: function createStates() { this.states.add( [ diff --git a/components/autocomplete/test/index.js b/components/autocomplete/test/index.js index 505ba6e62fea9..9b71e1258fba4 100644 --- a/components/autocomplete/test/index.js +++ b/components/autocomplete/test/index.js @@ -82,7 +82,7 @@ function par( /* arguments */ ) { * @param {*} wrapper Enzyme wrapper around react node * containing a FakeEditor. * @param {Array.} nodeList Array of dom nodes. - * @param {Array.} cursorPosition Array specifying the child indexes and + * @param {Array.} cursorPosition Array specifying the child indexes and * offset of the cursor. */ function simulateInput( wrapper, nodeList, cursorPosition ) { diff --git a/data/index.js b/data/index.js index f0d14228bd1bd..70b2045647226 100644 --- a/data/index.js +++ b/data/index.js @@ -69,7 +69,7 @@ export function registerSelectors( reducerKey, newSelectors ) { * to determine the data for the * component. * - * @returns {Func} Renders the wrapped component and passes it data. + * @returns {Function} Renders the wrapped component and passes it data. */ export const query = ( mapSelectorsToProps ) => ( WrappedComponent ) => { const connectWithStore = ( ...args ) => { diff --git a/editor/store/actions.js b/editor/store/actions.js index 9529b00ac8ee3..93cfba9099a21 100644 --- a/editor/store/actions.js +++ b/editor/store/actions.js @@ -161,7 +161,7 @@ export function toggleSelection( isSelectionEnabled = true ) { * Returns an action object signalling that a blocks should be replaced with * one or more replacement blocks. * - * @param {(String|String[])} uids Block UID(s) to replace. + * @param {(string|string[])} uids Block UID(s) to replace. * @param {(Object|Object[])} blocks Replacement block(s). * * @returns {Object} Action object. @@ -178,7 +178,7 @@ export function replaceBlocks( uids, blocks ) { * Returns an action object signalling that a single block should be replaced * with one or more replacement blocks. * - * @param {(String|String[])} uid Block UID(s) to replace. + * @param {(string|string[])} uid Block UID(s) to replace. * @param {(Object|Object[])} block Replacement block(s). * * @returns {Object} Action object. @@ -351,7 +351,7 @@ export function stopTyping() { * * @param {string} sidebar Name of the sidebar to toggle * (desktop, mobile or publish). - * @param {Boolean?} forcedValue Force a sidebar state. + * @param {boolean?} forcedValue Force a sidebar state. * * @returns {Object} Action object. */ diff --git a/editor/utils/dom.js b/editor/utils/dom.js index eed1b7028804b..c491ca9f1d70e 100644 --- a/editor/utils/dom.js +++ b/editor/utils/dom.js @@ -201,8 +201,8 @@ export function placeCaretAtHorizontalEdge( container, isReverse ) { * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/caretRangeFromPoint * * @param {Document} doc The document of the range. - * @param {Float} x Horizontal position within the current viewport. - * @param {Float} y Vertical position within the current viewport. + * @param {number} x Horizontal position within the current viewport. + * @param {number} y Vertical position within the current viewport. * * @returns {?Range} The best range for the given point. */ @@ -230,8 +230,8 @@ function caretRangeFromPoint( doc, x, y ) { * This is preferred over getting the UI nodes and set styles there. * * @param {Document} doc The document of the range. - * @param {Float} x Horizontal position within the current viewport. - * @param {Float} y Vertical position within the current viewport. + * @param {number} x Horizontal position within the current viewport. + * @param {number} y Vertical position within the current viewport. * @param {Element} container Container in which the range is expected to be found. * * @returns {?Range} The best range for the given point.