-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
feat(11378): Check @param names in JSDoc method documentation #47257
Conversation
A quick summary of the issue after re-reading it:
|
@jakebailey I added you to the review because I can't remember if you've seen a codefix PR before. This is a nice simple one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked at the codefix's code yet, but from looking at the tests, I wish that it were able to suggest a replacement parameter when a good match could be found. I need to think about whether this fix is worthwhile without it.
That involves estimating how often this codefix would be used on existing, incorrect param tags, and how those tags are incorrect. My initial thought is that most bad tags occur when they no longer match the function, and that tag should be changed, not the parameter list.
@sandersn Thanks for the review.
Do you mean that we need to remove /**
* @param x first summand
* @param y second summand
* @param z third summand
*/
function sum (a: number, b: number) : number {
return a + b;
}
Do you mean |
Maybe I'm misreading the tests, but the suggestion added seems backward to me. Isn't it more likely that the code itself is "correct" and it's the JSDoc that should be updated, not the other way around? |
@jakebailey I added a question to clarify this logic. If need to change a JSDoc instead of the signature, I will change the QF. |
I agree with @jakebailey. I think the codefix should assume that the parameter list is correct and try to make the |
9bf5123
to
0f5cc8f
Compare
@a-tarasyuk, @gabritto pointed out that I missed your question in
|
0f5cc8f
to
56c35db
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few minor style things.
6e14961
to
34127d2
Compare
34127d2
to
f403488
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good to me, though I don't have much experience with these code fix PRs. Is there anything special needed if "fix all" support is desired, or is that already magically implemented (or, not needed anyhow?).
@sandersn Can take a peek to see if he's good with the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one more wrinkle I noticed.
f403488
to
a036c01
Compare
a036c01
to
108fb7c
Compare
Fixes #11378