Skip to content

typescript/no-empty-interface Style

What it does

Disallow the declaration of empty interfaces.

Why is this bad?

An empty interface in TypeScript does very little: any non-nullable value is assignable to {}. Using an empty interface is often a sign of programmer error, such as misunderstanding the concept of {} or forgetting to fill in fields. This rule aims to ensure that only meaningful interfaces are declared in the code.

Example

ts
interface Foo {}
interface Bar extends Foo {}

References

Released under the MIT License.