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

Avoid flagging require-param with @implements present (and possibly also @augments/@extends) #100

Closed
brettz9 opened this issue Oct 31, 2018 · 2 comments · Fixed by abdulrahman305/openapi-to-postman#6

Comments

@brettz9
Copy link
Collaborator

brettz9 commented Oct 31, 2018

For the TransparentColor function in this example:

/**
 * @interface
 * @param {string} name The color name
 * @returns {object} A color object
 */
function Color (name) {}

/**
 * Function representing a transparent color.
 * @implements {Color}
 */
function TransparentColor (a) {}

...eslint-plugin-jsdoc's jsdoc/require-param rule complains with:

Missing JSDoc @param "a" declaration

However, the JSDoc (for @implements) states:

If you do not document one of the symbols in the implementation, JSDoc will automatically use the interface's documentation for that symbol.

This would seem to suggest that with @implements present, it is expected that values need only be added if they differ from the interface they are implementing.

While JSDoc even states:

You do not need to add the @implements tag to each member of the implementation (for example, the implementation's instance methods).

...it would be helpful if eslint-plugin-jsdoc could at least avoid the error when @implements is explicit on the block. In SVGEdit, we have a number of these real-world uses which are getting unduly flagged, and it would be a maintenance head-ache to have to duplicate parameter and return information on implementing objects as well as on the interface.

(@augments (or its synonym @extends) should probably behave this way as well. I see you already support this optionally with @override.)


Btw, I also filed an issue against jsdoctypeparser (at jsdoctypeparser/jsdoctypeparser#47 ) to allow "event:" within types as per the JSDoc spec--something I hope can be fixed so it can be surfaced through eslint-plugin-jsdoc (or make a fork if necessary if jsdoctypeparser is not being maintained).

And, FWIW, I've filed an issue at AtomLinter/linter-eslint#1192 for errors reported specifically for eslint-plugin/jsdoc rules--not sure if this is actually your issue or not.

@gajus
Copy link
Owner

gajus commented Oct 31, 2018

Sounds like a reasonable request.

PR welcome.

brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Nov 1, 2018
…and `allowAugmentsExtendsWithoutParam` and apply to `requireParam` (fixes gajus#100)
@brettz9 brettz9 mentioned this issue Nov 1, 2018
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Nov 13, 2018
…and `allowAugmentsExtendsWithoutParam` and apply to `requireParam` (fixes gajus#100)
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 7, 2018
…and `allowAugmentsExtendsWithoutParam` and apply to `requireParam` (fixes gajus#100)
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 7, 2018
…and `allowAugmentsExtendsWithoutParam` and apply to `requireParam` (fixes gajus#100)
@gajus gajus closed this as completed in 7a34bb1 Dec 7, 2018
@gajus
Copy link
Owner

gajus commented Dec 7, 2018

🎉 This issue has been resolved in version 3.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment