by gpmcadam · 8y ago · 0 comments
In my experience it doesn't help people, especially at an earlier stage, but rather clutters what people already know about JavaScript. It causes tooling to slow down and ultimately doesn't prevent bugs that could not already be caught by good design and linting.
I'm much more of a fan of something like PropTypes, which isn't just superficial, but actually runs on your code in all places and will stop you passing the wrong types to components, regardless of what environment you're in.
Otherwise everything else on this list is a +1
TypeScript doesn't prevent any bugs that tests would not, but it does so faster and more concisely.
Tooling slowdown depends on your tooling setup; TypeScript can compile JSX on its own.
PropTypes are useful if you're transitioning from a plain JS codebase. But if you can start with and go full TS, I highly recommend going that route.