-
Notifications
You must be signed in to change notification settings - Fork 35
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
checkRedundantParams: Jsdoc and destructuring #143
Comments
Oh, <3 issues about esnext features! ;-) But atm it doesn't supported. But anyway your jsdoc is wrong. Since your constructor has only one param {Object} with internal structure you should describe it correctly:
If you know how to do it correctly just tell me because I don't ;-( I don't see anything in jsdoc manuals. |
WebStorm generates my jsdoc with unstructured param names, I think it's corrent since I do not have access in constructor to "opt" or "opt.query" but only to "action" and "result". |
http://usejsdoc.org/tags-param.html — nothing about it jsdoc/jsdoc#987 (comment) — gotcha! |
I've left the comment in jsdoc repo. I'm fine if we make this possible, but then it won't work in jsdoc tool. Guess it will hurt a lot of people ;-( Personally I don't like this noise but... dunno. I'm open to suggestions. Perhaps community will join to the discuss. |
Thanks for the detailed answer. I'll try to stick with your suggestion for now, but hope jscs will allow brief param descriptoin for such cases in the future. |
Sorry, I was quick to decide on closing. Jsdoc may not support this feature as it is, but it allows to describe params as I suggested, so it's up to jcsc to support such syntax in linting. |
Also to the issue: jscs does not highlight param names as wrong, it just indicates mismatch of parameters count, so partial support for destructuring is provided already (by the parser, I assume). |
Checked your suggestion about fake param "opt". Jcsc highlights param name as not present in function arguments, so this solution is not appropriate. |
I use jscs 2.1.0 with
{"esnext": true, "jsDoc": {"checkRedundantParams": true}}
in WebStorm for inline linting. Jscs highlights param definitions for destructured params (except first) as redundant:The text was updated successfully, but these errors were encountered: