src/content/docs/linter/rules/no-empty-type-parameters.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="TypeScript and TSX" icon="seti:typescript"> ## Summary - Rule available since: `v1.5.0` - Diagnostic Category: [`lint/complexity/noEmptyTypeParameters`](/reference/diagnostics#diagnostic-category) - This rule is **recommended**, meaning it is enabled by default. - This rule doesn't have a fix. - The default severity of this rule is [**warning**](/reference/diagnostics#warning). ## How to configure ```json title="biome.json" { "linter": { "rules": { "complexity": { "noEmptyTypeParameters": "error" } } } }## Description
Disallow empty type parameters in type aliases and interfaces.
TypeScript permits the use of empty type parameter lists in type alias and interface declarations; however, this practice is generally discouraged.
Allowing empty type parameter lists can lead to unclear or ambiguous code, where the intention of the generic type is not self-evident.
This rule disallows empty type parameter lists in type alias and interface declarations.
## Examples
### Invalid
```ts
interface Foo<> {}
type Bar<> = {};
interface Foo {}
type Foo<T> = {
bar: T;
}