Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsdoc/check-param-names reports Expected @param names to be "[object Object]" when using destructured spread arguments #1225

Open
Cipscis opened this issue Apr 12, 2024 · 0 comments

Comments

@Cipscis
Copy link

Cipscis commented Apr 12, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants