diff --git a/README.md b/README.md index 4857db861..34b75ee86 100644 --- a/README.md +++ b/README.md @@ -9656,6 +9656,12 @@ const MyComponent = ({ children }) => { * @param sth Param text followed by no newline */ // "jsdoc/no-restricted-syntax": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[descriptionStartLine=0][hasPreterminalTagDescription=1]","context":"any","message":"Requiring descriptive text on 0th line but no preterminal description"}]}] // Message: Requiring descriptive text on 0th line but no preterminal description + +/** + * + */ +// "jsdoc/no-restricted-syntax": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock:not(*:has(JsdocTag[tag=see]))","context":"any","message":"@see required on each block"}]}] +// Message: @see required on each block ```` The following patterns are not considered problems: diff --git a/test/rules/assertions/noRestrictedSyntax.js b/test/rules/assertions/noRestrictedSyntax.js index 7fc5ef503..56d97a7dc 100644 --- a/test/rules/assertions/noRestrictedSyntax.js +++ b/test/rules/assertions/noRestrictedSyntax.js @@ -441,6 +441,30 @@ export default { }, ], }, + { + code: ` + /** + * + */ + `, + errors: [ + { + line: 2, + message: '@see required on each block', + }, + ], + options: [ + { + contexts: [ + { + comment: 'JsdocBlock:not(*:has(JsdocTag[tag=see]))', + context: 'any', + message: '@see required on each block', + }, + ], + }, + ], + }, ], valid: [ {