jsx-eslint/eslint-plugin-react
在 GitHub 查看Rule proposal: prevent object literal spreads
Open
#2,217 建立於 2019年3月26日
help wantednew rule
倉庫指標
- Star
- (8,630 star)
- PR 合併指標
- (30 天內沒有已合併 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).