Skip to content

Commit 26141cb

Browse files
committedNov 2, 2022
fix: update jsdoccomment
Also: - test: `hasPreterminalTagDescription`
1 parent d68d742 commit 26141cb

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed
 

‎README.md

+10
Original file line numberDiff line numberDiff line change
@@ -9651,6 +9651,11 @@ const MyComponent = ({ children }) => {
96519651
*/
96529652
// "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"}]}]
96539653
// Message: Requiring descriptive text on 0th line and no preterminal description
9654+
9655+
/** Some text
9656+
* @param sth Param text followed by no newline */
9657+
// "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"}]}]
9658+
// Message: Requiring descriptive text on 0th line but no preterminal description
96549659
````
96559660

96569661
The following patterns are not considered problems:
@@ -9716,6 +9721,11 @@ function foo(): string;
97169721
/** Some text and
97179722
* more */
97189723
// "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"}]}]
9724+
9725+
/** Some text
9726+
* @param sth Param text followed by newline
9727+
*/
9728+
// "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"}]}]
97199729
````
97209730

97219731

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"url": "http://gajus.com"
66
},
77
"dependencies": {
8-
"@es-joy/jsdoccomment": "~0.35.0",
8+
"@es-joy/jsdoccomment": "~0.36.0",
99
"comment-parser": "1.3.1",
1010
"debug": "^4.3.4",
1111
"escape-string-regexp": "^4.0.0",

‎test/rules/assertions/noRestrictedSyntax.js

+41
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,29 @@ export default {
418418
},
419419
],
420420
},
421+
{
422+
code: `
423+
/** Some text
424+
* @param sth Param text followed by no newline */
425+
`,
426+
errors: [
427+
{
428+
line: 2,
429+
message: 'Requiring descriptive text on 0th line but no preterminal description',
430+
},
431+
],
432+
options: [
433+
{
434+
contexts: [
435+
{
436+
comment: 'JsdocBlock[descriptionStartLine=0][hasPreterminalTagDescription=1]',
437+
context: 'any',
438+
message: 'Requiring descriptive text on 0th line but no preterminal description',
439+
},
440+
],
441+
},
442+
],
443+
},
421444
],
422445
valid: [
423446
{
@@ -610,5 +633,23 @@ export default {
610633
},
611634
],
612635
},
636+
{
637+
code: `
638+
/** Some text
639+
* @param sth Param text followed by newline
640+
*/
641+
`,
642+
options: [
643+
{
644+
contexts: [
645+
{
646+
comment: 'JsdocBlock[descriptionStartLine=0][hasPreterminalTagDescription=1]',
647+
context: 'any',
648+
message: 'Requiring descriptive text on 0th line but no preterminal description',
649+
},
650+
],
651+
},
652+
],
653+
},
613654
],
614655
};

0 commit comments

Comments
 (0)
Please sign in to comment.