Skip to content

Commit 6ced508

Browse files
committed
docs: generate docs
1 parent 39fa18b commit 6ced508

File tree

1 file changed

+114
-1
lines changed

1 file changed

+114
-1
lines changed

README.md

Lines changed: 114 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,6 +1289,13 @@ function quux (foo) {
12891289
* @version
12901290
*/
12911291
function quux (foo) {}
1292+
1293+
/**
1294+
*
1295+
*/
1296+
function quux (foo) {
1297+
1298+
}
12921299
````
12931300

12941301

@@ -2083,6 +2090,13 @@ function quux (foo) {
20832090

20842091
}
20852092
// Settings: {"jsdoc":{"preferredTypes":{"object<>":"GenericObject"}}}
2093+
2094+
/**
2095+
* @param {Number<} Ignore the error as not a validating rule
2096+
*/
2097+
function quux (foo) {
2098+
2099+
}
20862100
````
20872101

20882102

@@ -2142,6 +2156,18 @@ class quux {
21422156
}
21432157
}
21442158

2159+
/**
2160+
*
2161+
*/
2162+
const quux = class {
2163+
/**
2164+
* @implements {SomeClass}
2165+
*/
2166+
constructor () {
2167+
2168+
}
2169+
}
2170+
21452171
/**
21462172
*
21472173
*/
@@ -2511,6 +2537,17 @@ function quux () {
25112537
// Options: ["always"]
25122538
// Message: There must be a newline after the description of the JSDoc block.
25132539

2540+
/**
2541+
* Foo.
2542+
*
2543+
* Foo.
2544+
* @foo
2545+
*/
2546+
function quux () {
2547+
2548+
}
2549+
// Message: There must be a newline after the description of the JSDoc block.
2550+
25142551
/**
25152552
* Bar.
25162553
*
@@ -3345,6 +3382,16 @@ function quux () {
33453382
}
33463383
// Settings: {"jsdoc":{"avoidExampleOnConstructors":true}}
33473384

3385+
class Foo {
3386+
/**
3387+
*
3388+
*/
3389+
constructor () {
3390+
3391+
}
3392+
}
3393+
// Settings: {"jsdoc":{"avoidExampleOnConstructors":true}}
3394+
33483395
/**
33493396
* @inheritdoc
33503397
*/
@@ -3387,6 +3434,14 @@ function quux () {
33873434
// Options: ["always"]
33883435
// Message: There must be a hyphen before @param description.
33893436

3437+
/**
3438+
* @param foo Foo.
3439+
*/
3440+
function quux () {
3441+
3442+
}
3443+
// Message: There must be a hyphen before @param description.
3444+
33903445
/**
33913446
* @param foo - Foo.
33923447
*/
@@ -3436,6 +3491,13 @@ function quux () {
34363491

34373492
}
34383493
// Options: ["never"]
3494+
3495+
/**
3496+
* @param foo
3497+
*/
3498+
function quux () {
3499+
3500+
}
34393501
````
34403502

34413503

@@ -3491,6 +3553,12 @@ function quux (foo) {
34913553
}
34923554
// Message: Missing JSDoc comment.
34933555

3556+
function quux (foo) {
3557+
3558+
}
3559+
// Settings: {"jsdoc":{"exemptEmptyFunctions":true}}
3560+
// Message: Missing JSDoc comment.
3561+
34943562
function myFunction() {}
34953563
// Message: Missing JSDoc comment.
34963564

@@ -3923,11 +3991,23 @@ class A {
39233991
// Options: [{"require":{"ClassDeclaration":false,"MethodDefinition":false}}]
39243992

39253993
/**
3926-
Function doing something
3994+
* Function doing something
39273995
*/
39283996
var myFunction = () => {}
39293997
// Options: [{"require":{"ArrowFunctionExpression":true}}]
39303998

3999+
/**
4000+
* Function doing something
4001+
*/
4002+
var myFunction = function () {}
4003+
// Options: [{"require":{"ArrowFunctionExpression":true}}]
4004+
4005+
/**
4006+
* Function doing something
4007+
*/
4008+
var myFunction = () => {}
4009+
// Options: [{"require":{"ArrowFunctionExpression":false}}]
4010+
39314011
/**
39324012
Function doing something
39334013
*/
@@ -5177,6 +5257,16 @@ async function quux () {
51775257
}
51785258
// Options: [{"forceReturnsWithAsync":true}]
51795259
// Message: Missing JSDoc @returns declaration.
5260+
5261+
/**
5262+
* @returns {undefined}
5263+
* @returns {void}
5264+
*/
5265+
function quux (foo) {
5266+
5267+
return foo;
5268+
}
5269+
// Message: Found more than one @returns declaration.
51805270
````
51815271

51825272
The following patterns are not considered problems:
@@ -5501,6 +5591,22 @@ function quux() {
55015591
}
55025592
// Message: Syntax error in type: Array<string
55035593

5594+
/**
5595+
* @memberof module:namespace.SomeClass<~
5596+
*/
5597+
function quux() {
5598+
5599+
}
5600+
// Message: Syntax error in type: module:namespace.SomeClass<~
5601+
5602+
/**
5603+
* @memberof module:namespace.SomeClass~<
5604+
*/
5605+
function quux() {
5606+
5607+
}
5608+
// Message: Syntax error in type: module:namespace.SomeClass~<
5609+
55045610
/**
55055611
* @borrows foo% as bar
55065612
*/
@@ -5646,6 +5752,13 @@ function quux() {
56465752
*/
56475753
function quux() {
56485754

5755+
}
5756+
5757+
/**
5758+
*
5759+
*/
5760+
function quux() {
5761+
56495762
}
56505763
````
56515764

0 commit comments

Comments
 (0)