jsx-eslint/eslint-plugin-react

Rule proposal: jsx-padded-children

Aperta

#2045 aperta il 13 nov 2018

 (4 commenti) (5 reazioni) (0 assegnatari)JavaScript (2731 fork)batch import
acceptedhelp wantednew rule

Metriche repository

Star
 (9293 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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

Guida contributor