top | item 46266986

(no title)

crummy | 2 months ago

> For packages typed with JSDoc, CTRL/CMD clicking on a function will take you to actual code rather than a type declarations file. I much prefer this experience as a dev.

ok i didn't think about this, that's an underrated benefit

discuss

order

agumonkey|2 months ago

could be a customizable behavior in editor/ide though

g947o|2 months ago

There is indeed an option in VSCode "typescript.preferGoToSourceDefinition" --

Prefer Go To Source Definition

Makes `Go to Definition` avoid type declaration files when possible by triggering `Go to Source Definition` instead.

IshKebab|2 months ago

This works with Typescript too though?

filleduchaos|2 months ago

It doesn't. You might be thinking of libraries that you wrote, not packages from e.g. npm, which are distributed as JavaScript + type definition files not as TypeScript code.