tracer icon indicating copy to clipboard operation
tracer copied to clipboard

Trace Highlights Unused Types

Open LukeAbby opened this issue 1 year ago • 1 comments

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.

LukeAbby avatar Jul 23 '24 12:07 LukeAbby

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

typeholes avatar Sep 14 '24 20:09 typeholes