DEV Community

loading...

Discussion on: JavaScript or TypeScript first?

Collapse
patarapolw profile image
Pacharapol Withayasakpunt

Don't forget to use // @ts-check, though.

Anyways, having to always write interface in @typedef is hell.

Collapse
davidjones418 profile image
David Jones

Yeah, if you get far beyond simple types in jsdoc it can get really messy and I tend to move types to a .d.ts file, although by that point I’m basically writing TS without a compile step.

You still get the autocomplete benefits of using type definitions without @ts-check, but you can leave some of your code untyped if you’re not concerned about correctness.