@@ -136,27 +136,31 @@ The following patterns are considered problems:
136
136
function quux (foo = ' FOO' ) {
137
137
138
138
}
139
+ // Message: Expected @param names to be "foo". Got "Foo".
139
140
140
141
/**
141
142
* @arg Foo
142
143
*/
143
144
function quux (foo = ' FOO' ) {
144
145
145
146
}
147
+ // Message: Expected @arg names to be "foo". Got "Foo".
146
148
147
149
/**
148
150
* @param Foo
149
151
*/
150
152
function quux (foo ) {
151
153
152
154
}
155
+ // Message: Expected @param names to be "foo". Got "Foo".
153
156
154
157
/**
155
158
* @param Foo.Bar
156
159
*/
157
160
function quux (foo ) {
158
161
159
162
}
163
+ // Message: @param path declaration ("Foo.Bar") appears before any real parameter.
160
164
161
165
/**
162
166
* @param foo
@@ -165,6 +169,7 @@ function quux (foo) {
165
169
function quux (foo ) {
166
170
167
171
}
172
+ // Message: @param path declaration ("Foo.Bar") root node name ("Foo") does not match previous real parameter name ("foo").
168
173
169
174
/**
170
175
* @param foo
@@ -174,6 +179,7 @@ function quux (foo) {
174
179
function quux (bar , foo ) {
175
180
176
181
}
182
+ // Message: Expected @param names to be "bar, foo". Got "foo, bar".
177
183
178
184
/**
179
185
* @param foo
@@ -182,6 +188,7 @@ function quux (bar, foo) {
182
188
function quux (foo ) {
183
189
184
190
}
191
+ // Message: @param "bar" does not match an existing function parameter.
185
192
```
186
193
187
194
The following patterns are not considered problems:
@@ -345,27 +352,31 @@ The following patterns are considered problems:
345
352
function quux () {
346
353
347
354
}
355
+ // Message: Invalid JSDoc tag name "Param".
348
356
349
357
/**
350
358
* @foo
351
359
*/
352
360
function quux () {
353
361
354
362
}
363
+ // Message: Invalid JSDoc tag name "foo".
355
364
356
365
/**
357
366
* @arg foo
358
367
*/
359
368
function quux (foo ) {
360
369
361
370
}
371
+ // Message: Invalid JSDoc tag (preference). Replace "arg" JSDoc tag with "param".
362
372
363
373
/**
364
374
* @param foo
365
375
*/
366
376
function quux (foo ) {
367
377
368
378
}
379
+ // Message: Invalid JSDoc tag (preference). Replace "param" JSDoc tag with "arg".
369
380
```
370
381
371
382
The following patterns are not considered problems:
@@ -417,13 +428,15 @@ The following patterns are considered problems:
417
428
function quux (foo ) {
418
429
419
430
}
431
+ // Message: Invalid JSDoc @param "foo" type "Number".
420
432
421
433
/**
422
434
* @arg {Number} foo
423
435
*/
424
436
function quux (foo ) {
425
437
426
438
}
439
+ // Message: Invalid JSDoc @arg "foo" type "Number".
427
440
```
428
441
429
442
The following patterns are not considered problems:
@@ -463,6 +476,7 @@ This rule takes one argument. If it is `"always"` then a problem is raised when
463
476
The following patterns are considered problems:
464
477
465
478
``` js
479
+ // Options: ["always"]
466
480
/**
467
481
* Foo.
468
482
*
@@ -472,7 +486,9 @@ The following patterns are considered problems:
472
486
function quux () {
473
487
474
488
}
489
+ // Message: There must be a newline after the description of the JSDoc block.
475
490
491
+ // Options: ["never"]
476
492
/**
477
493
* Bar.
478
494
*
@@ -483,25 +499,29 @@ function quux () {
483
499
function quux () {
484
500
485
501
}
502
+ // Message: There must be no newline after the description of the JSDoc block.
486
503
```
487
504
488
505
The following patterns are not considered problems:
489
506
490
507
``` js
508
+ // Options: ["always"]
491
509
/**
492
510
* Foo.
493
511
*/
494
512
function quux () {
495
513
496
514
}
497
515
516
+ // Options: ["never"]
498
517
/**
499
518
* Bar.
500
519
*/
501
520
function quux () {
502
521
503
522
}
504
523
524
+ // Options: ["always"]
505
525
/**
506
526
* Foo.
507
527
*
@@ -511,6 +531,7 @@ function quux () {
511
531
512
532
}
513
533
534
+ // Options: ["never"]
514
535
/**
515
536
* Bar.
516
537
* @bar
@@ -544,6 +565,7 @@ The following patterns are considered problems:
544
565
function quux () {
545
566
546
567
}
568
+ // Message: Description must start with an uppercase character.
547
569
548
570
/**
549
571
* Foo.
@@ -553,13 +575,15 @@ function quux () {
553
575
function quux () {
554
576
555
577
}
578
+ // Message: Paragraph must start with an uppercase character.
556
579
557
580
/**
558
581
* Foo
559
582
*/
560
583
function quux () {
561
584
562
585
}
586
+ // Message: Sentence must end with a period.
563
587
564
588
/**
565
589
* Foo
@@ -568,6 +592,7 @@ function quux () {
568
592
function quux () {
569
593
570
594
}
595
+ // Message: A line of text is started with an uppercase character, but preceding line does not end the sentence.
571
596
572
597
/**
573
598
* Foo.
@@ -577,6 +602,7 @@ function quux () {
577
602
function quux (foo ) {
578
603
579
604
}
605
+ // Message: Description must start with an uppercase character.
580
606
581
607
/**
582
608
* Foo.
@@ -586,6 +612,7 @@ function quux (foo) {
586
612
function quux (foo ) {
587
613
588
614
}
615
+ // Message: Description must start with an uppercase character.
589
616
```
590
617
591
618
The following patterns are not considered problems:
@@ -657,6 +684,7 @@ The following patterns are considered problems:
657
684
function quux () {
658
685
659
686
}
687
+ // Message: There must be a hyphen before @param description.
660
688
```
661
689
662
690
The following patterns are not considered problems:
@@ -689,20 +717,23 @@ The following patterns are considered problems:
689
717
function quux (foo ) {
690
718
691
719
}
720
+ // Message: Missing JSDoc @param "foo" declaration.
692
721
693
722
/**
694
723
*
695
724
*/
696
725
function quux (foo ) {
697
726
698
727
}
728
+ // Message: Missing JSDoc @arg "foo" declaration.
699
729
700
730
/**
701
731
* @param foo
702
732
*/
703
733
function quux (foo , bar ) {
704
734
705
735
}
736
+ // Message: Missing JSDoc @param "bar" declaration.
706
737
```
707
738
708
739
The following patterns are not considered problems:
@@ -742,13 +773,15 @@ The following patterns are considered problems:
742
773
function quux (foo ) {
743
774
744
775
}
776
+ // Message: Missing JSDoc @param "foo" description.
745
777
746
778
/**
747
779
* @arg foo
748
780
*/
749
781
function quux (foo ) {
750
782
751
783
}
784
+ // Message: Missing JSDoc @arg "foo" description.
752
785
```
753
786
754
787
The following patterns are not considered problems:
@@ -788,13 +821,15 @@ The following patterns are considered problems:
788
821
function quux (foo ) {
789
822
790
823
}
824
+ // Message: Missing JSDoc @param "foo" type.
791
825
792
826
/**
793
827
* @arg foo
794
828
*/
795
829
function quux (foo ) {
796
830
797
831
}
832
+ // Message: Missing JSDoc @arg "foo" type.
798
833
```
799
834
800
835
The following patterns are not considered problems:
@@ -834,13 +869,15 @@ The following patterns are considered problems:
834
869
function quux (foo ) {
835
870
836
871
}
872
+ // Message: Missing JSDoc @returns description.
837
873
838
874
/**
839
875
* @return
840
876
*/
841
877
function quux (foo ) {
842
878
843
879
}
880
+ // Message: Missing JSDoc @return description.
844
881
```
845
882
846
883
The following patterns are not considered problems:
@@ -880,20 +917,23 @@ The following patterns are considered problems:
880
917
function quux () {
881
918
882
919
}
920
+ // Message: Missing JSDoc @returns type.
883
921
884
922
/**
885
923
* @returns Foo.
886
924
*/
887
925
function quux () {
888
926
889
927
}
928
+ // Message: Missing JSDoc @returns type.
890
929
891
930
/**
892
931
* @return Foo.
893
932
*/
894
933
function quux () {
895
934
896
935
}
936
+ // Message: Missing JSDoc @return type.
897
937
```
898
938
899
939
The following patterns are not considered problems:
0 commit comments