From e3aa8b73469d6858534274972f36cbc17a3a224f Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Mon, 13 Nov 2023 14:03:11 +0000 Subject: [PATCH] jsdoc: Update eslint-plugin-jsdoc to 46.9.0 --- jsdoc.json | 8 +- package-lock.json | 99 ++++++++++++---------- package.json | 2 +- test/fixtures/jsdoc/invalid.js | 140 ++++++++++++++++++++++---------- test/fixtures/jsdoc/valid.js | 15 +++- test/fixtures/jsduck/invalid.js | 6 +- 6 files changed, 175 insertions(+), 95 deletions(-) diff --git a/jsdoc.json b/jsdoc.json index 94f4d6ac..0a911583 100644 --- a/jsdoc.json +++ b/jsdoc.json @@ -34,7 +34,8 @@ "set": "Set", "String": "string", "Undefined": "undefined" - } + }, + "mode": "jsdoc" } }, "rules": { @@ -51,6 +52,9 @@ ], "jsdoc/check-values": "off", "jsdoc/empty-tags": "off", + "jsdoc/no-blank-blocks": "warn", + "jsdoc/no-blank-block-descriptions": "warn", + "jsdoc/no-defaults": "off", "jsdoc/no-multi-asterisks": [ "error", { "allowWhitespace": true } ], "jsdoc/require-asterisk-prefix": "error", "jsdoc/require-jsdoc": "off", @@ -59,6 +63,6 @@ "jsdoc/require-property-description": "off", "jsdoc/require-property-name": "off", "jsdoc/require-returns-description": "off", - "jsdoc/tag-lines": "off" + "jsdoc/tag-lines": [ "warn", "any", { "startLines": 1 } ] } } diff --git a/package-lock.json b/package-lock.json index 266a684a..6786e1e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "eslint-plugin-compat": "^4.2.0", "eslint-plugin-es-x": "^7.1.0", "eslint-plugin-jest": "^27.2.3", - "eslint-plugin-jsdoc": "39.2.2", + "eslint-plugin-jsdoc": "46.9.0", "eslint-plugin-json-es": "^1.5.7", "eslint-plugin-mediawiki": "^0.5.0", "eslint-plugin-mocha": "^10.1.0", @@ -130,16 +130,16 @@ } }, "node_modules/@es-joy/jsdoccomment": { - "version": "0.23.6", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.23.6.tgz", - "integrity": "sha512-cCtumxG+qrYORGeOkDQ58GtSt/bb2XiP9GC0x2YduoUEX2EmBQ48FtoZMUs+8wiIdTDN1izUiRUD2FDu+p+Lvg==", + "version": "0.41.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.41.0.tgz", + "integrity": "sha512-aKUhyn1QI5Ksbqcr3fFJj16p99QdjUxXAEuFst1Z47DRyoiMwivIH9MV/ARcJOCXVjPfjITciej8ZD2O/6qUmw==", "dependencies": { - "comment-parser": "1.3.1", - "esquery": "^1.4.0", - "jsdoc-type-pratt-parser": "~2.2.5" + "comment-parser": "1.4.1", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" }, "engines": { - "node": "^12 || ^14 || ^16 || ^17" + "node": ">=16" } }, "node_modules/@eslint-community/eslint-utils": { @@ -469,6 +469,14 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "engines": { + "node": ">=14" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -676,9 +684,9 @@ } }, "node_modules/comment-parser": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.1.tgz", - "integrity": "sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", "engines": { "node": ">= 12.0.0" } @@ -905,20 +913,22 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "39.2.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-39.2.2.tgz", - "integrity": "sha512-ybkvja0p9JRzHEd2ST9h+Z47DLOuPyXpeb6r18/zKHdMmggPU1J0/zl+F0phea8ze9rMxi42MJVmGXi2NZ7PpA==", + "version": "46.9.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.9.0.tgz", + "integrity": "sha512-UQuEtbqLNkPf5Nr/6PPRCtr9xypXY+g8y/Q7gPa0YK7eDhh0y2lWprXRnaYbW7ACgIUvpDKy9X2bZqxtGzBG9Q==", "dependencies": { - "@es-joy/jsdoccomment": "~0.23.1", - "comment-parser": "1.3.1", + "@es-joy/jsdoccomment": "~0.41.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", "debug": "^4.3.4", "escape-string-regexp": "^4.0.0", - "esquery": "^1.4.0", - "semver": "^7.3.7", + "esquery": "^1.5.0", + "is-builtin-module": "^3.2.1", + "semver": "^7.5.4", "spdx-expression-parse": "^3.0.1" }, "engines": { - "node": "^14 || ^16 || ^17" + "node": ">=16" }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0" @@ -1672,9 +1682,9 @@ } }, "node_modules/jsdoc-type-pratt-parser": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-2.2.5.tgz", - "integrity": "sha512-2a6eRxSxp1BW040hFvaJxhsCMI9lT8QB8t14t+NY5tC5rckIR0U9cr2tjOeaFirmEOy6MHvmJnY7zTBHq431Lw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", + "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", "engines": { "node": ">=12.0.0" } @@ -2740,13 +2750,13 @@ } }, "@es-joy/jsdoccomment": { - "version": "0.23.6", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.23.6.tgz", - "integrity": "sha512-cCtumxG+qrYORGeOkDQ58GtSt/bb2XiP9GC0x2YduoUEX2EmBQ48FtoZMUs+8wiIdTDN1izUiRUD2FDu+p+Lvg==", + "version": "0.41.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.41.0.tgz", + "integrity": "sha512-aKUhyn1QI5Ksbqcr3fFJj16p99QdjUxXAEuFst1Z47DRyoiMwivIH9MV/ARcJOCXVjPfjITciej8ZD2O/6qUmw==", "requires": { - "comment-parser": "1.3.1", - "esquery": "^1.4.0", - "jsdoc-type-pratt-parser": "~2.2.5" + "comment-parser": "1.4.1", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" } }, "@eslint-community/eslint-utils": { @@ -2963,6 +2973,11 @@ "color-convert": "^2.0.1" } }, + "are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==" + }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -3096,9 +3111,9 @@ "dev": true }, "comment-parser": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.1.tgz", - "integrity": "sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA==" + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==" }, "concat-map": { "version": "0.0.1", @@ -3257,16 +3272,18 @@ } }, "eslint-plugin-jsdoc": { - "version": "39.2.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-39.2.2.tgz", - "integrity": "sha512-ybkvja0p9JRzHEd2ST9h+Z47DLOuPyXpeb6r18/zKHdMmggPU1J0/zl+F0phea8ze9rMxi42MJVmGXi2NZ7PpA==", + "version": "46.9.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.9.0.tgz", + "integrity": "sha512-UQuEtbqLNkPf5Nr/6PPRCtr9xypXY+g8y/Q7gPa0YK7eDhh0y2lWprXRnaYbW7ACgIUvpDKy9X2bZqxtGzBG9Q==", "requires": { - "@es-joy/jsdoccomment": "~0.23.1", - "comment-parser": "1.3.1", + "@es-joy/jsdoccomment": "~0.41.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", "debug": "^4.3.4", "escape-string-regexp": "^4.0.0", - "esquery": "^1.4.0", - "semver": "^7.3.7", + "esquery": "^1.5.0", + "is-builtin-module": "^3.2.1", + "semver": "^7.5.4", "spdx-expression-parse": "^3.0.1" } }, @@ -3794,9 +3811,9 @@ } }, "jsdoc-type-pratt-parser": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-2.2.5.tgz", - "integrity": "sha512-2a6eRxSxp1BW040hFvaJxhsCMI9lT8QB8t14t+NY5tC5rckIR0U9cr2tjOeaFirmEOy6MHvmJnY7zTBHq431Lw==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", + "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==" }, "jsesc": { "version": "3.0.2", diff --git a/package.json b/package.json index 6349ae54..36d6b0b7 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "eslint-plugin-compat": "^4.2.0", "eslint-plugin-es-x": "^7.1.0", "eslint-plugin-jest": "^27.2.3", - "eslint-plugin-jsdoc": "39.2.2", + "eslint-plugin-jsdoc": "46.9.0", "eslint-plugin-json-es": "^1.5.7", "eslint-plugin-mediawiki": "^0.5.0", "eslint-plugin-mocha": "^10.1.0", diff --git a/test/fixtures/jsdoc/invalid.js b/test/fixtures/jsdoc/invalid.js index 22e11ac9..87d905be 100644 --- a/test/fixtures/jsdoc/invalid.js +++ b/test/fixtures/jsdoc/invalid.js @@ -12,20 +12,28 @@ No text on last line */ /* eslint-enable jsdoc/no-multi-asterisks */ - /* eslint-disable jsdoc/check-property-names */ + /* eslint-disable jsdoc/check-property-names, jsdoc/no-blank-block-descriptions */ /** + * * @property {Function} APP * @property {Function} APP */ let APP; - /* eslint-enable jsdoc/check-property-names */ + /* eslint-enable jsdoc/check-property-names, jsdoc/no-blank-block-descriptions */ - // eslint-disable-next-line jsdoc/require-property-type + /* eslint-disable jsdoc/no-blank-blocks */ + /** + * + */ + /* eslint-enable jsdoc/no-blank-blocks */ + + /* eslint-disable jsdoc/require-property-type */ /** * @property Bar */ + /* eslint-enable jsdoc/require-property-type */ - // eslint-disable-next-line jsdoc/check-param-names, jsdoc/valid-types, jsdoc/require-param + /* eslint-disable jsdoc/check-param-names, jsdoc/valid-types, jsdoc/require-param */ /** * @param {Array > ઼ `test` + * * jsdoc/no-multi-asterisks with whitespace, allowWhitespace=true * This does two things * * Thing one @@ -63,7 +68,7 @@ * * @class * - * @mixes App + * @mixes Foo * @param {string} id * @param {Object} options */ @@ -72,10 +77,11 @@ this.options = options; }; + // Off: jsdoc/informative-docs // Off: jsdoc/require-returns-description // Off: jsdoc/require-description /** - * @param {boolean|number} code + * @param {boolean|number} code The code * @return {null|undefined} */ APP.fall = function ( code ) { @@ -84,10 +90,11 @@ /** * @param {number} a - * @param {number} b + * @param {number} [b=5] * @return {number} */ APP.sum = function ( a, b ) { + b = b || 5; return a + b; }; diff --git a/test/fixtures/jsduck/invalid.js b/test/fixtures/jsduck/invalid.js index f880d9ed..3e7b2bd0 100644 --- a/test/fixtures/jsduck/invalid.js +++ b/test/fixtures/jsduck/invalid.js @@ -1,13 +1,15 @@ ( function () { - // eslint-disable-next-line jsdoc/check-tag-names + /* eslint-disable jsdoc/check-tag-names */ /** * @alias Bar */ + /* eslint-enable jsdoc/check-tag-names */ - // eslint-disable-next-line jsdoc/check-tag-names + /* eslint-disable jsdoc/check-tag-names */ /** * @typedef Baz */ + /* eslint-enable jsdoc/check-tag-names */ }( this ) );