jsx-eslint/eslint-plugin-react

Rule proposal: jsx-padded-children

Open

#2,045 创建于 2018年11月13日

在 GitHub 查看
 (4 评论) (5 反应) (0 负责人)JavaScript (8,630 star) (2,797 fork)batch import
acceptedhelp wantednew rule

描述

Something similar to padded-blocks where it disallows code similar to this:

<div>

  <img />
</div>

Depending on the setting the following should not throw a warning:

// jsx-padded-children: [2, "always"]
<div>

  <img />

</div>

// jsx-padded-children: [2, "never"]
<div>
  <img />
</div>

Not sure if anyone ever would pick up always, that's why I'm also down for jsx-no-padded-children or something like that

贡献者指南