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

Require JSDoc on exported methods #192

Closed
Extersky opened this issue Apr 7, 2019 · 4 comments · Fixed by #262
Closed

Require JSDoc on exported methods #192

Extersky opened this issue Apr 7, 2019 · 4 comments · Fixed by #262

Comments

@Extersky
Copy link
Contributor

Extersky commented Apr 7, 2019

Support rule that requires JSDoc comment on publicly exported functions. This was originally proposed for now deprecated ESLint rule https://eslint.org/docs/rules/require-jsdoc.

Original enhancement suggestion:
eslint/eslint#7812

The rule could support ES6 exports and possibly other interfaces such as CommonJS exports.

@Extersky
Copy link
Contributor Author

Extersky commented Apr 7, 2019

I have an ongoing implementation of this here: Extersky@55fa30b

This version supports ES6 exports and CommonJS exports. Should CommonJS be supported for inclusion in this plugin? In the original proposal, only the ES6 exports were planned to be supported.

@ericrini
Copy link

ericrini commented May 11, 2019

This is a great feature, I'm surprised it doesn't exist. The rule "document all PUBLIC interfaces" is one I've always lived by and conversely, documenting private function feels unnecessary to me. I think that since node.js LTS is still using CommonJS modules there's definitely a good reason to support it. I wish more node.js modules had quality documentation.

To really make this work, I think all of the "jsdoc/require-" configurations would require an additional option like "always", "public", "never".

@brettz9
Copy link
Collaborator

brettz9 commented May 16, 2019

Sounds quite useful, @Extersky . Could you prepare a PR?

I'd think config to choose between which type of modules were supported would be ideal, but even if it is automatically for both, I think it would be a very handy to have.

Regarding, always/public/never, @ericrini , this is more or less what is requested by #78 (though to selectively exclude private functions, thereby effectively enabling a public option in addition to the default "always" behavior).

Extersky added a commit to Extersky/eslint-plugin-jsdoc that referenced this issue May 24, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to Extersky/eslint-plugin-jsdoc that referenced this issue May 24, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to Extersky/eslint-plugin-jsdoc that referenced this issue May 24, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to Extersky/eslint-plugin-jsdoc that referenced this issue May 28, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to brettz9/eslint-plugin-jsdoc that referenced this issue May 28, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to brettz9/eslint-plugin-jsdoc that referenced this issue May 29, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to Extersky/eslint-plugin-jsdoc that referenced this issue May 29, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to brettz9/eslint-plugin-jsdoc that referenced this issue May 30, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to brettz9/eslint-plugin-jsdoc that referenced this issue May 30, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to brettz9/eslint-plugin-jsdoc that referenced this issue May 30, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to Extersky/eslint-plugin-jsdoc that referenced this issue Jun 10, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jun 11, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jun 11, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jun 11, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to Extersky/eslint-plugin-jsdoc that referenced this issue Jun 14, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jun 16, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jun 18, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
brettz9 pushed a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jun 19, 2019
* When enabled, require all exported function bodies to have JSDoc block
* Fixes gajus#192
@gajus
Copy link
Owner

gajus commented Jun 19, 2019

🎉 This issue has been resolved in version 8.2.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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants