Skip to content

Commit

Permalink
fix: update jsdoccomment
Browse files Browse the repository at this point in the history
Also:
- test: `hasPreterminalTagDescription`
  • Loading branch information
brettz9 committed Nov 2, 2022
1 parent d68d742 commit 26141cb
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -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:
Expand Down Expand Up @@ -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"}]}]
````


Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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",
Expand Down
41 changes: 41 additions & 0 deletions test/rules/assertions/noRestrictedSyntax.js
Expand Up @@ -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: [
{
Expand Down Expand Up @@ -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',
},
],
},
],
},
],
};

0 comments on commit 26141cb

Please sign in to comment.