340
you are viewing a single comment's thread
view the rest of the comments
[-] alokir@lemmy.world 5 points 1 year ago

Not necessarily, depending on your situation you can type the JS code yourself.

If the team making the JS code were using jsdoc then the Typescript compiler can recognize the comments and use it for type checking.

In some instances the compiler can infer types from JS code to do some basic validation.

Even if the external JS code is recognized as any, your own code that's using it still has types, so it's better than nothing.

this post was submitted on 18 Oct 2023
340 points (100.0% liked)

Programmer Humor

32456 readers
475 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS