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

False positive for modules dynamically loaded within a function #145

Open
jp7837 opened this issue Jun 6, 2020 · 3 comments
Open

False positive for modules dynamically loaded within a function #145

jp7837 opened this issue Jun 6, 2020 · 3 comments

Comments

@jp7837
Copy link

jp7837 commented Jun 6, 2020

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

@mrseanryan
Copy link
Collaborator

This is another example of #144

@mrseanryan
Copy link
Collaborator

Marking as enhancement, as it's a known limitation of the current approach.

Thanks for pointing it out though

@hornta
Copy link

hornta commented Feb 24, 2023

@mrseanryan If this package were to change approach, how would it be possible to detect this or even more complex code than this?

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

No branches or pull requests

3 participants