--- description: 'Disallow unnecessary constraints on generic types.' --- > 🛑 This file is source code, not the primary documentation location! 🛑 > > 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 `unknown`. It is therefore redundant to `extend` from `any` or `unknown`. ## Examples ### ❌ Incorrect ```ts interface FooAny {} interface FooUnknown {} type BarAny = {}; type BarUnknown = {}; class BazAny { quxAny() {} } const QuuxAny = () => {}; function QuuzAny() {} ``` ### ✅ Correct ```ts interface Foo {} type Bar = {}; class Baz { qux { } } const Quux = () => {}; function Quuz() {} ``` ## When Not To Use It If you don't care about the specific styles of your type constraints, or never use them in the first place, then you will not need this rule.