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

References