24
24
* [ ` checkDestructuredRoots ` ] ( #user-content-require-param-options-checkdestructuredroots )
25
25
* [ ` useDefaultObjectProperties ` ] ( #user-content-require-param-options-usedefaultobjectproperties )
26
26
* [ ` ignoreWhenAllParamsMissing ` ] ( #user-content-require-param-options-ignorewhenallparamsmissing )
27
+ * [ ` interfaceExemptsParamsCheck ` ] ( #user-content-require-param-options-interfaceexemptsparamscheck )
27
28
* [ Context and settings] ( #user-content-require-param-context-and-settings )
28
29
* [ Failing examples] ( #user-content-require-param-failing-examples )
29
30
* [ Passing examples] ( #user-content-require-param-passing-examples )
@@ -445,6 +446,17 @@ supplied as default values. Defaults to `false`.
445
446
Set to ` true ` to ignore reporting when all params are missing. Defaults to
446
447
` false ` .
447
448
449
+ <a name =" user-content-require-param-options-interfaceexemptsparamscheck " ></a >
450
+ <a name =" require-param-options-interfaceexemptsparamscheck " ></a >
451
+ ### <code >interfaceExemptsParamsCheck</code >
452
+
453
+ Set if you wish TypeScript interfaces to exempt checks for the existence of
454
+ ` @param ` 's.
455
+
456
+ Will check for a type defining the function itself (on a variable
457
+ declaration) or if there is a single destructured object with a type.
458
+ Defaults to ` false ` .
459
+
448
460
<a name =" user-content-require-param-context-and-settings " ></a >
449
461
<a name =" require-param-context-and-settings " ></a >
450
462
## Context and settings
@@ -455,7 +467,7 @@ Set to `true` to ignore reporting when all params are missing. Defaults to
455
467
| Tags | ` param ` |
456
468
| Aliases | ` arg ` , ` argument ` |
457
469
| Recommended | true|
458
- | Options | ` autoIncrementBase ` , ` checkConstructors ` , ` checkDestructured ` , ` checkDestructuredRoots ` , ` checkGetters ` , ` checkRestProperty ` , ` checkSetters ` , ` checkTypesPattern ` , ` contexts ` , ` enableFixer ` , ` enableRestElementFixer ` , ` enableRootFixer ` , ` exemptedBy ` , ` ignoreWhenAllParamsMissing ` , ` unnamedRootBase ` , ` useDefaultObjectProperties ` |
470
+ | Options | ` autoIncrementBase ` , ` checkConstructors ` , ` checkDestructured ` , ` checkDestructuredRoots ` , ` checkGetters ` , ` checkRestProperty ` , ` checkSetters ` , ` checkTypesPattern ` , ` contexts ` , ` enableFixer ` , ` enableRestElementFixer ` , ` enableRootFixer ` , ` exemptedBy ` , ` ignoreWhenAllParamsMissing ` , ` interfaceExemptsParamsCheck ` , ` unnamedRootBase ` , ` useDefaultObjectProperties ` |
459
471
| Settings | ` ignoreReplacesDocs ` , ` overrideReplacesDocs ` , ` augmentsExtendsReplacesDocs ` , ` implementsReplacesDocs ` |
460
472
461
473
<a name =" user-content-require-param-failing-examples " ></a >
@@ -1185,6 +1197,25 @@ function quux (a, b) {}
1185
1197
export type Test = (foo : number ) => string ;
1186
1198
// "jsdoc/require-param": ["error"|"warn", {"contexts":["TSFunctionType"]}]
1187
1199
// Message: Missing JSDoc @param "foo" declaration.
1200
+
1201
+ /**
1202
+ *
1203
+ */
1204
+ const quux = function quux (foo ) {
1205
+ };
1206
+ // "jsdoc/require-param": ["error"|"warn", {"interfaceExemptsParamsCheck":true}]
1207
+ // Message: Missing JSDoc @param "foo" declaration.
1208
+
1209
+ /**
1210
+ *
1211
+ */
1212
+ function quux ({
1213
+ abc ,
1214
+ def
1215
+ }) {
1216
+ }
1217
+ // "jsdoc/require-param": ["error"|"warn", {"interfaceExemptsParamsCheck":true}]
1218
+ // Message: Missing JSDoc @param "root0" declaration.
1188
1219
````
1189
1220
1190
1221
@@ -1853,5 +1884,22 @@ function myFunction(foo: string): void;
1853
1884
*/
1854
1885
function myFunction(): void ;
1855
1886
function myFunction(foo ? : string ) {}
1887
+
1888
+ /**
1889
+ *
1890
+ */
1891
+ const quux: FunctionInterface = function quux (foo ) {
1892
+ };
1893
+ // "jsdoc/require-param": ["error"|"warn", {"interfaceExemptsParamsCheck":true}]
1894
+
1895
+ /**
1896
+ *
1897
+ */
1898
+ function quux ({
1899
+ abc ,
1900
+ def
1901
+ }: FunctionInterface ) {
1902
+ }
1903
+ // "jsdoc/require-param": ["error"|"warn", {"interfaceExemptsParamsCheck":true}]
1856
1904
````
1857
1905
0 commit comments