Skip to content

Commit 35b8e04

Browse files
committed
docs: add preceding line break and remove superfluous spacing in JSDoc @returns descriptions
1 parent 3f54b38 commit 35b8e04

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

blocks/autocompleters/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,22 @@ import BlockIcon from '../block-icon';
1919

2020
/**
2121
* @callback FnGetOptions
22+
*
2223
* @returns {Promise.<Array.<CompleterOption>>} A promise that resolves to the list of completer options.
2324
*/
2425

2526
/**
2627
* @callback FnAllowNode
2728
* @param {Node} textNode check if the completer can handle this text node.
29+
*
2830
* @returns {boolean} true if the completer can handle this text node.
2931
*/
3032

3133
/**
3234
* @callback FnAllowContext
3335
* @param {Range} before the range before the auto complete trigger and query.
3436
* @param {Range} after the range after the autocomplete trigger and query.
37+
*
3538
* @returns {boolean} true if the completer can handle these ranges.
3639
*/
3740

@@ -40,6 +43,7 @@ import BlockIcon from '../block-icon';
4043
* @param {*} value the value of the completer option.
4144
* @param {Range} range the nodes included in the autocomplete trigger and query.
4245
* @param {String} query the text value of the autocomplete query.
46+
*
4347
* @returns {?Component} optional html to replace the range.
4448
*/
4549

@@ -58,7 +62,8 @@ import BlockIcon from '../block-icon';
5862
* The definition can be understood by the Autocomplete component.
5963
*
6064
* @param {Function} onReplace Callback to replace the current block.
61-
* @returns {Completer} Completer object used by the Autocomplete component.
65+
*
66+
* @returns {Completer} Completer object used by the Autocomplete component.
6267
*/
6368
export function blockAutocompleter( { onReplace } ) {
6469
// Prioritize common category in block type options

blocks/image-placeholder/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import MediaUploadButton from '../media-upload-button';
1414
* ImagePlaceHolder is a react component used by blocks containing user configurable images e.g: image and cover image.
1515
*
1616
* @param {Object} props React props passed to the component.
17-
* @returns {Object} Rendered placeholder.
17+
*
18+
* @returns {Object} Rendered placeholder.
1819
*/
1920
export default function ImagePlaceHolder( { className, icon, label, onSelectImage } ) {
2021
const setImage = ( [ image ] ) => onSelectImage( image );

components/autocomplete/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const { ENTER, ESCAPE, UP, DOWN, LEFT, RIGHT, SPACE } = keycodes;
2626
/**
2727
* Recursively select the firstChild until hitting a leaf node.
2828
* @param {Node} node the node to find the recursive first child.
29+
*
2930
* @returns {Node} the first leaf-node >= node in the ordering.
3031
*/
3132
function descendFirst( node ) {
@@ -39,6 +40,7 @@ function descendFirst( node ) {
3940
/**
4041
* Recursively select the lastChild until hitting a leaf node.
4142
* @param {Node} node the node to find the recursive last child.
43+
*
4244
* @returns {Node} the first leaf-node <= node in the ordering.
4345
*/
4446
function descendLast( node ) {
@@ -52,6 +54,7 @@ function descendLast( node ) {
5254
/**
5355
* Is the node a text node.
5456
* @param {?Node} node the node to check.
57+
*
5558
* @returns {boolean} true if the node is a text node.
5659
*/
5760
function isTextNode( node ) {
@@ -61,6 +64,7 @@ function isTextNode( node ) {
6164
/**
6265
* Return the node only if it is a text node, otherwise return null.
6366
* @param {?Node} node the node to filter.
67+
*
6468
* @returns {?Node} the node or null if it is not a text node.
6569
*/
6670
function onlyTextNode( node ) {
@@ -70,6 +74,7 @@ function onlyTextNode( node ) {
7074
/**
7175
* Find the index of the last charater in the text that is whitespace.
7276
* @param {String} text the text to search.
77+
*
7378
* @returns {Number} the last index of a white space character in the text or -1.
7479
*/
7580
function lastIndexOfSpace( text ) {

components/autocomplete/test/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ function makeAutocompleter( completers, AutocompleteComponent = Autocomplete ) {
5555
/**
5656
* Create a text node
5757
* @param {String} text text of text node.
58+
5859
* @returns {Node} a text node.
5960
*/
6061
function tx( text ) {
@@ -63,6 +64,7 @@ function tx( text ) {
6364

6465
/**
6566
* Create a paragraph node with the arguments as children
67+
6668
* @returns {Node} a paragraph node.
6769
*/
6870
function par( /* arguments */ ) {

editor/store/actions.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import { partial, castArray } from 'lodash';
1010
*
1111
* @param {Object} post Post object
1212
* @param {Object} settings Editor settings object
13-
* @returns {Object} Action object
13+
*
14+
* @returns {Object} Action object.
1415
*/
1516
export function setupEditor( post, settings ) {
1617
return {

0 commit comments

Comments
 (0)