diff --git a/package-lock.json b/package-lock.json index 8dfa87d9460839..98cb8029eb2116 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2286,16 +2286,22 @@ "integrity": "sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==" }, "@es-joy/jsdoccomment": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.4.4.tgz", - "integrity": "sha512-ua4qDt9dQb4qt5OI38eCZcQZYE5Bq3P0GzgvDARdT8Lt0mAUpxKTPy8JGGqEvF77tG1irKDZ3WreeezEa3P43w==", + "version": "0.10.8", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.10.8.tgz", + "integrity": "sha512-3P1JiGL4xaR9PoTKUHa2N/LKwa2/eUdRqGwijMWWgBqbFEqJUVpmaOi2TcjcemrsRMgFLBzQCK4ToPhrSVDiFQ==", "dev": true, "requires": { - "comment-parser": "^1.1.5", + "comment-parser": "1.2.4", "esquery": "^1.4.0", - "jsdoctypeparser": "^9.0.0" + "jsdoc-type-pratt-parser": "1.1.1" }, "dependencies": { + "comment-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.2.4.tgz", + "integrity": "sha512-pm0b+qv+CkWNriSTMsfnjChF9kH0kxz55y44Wo5le9qLxMj5xDQAaEd9ZN1ovSuk9CsrncWaFwgpOMg7ClJwkw==", + "dev": true + }, "esquery": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", @@ -18572,7 +18578,7 @@ "eslint-config-prettier": "^7.1.0", "eslint-plugin-import": "^2.23.4", "eslint-plugin-jest": "^24.1.3", - "eslint-plugin-jsdoc": "^34.1.0", + "eslint-plugin-jsdoc": "^36.0.8", "eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-prettier": "^3.3.0", "eslint-plugin-react": "^7.22.0", @@ -34672,26 +34678,32 @@ } }, "eslint-plugin-jsdoc": { - "version": "34.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-34.1.0.tgz", - "integrity": "sha512-7uk6vD92LCGBLwl7imvf7YzZrMbLmHZVSULBJClZpYTNdTpPXOtuPNKDi8nLcXYtZf3UopNs5qR7coapBSaUtw==", + "version": "36.0.8", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-36.0.8.tgz", + "integrity": "sha512-brNjHvRuBy5CaV01mSp6WljrO/T8fHNj0DXG38odOGDnhI7HdcbLKX7DpSvg2Rfcifwh8GlnNFzx13sI05t3bg==", "dev": true, "requires": { - "@es-joy/jsdoccomment": "^0.4.4", - "comment-parser": "1.1.5", - "debug": "^4.3.1", + "@es-joy/jsdoccomment": "0.10.8", + "comment-parser": "1.2.4", + "debug": "^4.3.2", "esquery": "^1.4.0", - "jsdoctypeparser": "^9.0.0", + "jsdoc-type-pratt-parser": "^1.1.1", "lodash": "^4.17.21", - "regextras": "^0.7.1", + "regextras": "^0.8.0", "semver": "^7.3.5", "spdx-expression-parse": "^3.0.1" }, "dependencies": { + "comment-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.2.4.tgz", + "integrity": "sha512-pm0b+qv+CkWNriSTMsfnjChF9kH0kxz55y44Wo5le9qLxMj5xDQAaEd9ZN1ovSuk9CsrncWaFwgpOMg7ClJwkw==", + "dev": true + }, "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "requires": { "ms": "2.1.2" @@ -34712,12 +34724,6 @@ "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", "dev": true }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -44203,10 +44209,10 @@ } } }, - "jsdoctypeparser": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz", - "integrity": "sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw==", + "jsdoc-type-pratt-parser": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-1.1.1.tgz", + "integrity": "sha512-uelRmpghNwPBuZScwgBG/OzodaFk5RbO5xaivBdsAY70icWfShwZ7PCMO0x1zSkOa8T1FzHThmrdoyg/0AwV5g==", "dev": true }, "jsdom": { @@ -54226,9 +54232,9 @@ } }, "regextras": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.7.1.tgz", - "integrity": "sha512-9YXf6xtW+qzQ+hcMQXx95MOvfqXFgsKDZodX3qZB0x2n5Z94ioetIITsBtvJbiOyxa/6s9AtyweBLCdPmPko/w==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/regextras/-/regextras-0.8.0.tgz", + "integrity": "sha512-k519uI04Z3SaY0fLX843MRXnDeG2+vHOFsyhiPZvNLe7r8rD2YNRjq4BQLZZ0oAr2NrtvZlICsXysGNFPGa3CQ==", "dev": true }, "regjsgen": { diff --git a/packages/block-editor/src/store/actions.js b/packages/block-editor/src/store/actions.js index 38dd3500e7d871..0e6a3f50974110 100644 --- a/packages/block-editor/src/store/actions.js +++ b/packages/block-editor/src/store/actions.js @@ -123,6 +123,7 @@ export function* validateBlocksToTemplate( blocks ) { * text value. See `wp.richText.create`. */ +/* eslint-disable jsdoc/valid-types */ /** * Returns an action object used in signalling that selection state should be * reset to the specified selection. @@ -138,6 +139,7 @@ export function resetSelection( selectionEnd, initialPosition ) { + /* eslint-enable jsdoc/valid-types */ return { type: 'RESET_SELECTION', selectionStart, @@ -209,6 +211,7 @@ export function updateBlock( clientId, updates ) { }; } +/* eslint-disable jsdoc/valid-types */ /** * Returns an action object used in signalling that the block with the * specified client ID has been selected, optionally accepting a position @@ -222,6 +225,7 @@ export function updateBlock( clientId, updates ) { * @return {Object} Action object. */ export function selectBlock( clientId, initialPosition = 0 ) { + /* eslint-enable jsdoc/valid-types */ return { type: 'SELECT_BLOCK', initialPosition, @@ -389,6 +393,7 @@ function getBlocksWithDefaultStylesApplied( blocks, blockEditorSettings ) { } ); } +/* eslint-disable jsdoc/valid-types */ /** * Returns an action object signalling that a blocks should be replaced with * one or more replacement blocks. @@ -408,6 +413,7 @@ export function* replaceBlocks( initialPosition = 0, meta ) { + /* eslint-enable jsdoc/valid-types */ clientIds = castArray( clientIds ); blocks = getBlocksWithDefaultStylesApplied( castArray( blocks ), @@ -594,6 +600,7 @@ export function insertBlock( ); } +/* eslint-disable jsdoc/valid-types */ /** * Returns an action object used in signalling that an array of blocks should * be inserted, optionally at a specific index respective a root block list. @@ -614,6 +621,7 @@ export function* insertBlocks( initialPosition = 0, meta ) { + /* eslint-enable jsdoc/valid-types */ if ( isObject( initialPosition ) ) { meta = initialPosition; initialPosition = 0; @@ -954,6 +962,7 @@ export function removeBlock( clientId, selectPrevious ) { return removeBlocks( [ clientId ], selectPrevious ); } +/* eslint-disable jsdoc/valid-types */ /** * Returns an action object used in signalling that the inner blocks with the * specified client ID should be replaced. @@ -970,6 +979,7 @@ export function replaceInnerBlocks( updateSelection = false, initialPosition = 0 ) { + /* eslint-enable jsdoc/valid-types */ return { type: 'REPLACE_INNER_BLOCKS', rootClientId, diff --git a/packages/block-editor/src/store/selectors.js b/packages/block-editor/src/store/selectors.js index d10a80d83e2451..6a51a62209d983 100644 --- a/packages/block-editor/src/store/selectors.js +++ b/packages/block-editor/src/store/selectors.js @@ -636,6 +636,7 @@ export function getNextBlockClientId( state, startClientId ) { return getAdjacentBlockClientId( state, startClientId, 1 ); } +/* eslint-disable jsdoc/valid-types */ /** * Returns the initial caret position for the selected block. * This position is to used to position the caret properly when the selected block changes. @@ -646,6 +647,7 @@ export function getNextBlockClientId( state, startClientId ) { * @return {0|-1|null} Initial position. */ export function getSelectedBlocksInitialCaretPosition( state ) { + /* eslint-enable jsdoc/valid-types */ return state.initialPosition; } diff --git a/packages/block-library/src/gallery/v1/tiles.native.js b/packages/block-library/src/gallery/v1/tiles.native.js index c5ce52b4ba24ba..30126ce872593e 100644 --- a/packages/block-library/src/gallery/v1/tiles.native.js +++ b/packages/block-library/src/gallery/v1/tiles.native.js @@ -23,7 +23,8 @@ function Tiles( props ) { const lastRow = Math.floor( lastTile / columns ); const wrappedChildren = Children.map( children, ( child, index ) => { - /** Since we don't have `calc()`, we must calculate our spacings here in + /** + * Since we don't have `calc()`, we must calculate our spacings here in * order to preserve even spacing between tiles and equal width for tiles * in a given row. * diff --git a/packages/components/src/animate/index.js b/packages/components/src/animate/index.js index 95fba645fd1782..1ef1e272dbb453 100644 --- a/packages/components/src/animate/index.js +++ b/packages/components/src/animate/index.js @@ -8,7 +8,7 @@ import classnames from 'classnames'; * @typedef {'left' | 'right'} SlideInOrigin * @typedef {{ type: 'appear'; origin?: AppearOrigin }} AppearOptions * @typedef {{ type: 'slide-in'; origin?: SlideInOrigin }} SlideInOptions - * @typedef {{ type: 'loading'; }} LoadingOptions + * @typedef {{ type: 'loading' }} LoadingOptions * @typedef {AppearOptions | SlideInOptions | LoadingOptions} GetAnimateOptions */ diff --git a/packages/components/src/ui/context/use-context-system.js b/packages/components/src/ui/context/use-context-system.js index 4a842033a2a2f3..134ef9046b849d 100644 --- a/packages/components/src/ui/context/use-context-system.js +++ b/packages/components/src/ui/context/use-context-system.js @@ -13,7 +13,7 @@ import { useCx } from '../../utils/hooks/use-cx'; /** * @template TProps - * @typedef {TProps & { className: string; }} ConnectedProps + * @typedef {TProps & { className: string }} ConnectedProps */ /** diff --git a/packages/dom/src/dom/caret-range-from-point.js b/packages/dom/src/dom/caret-range-from-point.js index a3f83926f083a2..8839e0861f0ab3 100644 --- a/packages/dom/src/dom/caret-range-from-point.js +++ b/packages/dom/src/dom/caret-range-from-point.js @@ -5,8 +5,8 @@ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/caretRangeFromPoint * * @param {DocumentMaybeWithCaretPositionFromPoint} doc The document of the range. - * @param {number} x Horizontal position within the current viewport. - * @param {number} 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. * * @return {Range | null} The best range for the given point. */ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 5b8830ff10c976..f1df1f4c7433e3 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Enhancement + +- The bundled `eslint-plugin-jsdoc` dependency has been updated from requiring `^34.1.0` to requiring `^36.0.8` ([#34338](https://github.com/WordPress/gutenberg/pull/34338)). + ### Bug Fix - The recommended configuration will now respect `type` imports in TypeScript files ([#34055](https://github.com/WordPress/gutenberg/pull/34055)). diff --git a/packages/eslint-plugin/configs/jsdoc.js b/packages/eslint-plugin/configs/jsdoc.js index b8f658433aad22..d114241361a070 100644 --- a/packages/eslint-plugin/configs/jsdoc.js +++ b/packages/eslint-plugin/configs/jsdoc.js @@ -105,6 +105,11 @@ module.exports = { 'jsdoc/require-param-description': 'off', 'jsdoc/require-returns': 'off', 'jsdoc/require-yields': 'off', + 'jsdoc/tag-lines': 'off', + 'jsdoc/no-multi-asterisks': [ + 'error', + { preventAtMiddleLines: false }, + ], 'jsdoc/check-access': 'error', 'jsdoc/check-alignment': 'error', 'jsdoc/check-line-alignment': [ diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index ed0b6d76cea633..29a7afbc65f507 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -39,7 +39,7 @@ "eslint-config-prettier": "^7.1.0", "eslint-plugin-import": "^2.23.4", "eslint-plugin-jest": "^24.1.3", - "eslint-plugin-jsdoc": "^34.1.0", + "eslint-plugin-jsdoc": "^36.0.8", "eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-prettier": "^3.3.0", "eslint-plugin-react": "^7.22.0",