Avoiding any
s with Linting and TypeScript
any
s with Linting and TypeScriptTypeScript's any
type is, by design, the single most unsafe part of its type system.
The any
type indicates a type that can be anything and can be used in place of any other type.
Using any
is unsafe because the type disables many of TypeScript's type-checking features and hampers TypeScript's ability to provide developer assistance.
typescript-eslint includes several lint rules that help prevent unsafe practices around the any
type.
These rules flag uses of any
or code patterns that sneakily introduce it.
In this blog post, we'll show you those lint rules and several other handy ways to prevent any
s from sneaking into your code.