Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
hanseul37 wants to merge3 commits intomicrosoft:main
base:main
Choose a base branch
Loading
fromhanseul37:fix62396

Conversation

hanseul37
Copy link

@hanseul37hanseul37 commentedSep 5, 2025
edited
Loading

Fix deprecation message to show method name instead of type (#62396)

Changes

  • Corrected the deprecation diagnostic message to display the actual method name instead of the method type.
  • ModifiedcheckDeprecatedSignature andaddDeprecatedSuggestionWithSignature functions to extract and show the invoked method name.

Summary of Changes

  1. IncheckDeprecatedSignature:

    • Extract the invoked expression's name usingtryGetPropertyAccessOrIdentifierToString.
    • If the name is missing and the expression is aPropertyAccessExpression, retrieve the name frompropAccess.name.getText().
    • Fallback to<unknown> only if no name can be determined.
  2. InaddDeprecatedSuggestionWithSignature:

    • Use the extracted method name for deprecated diagnostics whendeprecatedEntity is falsy.
    • Retains correct behavior for both signature-level and declaration-level deprecation messages.

Problem Solved

  • Before:'(): ZodObject<{ compilerOptions: ZodAny; }, $loose>' is deprecated
  • After:'passthrough()' is deprecated
  • The deprecation message now correctly shows the invoked method name instead of the type.

Related Issue

@github-project-automationgithub-project-automationbot moved this toNot started inPR BacklogSep 5, 2025
@hanseul37hanseul37 changed the titleFix(deprecation): report method name instead of type for deprecated methods (#62396)Fix(deprecation): report method name instead of type for deprecated methods #62396Sep 5, 2025
@hanseul37hanseul37 changed the titleFix(deprecation): report method name instead of type for deprecated methods #62396Fix(deprecation): report method name instead of type for deprecated methodsSep 5, 2025
@hanseul37
Copy link
Author

@microsoft-github-policy-service agree

@hanseul37 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@typescript-bottypescript-bot added the For Backlog BugPRs that fix a backlog bug labelSep 8, 2025
Copy link
Member

@jakebaileyjakebailey left a 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 ofaddDeprecatedSuggestionWithSignature as that func is just a helper that automates adding a diagnostic.

@github-project-automationgithub-project-automationbot moved this fromNot started toWaiting on author inPR BacklogSep 8, 2025
Copy link
Member

@RyanCavanaughRyanCavanaugh left a 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

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@RyanCavanaughRyanCavanaughRyanCavanaugh requested changes

@jakebaileyjakebaileyAwaiting requested review from jakebailey

Requested changes must be addressed to merge this pull request.

Assignees
No one assigned
Labels
For Backlog BugPRs that fix a backlog bug
Projects
Status: Waiting on author
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Deprecation error message reporting method type as deprecated instead of method name
4 participants
@hanseul37@jakebailey@RyanCavanaugh@typescript-bot

[8]ページ先頭

©2009-2025 Movatter.jp