|
12 | 12 | * [`checkDestructured`](#user-content-check-param-names-options-checkdestructured)
|
13 | 13 | * [`useDefaultObjectProperties`](#user-content-check-param-names-options-usedefaultobjectproperties)
|
14 | 14 | * [`disableExtraPropertyReporting`](#user-content-check-param-names-options-disableextrapropertyreporting)
|
| 15 | + * [`disableMissingParamChecks`](#user-content-check-param-names-options-disablemissingparamchecks) |
15 | 16 | * [Context and settings](#user-content-check-param-names-context-and-settings)
|
16 | 17 | * [Failing examples](#user-content-check-param-names-failing-examples)
|
17 | 18 | * [Passing examples](#user-content-check-param-names-passing-examples)
|
@@ -116,11 +117,11 @@ item at the same level is destructured as destructuring will prevent other
|
116 | 117 | access and this option is only intended to permit documenting extra properties
|
117 | 118 | that are available and actually used in the function.
|
118 | 119 |
|
119 |
| -<a name="user-content-check-param-names-options-disableMissingParamChecks"></a> |
120 |
| -<a name="check-param-names-options-disableMissingParamChecks"></a> |
| 120 | +<a name="user-content-check-param-names-options-disablemissingparamchecks"></a> |
| 121 | +<a name="check-param-names-options-disablemissingparamchecks"></a> |
121 | 122 | ### <code>disableMissingParamChecks</code>
|
122 | 123 |
|
123 |
| -Whether to check for missing `@param` definitions. Defaults to `false`. Change to `true` if you want to be able to omit properties. |
| 124 | +Whether to avoid checks for missing `@param` definitions. Defaults to `false`. Change to `true` if you want to be able to omit properties. |
124 | 125 |
|
125 | 126 | <a name="user-content-check-param-names-context-and-settings"></a>
|
126 | 127 | <a name="check-param-names-context-and-settings"></a>
|
@@ -621,6 +622,41 @@ function quux (foo) {
|
621 | 622 | */
|
622 | 623 | declare function foo(bar: number) {}
|
623 | 624 | // Message: Expected @param names to be "bar". Got "barr".
|
| 625 | + |
| 626 | +/** |
| 627 | + * @param foo |
| 628 | + * @param foo.bar |
| 629 | + */ |
| 630 | +function quux (bar, foo) { |
| 631 | +} |
| 632 | +// "jsdoc/check-param-names": ["error"|"warn", {"disableMissingParamChecks":false}] |
| 633 | +// Message: Expected @param names to be "bar, foo". Got "foo". |
| 634 | + |
| 635 | +/** |
| 636 | + * @param foo |
| 637 | + */ |
| 638 | +function quux (bar, baz) { |
| 639 | +} |
| 640 | +// "jsdoc/check-param-names": ["error"|"warn", {"disableMissingParamChecks":true}] |
| 641 | +// Message: Expected @param names to be "bar, baz". Got "foo". |
| 642 | + |
| 643 | +/** |
| 644 | + * @param bar |
| 645 | + * @param foo |
| 646 | + */ |
| 647 | +function quux (foo, bar) { |
| 648 | +} |
| 649 | +// "jsdoc/check-param-names": ["error"|"warn", {"disableMissingParamChecks":true}] |
| 650 | +// Message: Expected @param names to be "foo, bar". Got "bar, foo". |
| 651 | + |
| 652 | +/** |
| 653 | + * @param foo |
| 654 | + * @param bar |
| 655 | + */ |
| 656 | +function quux (foo) { |
| 657 | +} |
| 658 | +// "jsdoc/check-param-names": ["error"|"warn", {"disableMissingParamChecks":true}] |
| 659 | +// Message: @param "bar" does not match an existing function parameter. |
624 | 660 | ````
|
625 | 661 |
|
626 | 662 |
|
@@ -1037,5 +1073,27 @@ function foo(this: T, bar: number): number {
|
1037 | 1073 | console.log(this.name);
|
1038 | 1074 | return bar;
|
1039 | 1075 | }
|
| 1076 | + |
| 1077 | +/** |
| 1078 | + * Documentation |
| 1079 | + */ |
| 1080 | +function quux (foo, bar) { |
| 1081 | +} |
| 1082 | +// "jsdoc/check-param-names": ["error"|"warn", {"disableMissingParamChecks":true}] |
| 1083 | + |
| 1084 | +/** |
| 1085 | + * @param bar |
| 1086 | + * @param bar.baz |
| 1087 | + */ |
| 1088 | +function quux (foo, bar) { |
| 1089 | +} |
| 1090 | +// "jsdoc/check-param-names": ["error"|"warn", {"disableMissingParamChecks":true}] |
| 1091 | + |
| 1092 | +/** |
| 1093 | + * @param foo |
| 1094 | + */ |
| 1095 | +function quux (foo, bar) { |
| 1096 | +} |
| 1097 | +// "jsdoc/check-param-names": ["error"|"warn", {"disableMissingParamChecks":true}] |
1040 | 1098 | ````
|
1041 | 1099 |
|
0 commit comments