R26BREAKINGinterface

Interface Property Removed

Flags when a property is deleted from an interface. Consumers accessing that property will get compilation errors or runtime undefined.


Applies to

TypeScriptJavaGoRust

Why it matters

Removing a property from an interface affects two groups: 1. Implementers — objects providing the property now have an unused field (harmless) 2. Consumers — code reading the property gets undefined or a compile error (breaking)

Example

Before
// types.ts
export interface UserConfig {
  name: string;
  email: string;
  timeout: number;
}

// consumer
console.log(config.timeout); // works
After (property removed)
// types.ts (BREAKING)
export interface UserConfig {
  name: string;
  email: string;
  // timeout was removed
}

// consumer — NOW BROKEN
console.log(config.timeout); // ERROR: Property 'timeout' does not exist

What you see in the terminal

$ npx dg check

  [BREAKING] UserConfig (interface_property_removed)
  src/types.ts:2
  The required property 'timeout' was removed from the interface. Callers accessing this property will fail to compile.

How detection works

The classifier iterates through the old interface's properties and checks if each one still exists in the new interface. If a property is missing, the rule fires.

Real-world scenario

A team removes the timeout field from a configuration interface because they now use a global timeout setting. Every component that reads `config.timeout` will break.

Edge cases

  • Removing an optional property is still breaking — consumers may be reading it
  • Renaming a property (timeout -> timeoutMs) shows as removal + addition