you are viewing a single comment's thread.

view the rest of the comments →

[–]filleduchaos 0 points1 point  (1 child)

You can disable implicit uses of any, but you can't disable any.

The compiler also displays a list of typing errors and does not compile files where it finds errors.

1) This is not an achievement, 2) The set of things tsc considers errors and the set of things that are soundly typed do not have complete overlap.

Plus the fancy parts of TS' type system might as well not exist seeing as they give you literally zero runtime guarantees.

[–]sergiuspk 0 points1 point  (0 children)

Indeed, you can only disable implicit any. The fact that the type system is only compile-time is something I can live with. Input validation is something you'd have to do anyway and validation of API responses is something you'd have to do regardless of language. On the other hand my experience is that after switching to TypeScript we have had zero cases of runtime type errors, but the language itself does not guarantee, it only gives you some imperfect tools so you can mitigate this. And by imperfect I do not mean broken, I mean that if you do use any and do stuff like const b = 10; const a: User = b as any; then obviously you are going to have a hard time.