Using "any" in a TypeScript library is occasionally necessary


Using "any" in a TypeScript library is occasionally necessary.

Using "any" in an app's TypeScript code is rarely necessary.

So, an "any" in app code is likely caused by one of two things:

1. Inexperience
2. Laziness

Solve #1 via linting, pairing, and code reviews.
Solve #2 via a 1:1 conversation.
If your response is "use any where it makes sense". Sure, but point is, it *rarely* makes sense. It's a rare exception (usually because of a third party lib).

If typing *the app's code* hard, that's typically a sign the design or the data structures need tweaked.

View original on X