3 ms·
We’ve forbidden the use of any specifically because it’s unwieldy. You can develop using ‘unknown’ until you’re finally ready to type something correctly. It wo
by devjab 3y ago
We’ve forbidden the use of any specifically because it’s unwieldy. You can develop using ‘unknown’ until you’re finally ready to type something correctly. It works like any, but it doesn’t allow you to reassign your type. In our opinion any is one of the legacies of JavaScript that you should never, ever, use.
It’s not like you can’t of course, it’s just that it doesn’t “encourage” your developers to type things as they build them, which will eventually lead to shortcuts for a lot of people (myself included). Even if it doesn’t, it’s usually better for people to think about their types earlier rather than later, especially the less senior they are, or at least that is our experience. It’s much easier to get new people onboard when they aren’t doing “bad habits” that they then have to fix before their code is allowed to pass through the production pipeline.