DEV Community

Discussion on: Using Typescript without compilation

Collapse
 
dmass profile image
Douglas Massolari

Correct me if I'm wrong, but with JSDocs if some dev misses an error in the editor he will be able to push the code, right? While with the Typescript the errors will be catch in the build time, right?

Collapse
 
thepassle profile image
Pascal Schilp

Nope

Collapse
 
dmass profile image
Douglas Massolari

Can you please elaborate? What am I missing?

Thread Thread
 
thepassle profile image
Pascal Schilp

You still use tsc to do typechecking. You just skip the transpilation step. You can also do this in your CI or during the build to ensure your code stays typesafe. Typechecking is still done by typescript. You skip the compilation step.

Thread Thread
 
dmass profile image
Douglas Massolari

Oh, I see. Yeah, we can set up tsc in the CI to do the type-checking.
Of course, that would make the difference between using JSDocs and Typescript smaller in terms of build time.

I agree with you, it's a matter of preference. I personally prefer to use Typescript directly, I think it's more readable and easier to maintain.

Anyway, thanks for the article, it was fun to read and an interesting perspective on the topic.

Some comments have been hidden by the post's author - find out more