Skip to content

Allow ignoring missing @params #1169

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

Closed
phiresky opened this issue Nov 16, 2023 · 3 comments · Fixed by #1206
Closed

Allow ignoring missing @params #1169

phiresky opened this issue Nov 16, 2023 · 3 comments · Fixed by #1206

Comments

@phiresky
Copy link

Motivation

Often many parameters are self-explanatory, but some aren't. It would be great if jsdoc/check-param-names had an option to skip the missing

Current behavior

/**
 * @param additionalChecks If true, it is checked if the argument is within the bounds 0<x<100
 */
function add10(target: number, additionalChecks: boolean) {

Error:
Expected @param names to be "target, additionalChecks". Got "additionalChecks".

Desired behavior

Some parameters are self-explanatory. Adding a comment about them just increases noise and reduces readability. I understand if the default should stay as is but a config option like "jsdoc/check-param-names":["warn",{ disableMissingParamChecks: true}] would be great.

Alternatives considered

The only option I saw is disabling the rule completely - but that would also remove the checks for whether the param names are correct which I like.

@seanpoulter
Copy link
Contributor

Would you welcome a PR? If yes, is there any order to the tests in test/rules/assertions/checkParamNames.js or should I append to the end? Thanks folks!

@brettz9
Copy link
Collaborator

brettz9 commented Jan 29, 2024

Yes, a PR which adds a new option would be welcome.

The testing order is fairly arbitrary, though it will be published in the docs in order. You're welcome to just add to the end of the invalid and valid tests since it would be a new option.

Copy link

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

3 participants