TypeScript tricks that allow you to scale your app endlessly
We use TypeScript because it helps develop our apps safer and faster.
TypeScript by default has many simplifications. They help JavaScript developers to start using it easier but they waste a lot of time in the long term.
We collected a set of rules for more strict TypeScript. You just get used to it once and save much time working with your code in the future.

any
There is a simple rule that returns much profit in the long term.
Do not use “any”. Ever.
There is simply no case where you cannot describe a type instead of using “any”. If you have such a situation, it can be a problem in architecture, legacy or something else.
Use generics, unknown or overloads and do not worry about unexpected problems with data structures. Such problems are hard and expensive to debug.
strict
TypeScript has a “strict” mode that is unfortunately disabled by default. This mode enables a set of rules for safe and comfortable TypeScript. If you do not know about this mode, read the following article.
With “strict” mode you forget about errors like undefined is not a function or cannot read property X of null. Your types are accurate and correct.
And what should I do?
If you start a new project, enable “strict” and be happy.
If you have a project without “strict” mode and you want to enable it, you can meet a lot of compilations. It is very hard to write a strict code without alerts of the compiler. So it’s likely you have a lot of problematic places. Migrating the whole project to “strict” gets annoying pretty quickly.
It is recommended to cut this big task into pieces. The “strict” mode consists of a set of 6 rules. You can enable one of them and fix all errors. The next time, you enable the second one, fix errors and continue work and so on. One day you get a “strict” mode.
