-
-
Notifications
You must be signed in to change notification settings - Fork 163
Support destructuring assignment (array, object, and array/object rest) on param and property checks #11
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
Comments
Is this still the case, that the AST does not provide sufficient hints for the names here? I don't see why this is fundamentally different than the various prop-type validation rules which consider destructures which have been added to the |
I would think that by now AST for this is available. I am not using JSDoc myself anymore. Wouldn't investigate this myself, but will accept a PR. |
Wow, rapid response! I'm happy to take a look, will report back. |
I'd hope this could also support:
Also ties into defaults #227 |
This is not the case anymore for below implementation.
This is not giving any error for me on version 8.4.2 of eslint-plugin-jsdoc eslint parsing options
VSCode version |
@Volem , |
… need to handle gajus#11 )
… need to handle gajus#11 )
Hey everyone, |
@bodinsamuel : It would indeed be great to have, but not assigned to anyone currently, and I have no plans currently to take it on. PRs welcome! |
This support should I think also be added for |
Two complexities to consider... For repeating (rest-like) elements, the jsdoc docs for param only have this example: /**
* Returns the sum of all numbers passed to the function.
* @param {...number} num - A positive or negative number.
*/
function sum(num) { It is not clear here what should be used with actual destructuring. And if there is an object rest property: /**
* @param {PlainObject} cfg
* @param cfg.num
* @param cfg.cfg1
* @param cfg.cfg2
*/
function sum({num ...extra}) {
} ...should the above be ok? I would think it could be since |
Support destructuring assignment in function parameter.
Example:
The text was updated successfully, but these errors were encountered: