-
Notifications
You must be signed in to change notification settings - Fork 13k
Fix(deprecation): report method name instead of type for deprecated methods #62406
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
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree
|
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 needs a test, but is probably wrong as it is casting nodes around to any to extract text. The fix should probably in the caller of addDeprecatedSuggestionWithSignature
as that func is just a helper that automates adding a diagnostic.
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.
Please address the prior comment from Jake
Fix deprecation message to show method name instead of type (#62396)
Changes
checkDeprecatedSignature
andaddDeprecatedSuggestionWithSignature
functions to extract and show the invoked method name.Summary of Changes
In
checkDeprecatedSignature
:tryGetPropertyAccessOrIdentifierToString
.PropertyAccessExpression
, retrieve the name frompropAccess.name.getText()
.<unknown>
only if no name can be determined.In
addDeprecatedSuggestionWithSignature
:deprecatedEntity
is falsy.Problem Solved
'(): ZodObject<{ compilerOptions: ZodAny; }, $loose>' is deprecated
'passthrough()' is deprecated
Related Issue