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

Does not support destructuring in function arguments if the key in a destructured object is a string #598

Closed
michalczaplinski opened this issue Jul 1, 2020 · 0 comments · Fixed by #599
Labels

Comments

@michalczaplinski
Copy link
Contributor

michalczaplinski commented Jul 1, 2020

Expected behavior

The parser should be able to handle destructuring with renaming in function parameters when the key is a string.

Actual behavior

Eslint throws the Unsupported function signature format error and stops linting:

[Error - 11:50:20 AM] ESLint stack trace:
[Error - 11:50:20 AM] Error: Unsupported function signature format.
Occurred while linting /Users/czapla/Testing/frontity/packages/components/link.tsx:71
    at getParamName (/Users/czapla/Testing/frontity/node_modules/eslint-plugin-jsdoc/dist/jsdocUtils.js:178:11)

The offending code

const someFunction = ({ 
  "value": renamedValue,
  otherArg,
}) => {
  console.log("not important");
}

If I comment out the line with "value": renamedValue, the parser continues to work. This is a rare use case, because normally you can omit the quotes, but becomes necessary if the key includes a hyphen like { "renamed-value": renamedValue }

Environment

  • Node version: v14.2.0
  • ESLint version [email protected]
  • eslint-plugin-jsdoc version: 27.1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants