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

Option to require a docblock for the file? #55

Closed
tdmalone opened this issue Dec 16, 2017 · 5 comments · Fixed by #464
Closed

Option to require a docblock for the file? #55

tdmalone opened this issue Dec 16, 2017 · 5 comments · Fixed by #464

Comments

@tdmalone
Copy link

A lot of the focus of docblocks is on functions, so this may not be a common need, but I'm wondering whether it might be worth an option to require a docblock at the top of the file?

There is at least one jsdoc tag that is specifically for use in a file docblock, so the concept is at least supported.

@gajus gajus added the question label Dec 16, 2017
@bary12
Copy link
Contributor

bary12 commented Feb 23, 2018

I would like to see us add a new rule for this, maybe jsdoc/require-file-overview. It would not fit our current architecture which does only search through function docs, but it can be done separately. Maybe I can open a pull request for this in a few days.

Edit July 2019: more than a few days have passed and I haven't done it.

@gajus
Copy link
Owner

gajus commented Jul 9, 2019

@bary12 Are you available to a PR for this?

@bary12
Copy link
Contributor

bary12 commented Jul 10, 2019

@gajus Unfortunately no

brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 28, 2019
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 29, 2019
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 29, 2019
@brettz9
Copy link
Collaborator

brettz9 commented Dec 29, 2019

I was thinking of tweaking my current PR for this (#464), to allow a whitelist of other tags to check since some other tags such as the following might, in at least some cases, be desirable as one per file (or 1+ per file): @license, @copyright, @author, @module and possibly @exports.

I'd also like to allow this whitelist to tweak the behavior per tag since the rule as it is currently not only checks that a given tag is present, but also currently checks that there are no duplicates and that it is not preceded by any non-comment code (a project might wish to allow some tags like @license to occur more than once per file, and not all need be in a prefatory context, e.g., @author attached to a particular function or @exports).

@license would be particularly interesting if supported, if used in conjunction with the check-values rule, with the allowedLicenses or licensePattern options, one could enforce that a license not only be present but also be of a particular whitelisted type (e.g., to check that one's project only consisted of say MIT and X11, or whatever).

Update: I've now filed #469 for this purpose.

brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 29, 2019
@gajus
Copy link
Owner

gajus commented Dec 31, 2019

🎉 This issue has been resolved in version 18.7.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