diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md b/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md index b8672d945d50..5fd0e70d6532 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md @@ -7,8 +7,8 @@ description: 'Disallow unnecessary constraints on generic types.' > See **https://typescript-eslint.io/rules/no-unnecessary-type-constraint** for documentation. Generic type parameters (``) in TypeScript may be "constrained" with an [`extends` keyword](https://www.typescriptlang.org/docs/handbook/generics.html#generic-constraints). -When no `extends` is provided, type parameters default a constraint to `any`. -It is therefore redundant to `extend` from `any`. +When no `extends` is provided, type parameters default a constraint to `unknown`. +It is therefore redundant to `extend` from `any` or `unknown`. ## Examples @@ -19,8 +19,12 @@ It is therefore redundant to `extend` from `any`. ```ts interface FooAny {} +interface FooUnknown {} + type BarAny = {}; +type BarUnknown = {}; + class BazAny { quxAny() {} } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy