TypeScript Declaration Shape
Flags interface/class/namespace shape problems: empty interfaces, oversized definitions, deep inheritance, declaration merging, and missing return types.
The way TypeScript declarations are shaped affects readability, refactor cost, and how well downstream tooling can leverage the type system. Empty interfaces hide intent, oversized interfaces resist focused changes, deep inheritance trees obscure data flow, and namespaces resist the module-aware tooling that ES modules unlock. This analysis surfaces these shape problems so they can be addressed before they entrench.
Severity guide
- info
- A declaration shape is unusual but not problematic — review and refactor when convenient.
- warning
- A declaration shape is hindering readability or refactor cost; the listed item should be addressed.
- critical
- Not currently emitted by this analysis.
Remediation
Replace empty interfaces with type aliases, split oversized interfaces, prefer ES modules over namespaces, and add explicit return types to exported functions.
Replace empty interfaces with type aliases, split oversized interfaces, prefer ES modules over namespaces, and add explicit return types to exported functions.