Closed
Description
π Search Terms
isolatedDeclarations
, quick fix, promise
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
π» Code
export function waitUnkown(ms: number) {
return new Promise(() => {});
}
export function waitString(ms: number) {
return new Promise<string>(() => {});
}
π Actual behavior
The quick fix for waitUnknown
is "Add return type Promise"
Which annotates the return type as : Promise
-- which is a type error as the argument to the promise type is required.
π Expected behavior
The quick fix for waitUnknown
is "Add return type Promise", which is the correct, currently inferred type.
Additional information about the issue
I was trying to codemod Canva's codebase using ts-fix
and this bug created a bunch of bad code which I would need to fix up by hand.