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

Add publicOnly option to other rules #725

Open
DMartens opened this issue May 10, 2021 · 1 comment · May be fixed by #890
Open

Add publicOnly option to other rules #725

DMartens opened this issue May 10, 2021 · 1 comment · May be fixed by #890

Comments

@DMartens
Copy link
Contributor

DMartens commented May 10, 2021

Motivation

Add the publicOnly option from require-jsdoc to other rules.
Personally I want to require jsdoc for all top-level functions for the types and only require descriptions when the functions are exported.
I am willing to create a PR for this functionality.

Current behavior

Currently only the rule require-jsdoc has the option publicOnly

Desired behavior

Add the same option to other rules. I would add them to require-description, require-param-description and require-returns-description.

Alternatives considered

This could also be a new rule as otherwise many other rules would be modified.
This new rule has a list of tag names requiring a description as an option.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@brettz9
Copy link
Collaborator

brettz9 commented May 10, 2021

Sounds good, though I would think adding to the existing rules would be a good idea--hopefully though as a call to some shared utility.

As far as listing tag names, this is somewhat related to #467 (which I need to review more carefully as it might have already been implemented with the recent comment AST option available to contexts; one can specify a particular JSDocTag for any context). Perhaps publicOnly could be implemented as a special context, and comment (pointing to such tags) would narrow down which publicOnly items would trigger the rule.

@DMartens DMartens linked a pull request Jun 4, 2022 that will close this issue
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.

2 participants