eslint-plugin-jsdoc
eslint-plugin-jsdoc copied to clipboard
`jsdoc/check-param-names` reports `Expected @param names to be "[object Object]"` when using destructured spread arguments
Expected behavior
In my TypeScript projects, I occasionally use discriminated unions of tuples to define function parameters. This lets me get autocomplete for arguments based on the value of the first argument, without having to write an overload definition for each option.
If I give the wrong parameter names, I would expect the jsdoc/check-param-names
to tell me. I would also expect it not to complain if I give the correct parameter names.
Actual behavior
Even if I use the correct parameter names, I get an eslint error saying:
Expected @param names to be "[object Object]".
ESLint Config
'jsdoc/check-param-names': 'warn',
ESLint sample
type FnArgs = [type: 'a', arg: number] | [type: 'b', arg: string];
/**
* @param type Type
* @param arg Arg
*/
export function fn(...[type, arg]: FnArgs): void {
// ...
}
Environment
- Node version: 20.11.1
- ESLint version 10.5.0
-
eslint-plugin-jsdoc
version: 48.2.3