Skip to content

emptyDestructures

Reports using empty destructuring patterns that destructure no values.

✅ This rule is included in the ts logical preset.

Empty destructuring patterns like {} or [] don’t extract any values from the source object or array and serve no practical purpose. These patterns are typically mistakes or leftover code from refactoring where variables were removed but the destructuring syntax remained.

const {} = object;
const [] = array;
function process({}) {
console.log("No values extracted");
}
for (const {} of items) {
console.log("No values extracted in loop");
}

This rule is not configurable.

If you have code that intentionally uses empty destructuring patterns for some reason (though this is rare), you might choose to disable this rule. However, in most cases, empty destructuring patterns indicate an error or code that should be cleaned up.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.