I'm not suggesting TypeScript will fix your bugs. But that it reveals your bugs.

Most people opt for escape hatches like any, unknown or type assertions(as) when they find it difficult to type a scenario better. Using these will silence TypeScript from revealing a potential bug. Knowing any language in-depth always help us to write quality code. The purpose of static code analysis is to expose the bugs that could happen at runtime before and, Typescript is doing a good job at it.