sindresorhus/eslint-plugin-unicorn

`no-useless-fallback-in-spread`: Support ternary

已关闭

#1,861 创建于 2022年7月19日

 (4 条评论) (7 个反应) (0 位负责人)JavaScript (468 个派生)user submission
enhancementhelp wanted

仓库指标

星标
 (5,022 个星标)
PR 合并指标
 (平均合并 4小时 30分钟) (30 天内合并 26 个 PR)

描述

The rule currently does not detect ternary like this:

{...(foo ? {bar: true} : {})}

This can be safely be reduced to

{...(foo && {bar: true})}

贡献者指南