sindresorhus/eslint-plugin-unicorn

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

Fechada

#1.861 aberto em 19 de jul. de 2022

 (4 comentários) (7 reações) (0 responsável)JavaScript (468 forks)user submission
enhancementhelp wanted

Métricas do repositório

Stars
 (5.022 estrelas)
Métricas de merge de PR
 (Mesclagem média 4h 30m) (26 fundiu PRs em 30d)

Description

The rule currently does not detect ternary like this:

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

This can be safely be reduced to

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

Guia do colaborador