diff --git a/README.md b/README.md index 33d1ab669..a2f1964df 100644 --- a/README.md +++ b/README.md @@ -10632,6 +10632,16 @@ class quux { // Settings: {"jsdoc":{"implementsReplacesDocs":false}} // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[tag=\"implements\"])","context":"ClassDeclaration"}],"descriptionStyle":"tag"}] // Message: Missing JSDoc @description declaration. + +/** + * @implements {Bar} + */ +class quux { + +} +// Settings: {"jsdoc":{"implementsReplacesDocs":false}} +// "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[tag=\"implements\"])","context":"any"}],"descriptionStyle":"tag"}] +// Message: Missing JSDoc @description declaration. ```` The following patterns are not considered problems: @@ -10847,6 +10857,21 @@ class quux { } // "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[rawType=\"{Bar}\"])","context":"ClassDeclaration"}],"descriptionStyle":"tag"}] + +/** + * Has some + * description already. + */ +class quux { + +} +// "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[rawType=\"{Bar}\"])","context":"any"}],"descriptionStyle":"tag"}] + +/** + * Has some + * description already. + */ +// "jsdoc/require-description": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTag[rawType=\"{Bar}\"])","context":"any"}],"descriptionStyle":"tag"}] ```` diff --git a/test/rules/assertions/requireDescription.js b/test/rules/assertions/requireDescription.js index aaa933f25..baeedbe60 100644 --- a/test/rules/assertions/requireDescription.js +++ b/test/rules/assertions/requireDescription.js @@ -663,6 +663,38 @@ export default { }, }, }, + { + code: ` + /** + * @implements {Bar} + */ + class quux { + + } + `, + errors: [ + { + line: 2, + message: 'Missing JSDoc @description declaration.', + }, + ], + options: [ + { + contexts: [ + { + comment: 'JsdocBlock[postDelimiter=""]:has(JsdocTag[tag="implements"])', + context: 'any', + }, + ], + descriptionStyle: 'tag', + }, + ], + settings: { + jsdoc: { + implementsReplacesDocs: false, + }, + }, + }, ], valid: [ { @@ -1059,5 +1091,46 @@ export default { }, ], }, + { + code: ` + /** + * Has some + * description already. + */ + class quux { + + } + `, + options: [ + { + contexts: [ + { + comment: 'JsdocBlock[postDelimiter=""]:has(JsdocTag[rawType="{Bar}"])', + context: 'any', + }, + ], + descriptionStyle: 'tag', + }, + ], + }, + { + code: ` + /** + * Has some + * description already. + */ + `, + options: [ + { + contexts: [ + { + comment: 'JsdocBlock[postDelimiter=""]:has(JsdocTag[rawType="{Bar}"])', + context: 'any', + }, + ], + descriptionStyle: 'tag', + }, + ], + }, ], };