jsx-eslint/eslint-plugin-react

Rule proposal: jsx-padded-children

Open

#2.045 geöffnet am 13. Nov. 2018

Auf GitHub ansehen
 (4 Kommentare) (5 Reaktionen) (0 zugewiesene Personen)JavaScript (2.797 Forks)batch import
acceptedhelp wantednew rule

Repository-Metriken

Stars
 (8.630 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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

Contributor Guide