💼 This rule is enabled in the ✅ recommended
config.
🔧 This rule is automatically fixable by the --fix
CLI option.
Spreading falsy values in object literals won't add any unexpected properties, so it's unnecessary to add an empty object as fallback.
const object = {...(foo || {})};
const object = {...(foo ?? {})};
const object = {...foo};
const object = {...(foo && {})};
const array = [...(foo || [])];