TypeScript Vs JavaScript
Opinions
You can do literally everything TS can with JSDocs
By adding // @ts-check (Private) to the top of a .js file, it turns on the TS engine, which can infer types from JSDocs in the same way it does from TS. You can do literally everything TS can with JSDocs. I would strongly recommend the eslint-plugin-jsdoc. I use this ruleset:
https://github.com/tjw-lint/eslint-config-tjw-jsdoc
Use d.ts
-
https://www.reddit.com/r/vuejs/comments/st2zkt/comment/hx17byc/
-
" currently do both:
.d.ts for types
js files with docblocks that use those types"
-