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 only enforce jsdoc/require-param if any parameters are documented, but allow no parameters to be documented #1317

Closed
matthew-holder-revvity opened this issue Sep 23, 2024 · 2 comments · Fixed by #1318

Comments

@matthew-holder-revvity
Copy link

Motivation

Some functions are so simple, such as type-guard function in TypeScript, that they don't really need their parameters to be typed. For example:

/** Determines if the value is a number. */
export function isNumber(value: unknown): value is number { return typeof value === 'number' }

These functions would look cleaner with a single line comment. This would also not be limited to just type-guard functions, but many kinds of simple single argument functions.

Current behavior

Currently the rule requires all parameters to be documented.

Desired behavior

An option that would enable a sort of all-or-nothing mode; if any parameter is document, then they all must be. Otherwise, none need be.

Alternatives considered

While pattern exclusions may work fine for some project, likely not all.

@matthew-holder-revvity matthew-holder-revvity changed the title Option to only enforce jsdoc/require-param if any parameters are documented. Option to only enforce jsdoc/require-param if any parameters are documented, but allow no parameters to be documented Sep 23, 2024
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Sep 24, 2024
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Sep 25, 2024
Copy link

🎉 This issue has been resolved in version 50.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@matthew-holder-revvity
Copy link
Author

Nice, thanks.

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.

1 participant