diff --git a/README.md b/README.md index a9dd7094a..8d9d2746b 100644 --- a/README.md +++ b/README.md @@ -9651,6 +9651,11 @@ const MyComponent = ({ children }) => { */ // "jsdoc/no-restricted-syntax": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[descriptionStartLine=0][hasPreterminalDescription=0]","context":"any","message":"Requiring descriptive text on 0th line and no preterminal description"}]}] // Message: Requiring descriptive text on 0th line and no preterminal description + +/** Some text +* @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 ```` The following patterns are not considered problems: @@ -9716,6 +9721,11 @@ function foo(): string; /** Some text and * more */ // "jsdoc/no-restricted-syntax": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[descriptionStartLine=0][hasPreterminalDescription=0]","context":"any","message":"Requiring descriptive text on 0th line and no preterminal description"}]}] + +/** Some text +* @param sth Param text followed by 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"}]}] ```` diff --git a/package.json b/package.json index bc3590929..dfc6e596a 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "url": "http://gajus.com" }, "dependencies": { - "@es-joy/jsdoccomment": "~0.35.0", + "@es-joy/jsdoccomment": "~0.36.0", "comment-parser": "1.3.1", "debug": "^4.3.4", "escape-string-regexp": "^4.0.0", diff --git a/test/rules/assertions/noRestrictedSyntax.js b/test/rules/assertions/noRestrictedSyntax.js index cf4572dbe..7fc5ef503 100644 --- a/test/rules/assertions/noRestrictedSyntax.js +++ b/test/rules/assertions/noRestrictedSyntax.js @@ -418,6 +418,29 @@ export default { }, ], }, + { + code: ` + /** Some text + * @param sth Param text followed by no newline */ + `, + errors: [ + { + line: 2, + message: 'Requiring descriptive text on 0th line but no preterminal description', + }, + ], + options: [ + { + contexts: [ + { + comment: 'JsdocBlock[descriptionStartLine=0][hasPreterminalTagDescription=1]', + context: 'any', + message: 'Requiring descriptive text on 0th line but no preterminal description', + }, + ], + }, + ], + }, ], valid: [ { @@ -610,5 +633,23 @@ export default { }, ], }, + { + code: ` + /** Some text + * @param sth Param text followed by newline + */ + `, + options: [ + { + contexts: [ + { + comment: 'JsdocBlock[descriptionStartLine=0][hasPreterminalTagDescription=1]', + context: 'any', + message: 'Requiring descriptive text on 0th line but no preterminal description', + }, + ], + }, + ], + }, ], };