typeholes / tserr

A problems view for TypeScript errors
12 stars 0 forks source link

Add fixers #10

Open typeholes opened 1 year ago

typeholes commented 1 year ago

for example ```ts type T = { a: 1 }; const t: T = { a: 1, b: 2 }


There should be a way to correct this by removing the excess property or casting
typeholes commented 1 year ago

Fixers for excess property keys are working for the simple case where the error location span is the property key.

Still need to figure out how to locate the correct key to fix when the location span is larger.

note that simply searching property keys by name is not sufficient because the same name can exists at different paths through a nested object.

Worst case scenario is that no fix would be offered in ambiguous cases.