jsx-eslint/eslint-plugin-react

Rule proposal: prevent object literal spreads

Open

#2,217 创建于 2019年3月26日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)JavaScript (2,797 fork)batch import
help wantednew rule

仓库指标

Star
 (8,630 star)
PR 合并指标
 (平均合并 1天 17小时) (30 天内合并 3 个 PR)

描述

In JSX it's possible to write:

<Foo {...{a: 1, b: 2}} />

instead of

<Foo a={1} b={2} />

The former is valid JSX but (to React eyes) hard to read. It would be good to lint against it (it may be autofixable too, not sure about edge cases).

贡献者指南