diff --git a/README.md b/README.md index f58aa5f8f..6bb6ea8f8 100644 --- a/README.md +++ b/README.md @@ -12982,6 +12982,10 @@ export class InovaAutoCompleteComponent { } // "jsdoc/require-jsdoc": ["error"|"warn", {"contexts":["PropertyDefinition"],"publicOnly":true}] // Message: Missing JSDoc comment. + +export default (arg) => arg; +// "jsdoc/require-jsdoc": ["error"|"warn", {"publicOnly":true,"require":{"ArrowFunctionExpression":true,"ClassDeclaration":true,"ClassExpression":true,"FunctionDeclaration":true,"FunctionExpression":true,"MethodDefinition":true}}] +// Message: Missing JSDoc comment. ```` The following patterns are not considered problems: diff --git a/package.json b/package.json index e25599086..6cf55675f 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "url": "http://gajus.com" }, "dependencies": { - "@es-joy/jsdoccomment": "0.12.0", + "@es-joy/jsdoccomment": "0.13.0", "comment-parser": "1.3.0", "debug": "^4.3.3", "escape-string-regexp": "^4.0.0", @@ -26,15 +26,15 @@ "@babel/preset-env": "^7.16.4", "@babel/register": "^7.16.0", "@hkdobrev/run-if-changed": "^0.3.1", - "@typescript-eslint/parser": "^5.5.0", + "@typescript-eslint/parser": "^5.6.0", "babel-plugin-add-module-exports": "^1.0.4", "babel-plugin-istanbul": "^6.1.1", "camelcase": "^6.2.1", "chai": "^4.3.4", "cross-env": "^7.0.3", "decamelize": "^5.0.1", - "eslint": "^8.3.0", - "eslint-config-canonical": "^32.43.0", + "eslint": "^8.4.1", + "eslint-config-canonical": "^32.46.0", "gitdown": "^3.1.4", "glob": "^7.2.0", "husky": "^7.0.4", diff --git a/test/rules/assertions/requireJsdoc.js b/test/rules/assertions/requireJsdoc.js index 8911d3e90..f403da8b8 100644 --- a/test/rules/assertions/requireJsdoc.js +++ b/test/rules/assertions/requireJsdoc.js @@ -595,10 +595,10 @@ function quux (foo) { }, }], output: ` - export default /** + /** * */ - () => {} + export default () => {} `, parserOptions: { sourceType: 'module', @@ -626,10 +626,10 @@ function quux (foo) { }, }], output: ` - export default (/** + /** * */ - function () {}) + export default (function () {}) `, parserOptions: { sourceType: 'module', @@ -3281,6 +3281,37 @@ function quux (foo) { sourceType: 'module', }, }, + { + code: ` + export default (arg) => arg; + `, + errors: [ + { + line: 2, + message: 'Missing JSDoc comment.', + }, + ], + options: [{ + publicOnly: true, + require: { + ArrowFunctionExpression: true, + ClassDeclaration: true, + ClassExpression: true, + FunctionDeclaration: true, + FunctionExpression: true, + MethodDefinition: true, + }, + }], + output: ` + /** + * + */ + export default (arg) => arg; + `, + parserOptions: { + sourceType: 'module', + }, + }, ], valid: [{ code: `