Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I guess you mean relying only on type inference? That will only get you so far. E.g. function parameters for freestanding functions would still be untyped. For those to be typed you need TypeScript or JSDoc annotations as OP noted.


Probably the OP meant “allowJs” and “noEmit” flags give you limited actual typechecking in your JS files


Exactly. You would use jsconfig in place of tsconfig, and disable the build just like you said. At that point you can use JSDoc for typing as well as .ts.d files when the JSDoc is not enough.

It's a bit more verbose, but overall I find it refreshing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: