Comment by madeofpalk

3 years ago

> because they are way, way out on the edge in ways that stress Typescript compilers

I don't think this is true at all. Probably the main reason people typecheck js with jsdoc annotations is because they don't want a TS compile step.

Nodejs ES modules, and typescript, make it more complicated that it needs to be to write JS specifically for nodejs/cli scripts (not bundling to run in the browser). I now just prefer to // @ts-check my js files when writing node scripts.

> Probably the main reason people typecheck js with jsdoc annotations is because they don't want a TS compile step.

Right, I agree--because it's slow. Like AFAIK the tooling roundtrip is why Svelte/SvelteKit made the change. For normal projects, you don't have that same problem.

> for nodejs/cli scripts

I just use ts-node with the ESM loader. It's drop-in, for my purposes at least. What problems are you seeing?