no-conditional-empty-object-spread
WarningDo not spread a conditional object with an empty branch, such as ...(condition ? { value } : {}).
const options = { ...(timeout !== undefined ? { timeout } : {}),};const options = { ...(enabled ? {} : { disabled: true }) };const options = { ...defaults, timeout };const options = { ...(override ?? defaults) };How to fix
Omitting a key and setting it to undefined behave differently, so there is no automatic fix.
Build the object step by step, or pass the value and let the callee handle undefined.