You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 51910df
Browse filesBrowse the repository at this point in the historyBrowse files
authored
feat(linter/jsdoc): Add missing options to require-param-type rule (#23418)
Closes#23371
### AI usage disclosure
I used Claude Code to generate this PR description.
### Summary
Adds configuration support and a fixer to the `jsdoc/require-param-type`
rule, matching `eslint-plugin-jsdoc`.
**New options:**
- `setDefaultDestructuredRootType` (default `false`). When `true`,
auto-fixes a missing type on a destructured root `@param`.
- `defaultDestructuredRootType` (default `"object"`). The type string
used by that fix.
---------
Co-authored-by: Kapobajza <kapobajza@gmail.com>
Co-authored-by: Cameron Clark <cameron.clark@hey.com>
* The type string to set by default for destructured roots. Defaults to "object".
2381
+
*/
2382
+
defaultDestructuredRootType?: string;
2383
+
/**
2384
+
* Whether to set a default destructured root type. For example, you may wish to avoid manually having to set the type for a `@param` corresponding to a destructured root object as it is always going to be an object. Uses `defaultDestructuredRootType` for the type string. Defaults to `false`.
/// The type string to set by default for destructured roots. Defaults to "object".
36
+
default_destructured_root_type:CompactStr,
37
+
/// Whether to set a default destructured root type. For example, you may wish to avoid manually having to set the type for a `@param` corresponding to a destructured root object as it is always going to be an object. Uses `defaultDestructuredRootType` for the type string. Defaults to `false`.
Copy file name to clipboardExpand all lines: npm/oxlint/configuration_schema.json
+36-1Lines changed: 36 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3500,7 +3500,24 @@
3500
3500
"$ref": "#/definitions/RuleNoConfig"
3501
3501
},
3502
3502
"jsdoc/require-param-type": {
3503
-
"$ref": "#/definitions/RuleNoConfig"
3503
+
"anyOf": [
3504
+
{
3505
+
"$ref": "#/definitions/RuleNoConfig"
3506
+
},
3507
+
{
3508
+
"type": "array",
3509
+
"items": [
3510
+
{
3511
+
"$ref": "#/definitions/AllowWarnDeny"
3512
+
},
3513
+
{
3514
+
"$ref": "#/definitions/RequireParamTypeConfig"
3515
+
}
3516
+
],
3517
+
"maxItems": 2,
3518
+
"minItems": 2
3519
+
}
3520
+
]
3504
3521
},
3505
3522
"jsdoc/require-property": {
3506
3523
"$ref": "#/definitions/RuleNoConfig"
@@ -16919,6 +16936,24 @@
16919
16936
},
16920
16937
"additionalProperties": false
16921
16938
},
16939
+
"RequireParamTypeConfig": {
16940
+
"type": "object",
16941
+
"properties": {
16942
+
"defaultDestructuredRootType": {
16943
+
"description": "The type string to set by default for destructured roots. Defaults to \"object\".",
16944
+
"default": "object",
16945
+
"type": "string",
16946
+
"markdownDescription": "The type string to set by default for destructured roots. Defaults to \"object\"."
16947
+
},
16948
+
"setDefaultDestructuredRootType": {
16949
+
"description": "Whether to set a default destructured root type. For example, you may wish to avoid manually having to set the type for a `@param` corresponding to a destructured root object as it is always going to be an object. Uses `defaultDestructuredRootType` for the type string. Defaults to `false`.",
16950
+
"default": false,
16951
+
"type": "boolean",
16952
+
"markdownDescription": "Whether to set a default destructured root type. For example, you may wish to avoid manually having to set the type for a `@param` corresponding to a destructured root object as it is always going to be an object. Uses `defaultDestructuredRootType` for the type string. Defaults to `false`."
0 commit comments