diff --git a/jsdoc.json b/jsdoc.json index 94f4d6ac..4ebaa998 100644 --- a/jsdoc.json +++ b/jsdoc.json @@ -34,7 +34,8 @@ "set": "Set", "String": "string", "Undefined": "undefined" - } + }, + "mode": "jsdoc" } }, "rules": { @@ -51,6 +52,8 @@ ], "jsdoc/check-values": "off", "jsdoc/empty-tags": "off", + "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", diff --git a/package-lock.json b/package-lock.json index 266a684a..a159462f 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": "^42.0.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.37.1", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.37.1.tgz", + "integrity": "sha512-5vxWJ1gEkEF0yRd0O+uK6dHJf7adrxwQSX8PuRiPfFSAbNLnY0ZJfXaZucoz14Jj2N11xn2DnlEPwWRpYpvRjg==", "dependencies": { "comment-parser": "1.3.1", - "esquery": "^1.4.0", - "jsdoc-type-pratt-parser": "~2.2.5" + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" }, "engines": { - "node": "^12 || ^14 || ^16 || ^17" + "node": "^14 || ^16 || ^17 || ^18 || ^19 || ^20" } }, "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", @@ -905,20 +913,21 @@ } }, "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": "42.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-42.0.0.tgz", + "integrity": "sha512-qXYr45G8atPKowZbIOdmABukMzu9IMjAlj6j5Fe0iuUItznWSXUDiBj57ejXcbt8bkPrg83333nuz+cqGKFgcQ==", "dependencies": { - "@es-joy/jsdoccomment": "~0.23.1", + "@es-joy/jsdoccomment": "~0.37.0", + "are-docs-informative": "^0.0.2", "comment-parser": "1.3.1", "debug": "^4.3.4", "escape-string-regexp": "^4.0.0", - "esquery": "^1.4.0", - "semver": "^7.3.7", + "esquery": "^1.5.0", + "semver": "^7.3.8", "spdx-expression-parse": "^3.0.1" }, "engines": { - "node": "^14 || ^16 || ^17" + "node": "^14 || ^16 || ^17 || ^18 || ^19" }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0" @@ -1672,9 +1681,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 +2749,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.37.1", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.37.1.tgz", + "integrity": "sha512-5vxWJ1gEkEF0yRd0O+uK6dHJf7adrxwQSX8PuRiPfFSAbNLnY0ZJfXaZucoz14Jj2N11xn2DnlEPwWRpYpvRjg==", "requires": { "comment-parser": "1.3.1", - "esquery": "^1.4.0", - "jsdoc-type-pratt-parser": "~2.2.5" + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" } }, "@eslint-community/eslint-utils": { @@ -2963,6 +2972,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", @@ -3257,16 +3271,17 @@ } }, "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": "42.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-42.0.0.tgz", + "integrity": "sha512-qXYr45G8atPKowZbIOdmABukMzu9IMjAlj6j5Fe0iuUItznWSXUDiBj57ejXcbt8bkPrg83333nuz+cqGKFgcQ==", "requires": { - "@es-joy/jsdoccomment": "~0.23.1", + "@es-joy/jsdoccomment": "~0.37.0", + "are-docs-informative": "^0.0.2", "comment-parser": "1.3.1", "debug": "^4.3.4", "escape-string-regexp": "^4.0.0", - "esquery": "^1.4.0", - "semver": "^7.3.7", + "esquery": "^1.5.0", + "semver": "^7.3.8", "spdx-expression-parse": "^3.0.1" } }, @@ -3794,9 +3809,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..c816f4b8 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": "^42.0.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..6ba31633 100644 --- a/test/fixtures/jsdoc/invalid.js +++ b/test/fixtures/jsdoc/invalid.js @@ -12,20 +12,22 @@ 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/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 ) );