Skip to content
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

Rethink fixing by error code and fixName #3

Open
andrewbranch opened this issue Jul 23, 2021 · 0 comments
Open

Rethink fixing by error code and fixName #3

andrewbranch opened this issue Jul 23, 2021 · 0 comments

Comments

@andrewbranch
Copy link
Collaborator

interface I {}

declare const obj: I;

obj.foo;
//  ^^^ Property 'aa' does not exist on type 'I'.ts(2339)

This error returns two fixes:

image

For each, the fixName is fixMissingMember. They represent two different ways of fixing the same thing. I believe the current code will try to apply them both. Unfortunately, there’s not actually a way to differentiate them besides their description property, which is dynamic.

A minimal fix, probably good enough to start with, would be to only apply the first fix returned for a given error, since we try to sort the most likely fixes first. If we need more granularity, we’d need an API change from TypeScript itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant