False positive for modules dynamically loaded within a function
jp7837 opened this issue · comments
a.ts
export used = 0;
b.ts
export function dynamicallyLoadA() {
return import("./a");
}
c.ts
import { dynamicallyLoadA } from "./b";
dynamicallyLoadA().then(A => {
console.log(A.used);
});
A.used
is not marked as used
Marking as enhancement, as it's a known limitation of the current approach.
Thanks for pointing it out though
@mrseanryan If this package were to change approach, how would it be possible to detect this or even more complex code than this?