Should I use js or ts for a library.

Im wondering whether use of typescript is advantageous when using javascript for interfacing with the library. Does it internally benefit from typechecking or something?
3 Replies
MartynasXS
MartynasXS9mo ago
its just for personal use nothing to be published just wondering.
Joao
Joao9mo ago
I would recommend to do it if you can, or want to practice / learn how to create a library in TS. And if the additional time figuring out the right type system is not a problem. I may be wrong about this, but I seem to remember that VSCode (probably other IDEs as well) use TypeScript under the hood anyway. So that alone may provide some benefit, at least in the form of autocompletion. Another way to see it is, make in JavaScript first to get a taste of what the library would look and behave like, and once you have a better picture port it to TypeScript.
MartynasXS
MartynasXS9mo ago
Alright, thanks.