Eslint-plugin-react: Rule proposal: jsx-padded-children

Created on 13 Nov 2018  路  4Comments  路  Source: yannickcr/eslint-plugin-react

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

accepted help wanted new rule

Most helpful comment

@joshuakelly go for it, that's what the "help wanted" label is for :-)

All 4 comments

I think both options are a good idea.

@joshuakelly go for it, that's what the "help wanted" label is for :-)

I closed my pr #2211. Feel free to pick this up.

any plans for someone to add this?

Was this page helpful?
0 / 5 - 0 ratings