Skip to content

Conversation

@klesun-st
Copy link

https://www.typescriptlang.org/docs/handbook/basic-types.html#any

After all, remember that all the convenience of any comes at the cost of losing type safety. Type safety is one of the main motivations for using TypeScript and you should try to avoid using any when not necessary.

The new documentation lacks any kind of warning about the dangers of any and why using it is a bad practice which was concerning considering that this is the official documentation of TypeScript.

https://www.typescriptlang.org/docs/handbook/basic-types.html#any

> After all, remember that all the convenience of any comes at the cost of losing type safety. Type safety is one of the main motivations for using TypeScript and you should try to avoid using any when not necessary.

The new documentation lacks any kind of warning about the dangers of any and why using it is a bad practice which was concerning considering that this is the official documentation of TypeScript.
@klesun-st
Copy link
Author

klesun-st commented Dec 10, 2025

Maybe even it would be better to add a link to this section in Do's and Don'ts page:

❌ Don’t use any as a type unless you are in the process of migrating a JavaScript project to TypeScript. The compiler effectively treats any as “please turn off type checking for this thing”. It is similar to putting an @ts-ignore comment around every usage of the variable. This can be very helpful when you are first migrating a JavaScript project to TypeScript as you can set the type for stuff you haven’t migrated yet as any, but in a full TypeScript project you are disabling type checking for any parts of your program that use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant