-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Check @param names in JSDoc method documentation #11378
Comments
My personal opinion is that this would be a great linter feature in something like |
@kitsonk, while i agree with you in a .ts file, in a .js file we already use the JSDoc comments for type information. the function in the OP, would not be typed correctly as we did not find the documentation for parameter @RyanCavanaugh, we should consider doing this as part of #6802. make JSDoc errors a category by their own. we today swallow all these errors. |
Now that we have info-level diagnostics with codefixes, we could do it that way. Accepting PRs for this one. This one is a good bit of work, but it's all based on existing code. You'll just have to
Make sure the codefix works in JS too! |
I'd like to have a try on it |
OK, I assigned you to the issue, @Kingwl. Unassign yourself if you decide not to do this. |
Oh. Sorry. I forget this one. |
JSDoc applied to methods tend to age. Typically method parameters are added / removed / changed but their documentation remain unchanged.
Typescript compiler should check the @param names and should write an error, if they are not found in the method signature. Maybe this check should be optional, by a compiler flag.
TypeScript Version: (2.0.3)
Code
Expected behavior:
Should log an tsc compiler error for unknown methods parameters: x, y, z
Actual behavior:
Compiles without an error.
The text was updated successfully, but these errors were encountered: