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
Make check-param-names to allow documenting non-defined parameters #450
Comments
I think this is a reasonable option to request, but as far as /**
* @param {...string} args Non-signature arguments
* @returns {string} Returns the first non-signature argument.
*/
function foo(...args) {
return args[0];
} Admittedly though, if you really needed to document |
I'm not using My real use case is for unused arguments I still need to document in JSDoc 😉 |
I cannot use your "Non-signature workaround" as I still need to document the first arguments that are used. Also the way we use JSDoc should not impact the code implementation at all. |
Re: your real use case of unfinished code (or document-driven-development), sure, and that is why I said it was a reasonable option to request. Re: the non-signature workaround, yes, that was the point of my caveat; it won't be able to handle distinct typing for each particular argument within the spread--which I think probably ought to be changed by jsdoc. As far as not impacting code implementations, this is generally true (though the likes of our However, whether rightly or wrongly, the current MDN page for
Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments I don't think we want to spend as much effort making rules supporting use of deprecated features. But granted, So I mention this more for the sake of a full discussion and for the possible edification of all users, rather than to knock down your whole proposal (which I also happen to like) or even negate the |
…o avoid reporting additional `@param`'s beyond actual function's arguments; fixes gajus#450
…o avoid reporting additional `@param`'s beyond actual function's arguments; fixes gajus#450
…o avoid reporting additional `@param`'s beyond actual function's arguments; fixes gajus#450
…o avoid reporting additional `@param`'s beyond actual function's arguments; fixes #450
🎉 This issue has been resolved in version 18.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I've migrated from the native ESLint JSDoc rules and so far everything went easy to implement, thank you so much for this project 😍
I have use cases where sometimes I need to add JSDoc on a function parameter that is not explicitly present on the function signature.
First use case is when I implement a "interface". On the concrete function (that implements the "interface"), I want to add JSDoc on ALL the parameter even though they are not consumed by the implementation.
But I got an error with the
check-param-names
ruleIs it possible to add an option to the
check-param-names
rule in order to allow non-defined function parameters? But of course only non-defined at THE END of the argument list.. Non-defined parameters that are not LAST will still make the rule to throw.🤔
Note that the old native ESLint JSDoc rule was allowing adding JSDoc on non-defined last arguments https://eslint.org/docs/rules/valid-jsdoc
Edit: In my use cases the JSDoc is super important for the developers that reads, implements and maintains the code. JSDoc is not only important for consumers but also for implementers. 😉
PS: Also, what about the
arguments
use case? Let's say I'm having this:The text was updated successfully, but these errors were encountered: