TypeScript documentation defines any as a type used to bypass type-checking, effectively treating the variable as if it could hold any value. While this flexibility can be useful, it can also introduce errors if used carelessly.
TypeScript advises against using any unless necessary, such as during JavaScript-to-TypeScript migrations. Instead, prefer unknown for safer handling, which allows for type safety and still accommodates a flexible coding style.
any can still be valuable in specific contexts, such as working with generics or creating decorators. It's important to apply any thoughtfully to maintain both flexibility and safety in your codebase.
When a team claims 'we don't use any,' it usually reflects a mature TypeScript project. However, even in such projects, any can be valuable when applied thoughtfully.
Collection
[
|
...
]