no-empty-object-type
What it does
Section titled “What it does”Reports the type {} (also in type T = {}) and an interface with no members that extends at most one type. {} in an intersection ({} & X) and an interface that extends two types are not reported.
Why it matters
Section titled “Why it matters”{} does not mean an empty object: it accepts every value except null and undefined, numbers and strings included. An empty interface that only extends one type is the same as that type.
To fix, write object for any non-primitive, unknown for any value, Record<string, never> for an empty object, or the type itself.
Example
Section titled “Example”...type A = {};type B = {} & { a: 1 };interface C {}interface D extends A {}interface E extends A, B {}interface F { a: 1 }...Configuration
Section titled “Configuration”js: lint: rules: no-empty-object-type: warn # off (default), warn, errorEnabled by the presets: js/typescript-eslint-recommended, js/biome-recommended.
Suppress one line with sudsy-disable-next-line no-empty-object-type in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.
| Tool | Rule | Match | What differs |
|---|---|---|---|
| typescript-eslint | no-empty-object-type |
partial | the options (allowInterfaces, allowObjectTypes, allowWithName) keep their defaults |