microsoft / microsoft/TypeScript

[quick fix][typescript] Quick fix to change return type of method - ts(2322)

Open
#31,488 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Sample method that returns number instead of string. Quick fix should change return type to number. Now it does nothing.

public someMethod(a: number): string {
        return 1;
}

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named in the issue. Start by locating the TypeScript quick-fix implementation for diagnostic ts(2322), then trace how the return-type change is proposed and add coverage showing that the sample method's return type changes to number.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.