Skip to main content

typescript/no-empty-interfaces

Disallow empty interfaces without extends clauses.

Targeted pattern scope​

This rule targets interface declarations where:

  • body.body.length === 0 (no members), and
  • extends.length === 0 (no base interfaces).

What this rule reports​

This rule reports interfaces that declare no members and no base interfaces.

Why this rule exists​

An empty interface with no inheritance usually adds no type information and can often be replaced by a more explicit construct.

❌ Incorrect​

interface I {}

✅ Correct​

interface I {
value: string;
}

Deprecated​

Behavior and migration notes​

This rule is deprecated in favor of @typescript-eslint/no-empty-object-type.

It reports only and does not provide an autofix.

Options​

This rule has no options.

Status​

Use the Deprecated section above for lifecycle details.

Additional examples​

interface Marker extends Base {}
// ✅ valid: extends is present

interface Empty {}
// ❌ reported

ESLint flat config example​

import etcMisc from "eslint-plugin-etc-misc";

export default [
{
plugins: { "etc-misc": etcMisc },
rules: {
"etc-misc/typescript/no-empty-interfaces": "error",
},
},
];

When not to use it​

Disable this rule if marker interfaces are intentionally used in your project.

Package documentation​

Rule catalog ID: R115

Further reading​

Adoption resources​

  • Start at warning level in CI, then move to error after cleanup.
  • Use focused codemods/autofix batches per package or directory.