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

Trace Highlights Unused Types #50

Open
LukeAbby opened this issue Jul 23, 2024 · 1 comment
Open

Trace Highlights Unused Types #50

LukeAbby opened this issue Jul 23, 2024 · 1 comment

Comments

@LukeAbby
Copy link

After running "Tracer: tsc trace" I can get warnings on extremely innocuous lines:
image

Of particular note:

export type ConstructorOf<Instance extends object> = new (
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    ...args: any[]
) => Instance;

Is completely unused.

And the type of PlainDate#date is the core Date type. Admittedly the core TS lib files can be quite slow to resolve but for the user it's completely unactionable and I find it strange that many usages, even seemingly innocuous ones, would be flagged.

There's also cases like so:
image

This is the repo where it's clearest that no excessive computation is going on but unfortunately I can't provide it as it's my work's codebase. Though, I could probably receive permission to release a minimal reproduction. However, I am also able to reproduce this somewhat in open source repositories, though in this case it's less clear if excessive computation is going on or not.

@typeholes
Copy link
Collaborator

Sorry it took so long to see this.
I'm having trouble reproducing this.
Are you sure these are coming from the trace metrics and not the "realtime" metrics which are measurements of tsserver response times?
Do you have this disabled?
image
If so, please do point me towards a type in an oss repo the shows this behavior.

I honestly have no idea how the trace could show a large duration for that date access

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

2 participants