|
18 | 18 | * |
19 | 19 | * ### checkAnnotations |
20 | 20 | * |
21 | | - * Ensures tag names are valid |
| 21 | + * Checks tag names are valid. |
22 | 22 | * |
23 | 23 | * There are 3 presets for `Closure Compiler`, `JSDoc3` and `JSDuck5`. |
24 | 24 | * |
25 | | - * By default it allows any tag of mixed set. You can pass `Object` to select |
26 | | - * preset with `preset` field and add custom tags with `extra` field. |
| 25 | + * By default it allows any tag from any preset. You can pass `Object` |
| 26 | + * to select preset with `preset` field and add custom tags with `extra` field. |
27 | 27 | * |
28 | 28 | * Type: `Boolean` or `String` or `{"preset": String, "extra": Object}` |
29 | | - * (see [tag values](#user-content-tag-values)) |
| 29 | + * (see [tag values](#user-content-tag-values)). |
30 | 30 | * |
31 | 31 | * Values: `true`, `"closurecompiler"`, `"jsdoc3"`, `"jsduck5"`, `Object` |
32 | 32 | * |
|
99 | 99 | * |
100 | 100 | * ### checkParamExistence |
101 | 101 | * |
102 | | - * Ensures all parameters are documented. |
| 102 | + * Checks all parameters are documented. |
103 | 103 | * |
104 | 104 | * Type: `Boolean` |
105 | 105 | * |
|
144 | 144 | * |
145 | 145 | * ### checkParamNames |
146 | 146 | * |
147 | | - * Ensures param names in jsdoc and in function declaration are equal |
| 147 | + * Checks param names in jsdoc and in function declaration are equal. |
148 | 148 | * |
149 | 149 | * Type: `Boolean` |
150 | 150 | * |
|
182 | 182 | * |
183 | 183 | * ### requireParamTypes |
184 | 184 | * |
185 | | - * Ensures params in jsdoc contains type |
| 185 | + * Checks params in jsdoc contains type. |
186 | 186 | * |
187 | 187 | * Type: `Boolean` |
188 | 188 | * |
|
218 | 218 | * |
219 | 219 | * ### checkRedundantParams |
220 | 220 | * |
221 | | - * Reports redundant params in jsdoc |
| 221 | + * Reports redundant params in jsdoc. |
222 | 222 | * |
223 | 223 | * Type: `Boolean` |
224 | 224 | * |
|
254 | 254 | * |
255 | 255 | * ### checkReturnTypes |
256 | 256 | * |
257 | | - * Reports discrepancies between the claimed in jsdoc and actual type if both |
258 | | - * exist (code scan) |
| 257 | + * Checks for differences between the jsdoc and actual return types if both exist. |
259 | 258 | * |
260 | 259 | * Type: `Boolean` |
261 | 260 | * |
|
298 | 297 | * |
299 | 298 | * ### checkRedundantReturns |
300 | 299 | * |
301 | | - * Report statements for functions with no return |
| 300 | + * Report statements for functions without return. |
302 | 301 | * |
303 | 302 | * Type: `Boolean` |
304 | 303 | * |
|
338 | 337 | * |
339 | 338 | * ### requireReturnTypes |
340 | 339 | * |
341 | | - * Ensures returns in jsdoc contains type |
| 340 | + * Checks returns in jsdoc contains type |
342 | 341 | * |
343 | 342 | * Type: `Boolean` |
344 | 343 | * |
|
379 | 378 | * |
380 | 379 | * ### checkTypes |
381 | 380 | * |
382 | | - * Reports invalid types for bunch of tags |
| 381 | + * Reports invalid types for bunch of tags. |
383 | 382 | * |
384 | | - * In `strictNativeCase` mode ensures that case of natives is the same as in this |
| 383 | + * The `strictNativeCase` mode checks that case of natives is the same as in this |
385 | 384 | * list: `boolean`, `number`, `string`, `Object`, `Array`, `Date`, `RegExp`. |
386 | 385 | * |
387 | | - * In `capitalizedNativeCase` mode ensures that first letter in all native types |
388 | | - * and primitives is uppercased except the case with `function` in google closure |
389 | | - * format: `{function(...)}` |
| 386 | + * The `capitalizedNativeCase` mode checks that the first letter in all native |
| 387 | + * types and primitives is uppercased except the case with `function` in google |
| 388 | + * closure format: `{function(...)}` |
390 | 389 | * |
391 | 390 | * Type: `Boolean` or `String` |
392 | 391 | * |
|
455 | 454 | * |
456 | 455 | * ### checkRedundantAccess |
457 | 456 | * |
458 | | - * Reports redundant access declarations |
| 457 | + * Reports redundant access declarations. |
459 | 458 | * |
460 | 459 | * Type: `Boolean` or `String` |
461 | 460 | * |
|
507 | 506 | * |
508 | 507 | * ### leadingUnderscoreAccess |
509 | 508 | * |
510 | | - * Ensures access declaration is set for `_underscored` function names |
| 509 | + * Checks access declaration is set for `_underscored` function names |
511 | 510 | * |
512 | | - * Ignores a bunch of popular identifiers: `__filename`, `__dirname`, `__proto__`, |
513 | | - * `__defineGetter__`, `super_`, `__constructor`, etc. |
| 511 | + * Ignores a bunch of popular identifiers: |
| 512 | + * `__filename`, `__dirname`, `__proto__`, `__defineGetter__`, `super_`, |
| 513 | + * `__constructor`, etc. |
514 | 514 | * |
515 | 515 | * Type: `Boolean` or `String` |
516 | 516 | * |
|
548 | 548 | * |
549 | 549 | * ### enforceExistence |
550 | 550 | * |
551 | | - * Ensures jsdoc block exist |
| 551 | + * Checks jsdoc block exists. |
552 | 552 | * |
553 | 553 | * Type: `Boolean`, `String` or `Object` |
554 | 554 | * |
|
588 | 588 | * |
589 | 589 | * ### requireHyphenBeforeDescription |
590 | 590 | * |
591 | | - * Ensures a param description has a hyphen before it (checks for `- `) |
| 591 | + * Checks a param description has a hyphen before it (checks for `- `). |
592 | 592 | * |
593 | 593 | * Type: `Boolean` |
594 | 594 | * |
|
625 | 625 | * |
626 | 626 | * ### requireNewlineAfterDescription |
627 | 627 | * |
628 | | - * Ensures a doc comment description has padding newline |
| 628 | + * Checks a doc comment description has padding newline. |
629 | 629 | * |
630 | 630 | * Type: `Boolean` |
631 | 631 | * |
|
645 | 645 | * |
646 | 646 | * ```js |
647 | 647 | * /** |
648 | | - * * @param {String} - message |
| 648 | + * * @param {String} msg - message |
649 | 649 | * *\/ |
650 | | - * function method() {} |
| 650 | + * function method(msg) {} |
651 | 651 | * |
652 | 652 | * /** |
653 | 653 | * * Description |
|
657 | 657 | * /** |
658 | 658 | * * Description |
659 | 659 | * * |
660 | | - * * @param {String} - message |
| 660 | + * * @param {String} msg - message |
661 | 661 | * *\/ |
662 | | - * function method() {} |
| 662 | + * function method(msg) {} |
663 | 663 | * ``` |
664 | 664 | * |
665 | 665 | * ##### Invalid |
|
675 | 675 | * |
676 | 676 | * ### disallowNewlineAfterDescription |
677 | 677 | * |
678 | | - * Ensures a doc comment description has no padding newlines |
| 678 | + * Checks a doc comment description has no padding newlines. |
679 | 679 | * |
680 | 680 | * Type: `Boolean` |
681 | 681 | * |
|
695 | 695 | * |
696 | 696 | * ```js |
697 | 697 | * /** |
698 | | - * * @param {String} - message |
| 698 | + * * @param {String} msg - message |
699 | 699 | * *\/ |
700 | | - * function method() {} |
| 700 | + * function method(msg) {} |
701 | 701 | * |
702 | 702 | * /** |
703 | 703 | * * Description |
|
706 | 706 | * |
707 | 707 | * /** |
708 | 708 | * * Description |
709 | | - * * @param {String} - message |
| 709 | + * * @param {String} msg - message |
710 | 710 | * *\/ |
711 | | - * function method() {} |
| 711 | + * function method(msg) {} |
712 | 712 | * ``` |
713 | 713 | * |
714 | 714 | * ##### Invalid |
|
719 | 719 | * * |
720 | 720 | * * @param {String} message |
721 | 721 | * *\/ |
722 | | - * function method() {} |
| 722 | + * function method(message) {} |
723 | 723 | * ``` |
724 | 724 | * |
725 | 725 | * |
726 | 726 | * ### requireDescriptionCompleteSentence |
727 | 727 | * |
728 | | - * Ensures a doc comment description is a complete sentence. |
| 728 | + * Checks a doc comment description is a complete sentence. |
729 | 729 | * |
730 | 730 | * A complete sentence is defined as starting with an upper case letter and ending |
731 | 731 | * with a period. |
|
748 | 748 | * |
749 | 749 | * ```js |
750 | 750 | * /** |
751 | | - * * @param {String} - message |
| 751 | + * * @param {String} msg - message |
752 | 752 | * *\/ |
753 | | - * function method() {} |
| 753 | + * function method(msg) {} |
754 | 754 | * |
755 | 755 | * /** |
756 | 756 | * * Description. |
|
765 | 765 | * /** |
766 | 766 | * * Description. |
767 | 767 | * * |
768 | | - * * @param {String} - message |
| 768 | + * * @param {String} msg - message |
769 | 769 | * *\/ |
770 | | - * function method() {} |
| 770 | + * function method(msg) {} |
771 | 771 | * |
772 | 772 | * /** |
773 | 773 | * * Description |
774 | | - * * On multiple lines. |
| 774 | + * * on multiple lines are allowed. |
775 | 775 | * * |
776 | | - * * @param {String} - message |
| 776 | + * * @param {String} msg - message |
777 | 777 | * *\/ |
778 | | - * function method() {} |
| 778 | + * function method(msg) {} |
779 | 779 | * ``` |
780 | 780 | * |
781 | 781 | * ##### Invalid |
|
788 | 788 | * function method() {} |
789 | 789 | * |
790 | 790 | * /** |
| 791 | + * * Description |
| 792 | + * * On multiple lines should not start with an upper case. |
| 793 | + * * |
| 794 | + * * @param {String} - message |
| 795 | + * *\/ |
| 796 | + * function method() {} |
| 797 | + * |
| 798 | + * /** |
791 | 799 | * * description starting with a lower case letter. |
792 | 800 | * * @param {String} message |
793 | 801 | * *\/ |
|
809 | 817 | * |
810 | 818 | * ### requireParamDescription |
811 | 819 | * |
812 | | - * Ensures a param description exists. |
| 820 | + * Checks a param description exists. |
813 | 821 | * |
814 | 822 | * Type: `Boolean` |
815 | 823 | * |
|
856 | 864 | * |
857 | 865 | * ### requireReturnDescription |
858 | 866 | * |
859 | | - * Ensures a return description exists. |
| 867 | + * Checks a return description exists. |
860 | 868 | * |
861 | 869 | * Type: `Boolean` |
862 | 870 | * |
|
901 | 909 | * } |
902 | 910 | * ``` |
903 | 911 | * |
904 | | - * |
905 | 912 | */ |
906 | 913 | module.exports = require('jscs-jsdoc/lib/rules/validate-jsdoc'); |
0 commit comments