yathern yathern - 27 days ago 8
TypeScript Question

How to get VS Code or Typescript to use my JSDoc typings

I'm starting a Typescript project, but I'm very accustomed to writing JSdoc style comments, and would prefer to continue to use that style - in addition to some of the other Typescript niceties.

But I can't seem to get VS Code to recognize any of my typing - and infers it's own stuff.

All the pointed out parts in this image show no typing

This is in a typescript (.ts) file, with a tsconfig.json, and using only the valid typings shown here. What am I doing wrong?

Answer Source

TypeScript doesn't look at jsdocs typings in TS files. The rational is that the type annotations in the language are the source of typings truth, and trying to merge these annotations with the JS Docs typings would be confusing