jsx-eslint/eslint-plugin-react

Rule proposal: jsx-padded-children

Open

#2.045 aberto em 13 de nov. de 2018

Ver no GitHub
 (4 comments) (5 reactions) (0 assignees)JavaScript (2.797 forks)batch import
acceptedhelp wantednew rule

Métricas do repositório

Stars
 (8.630 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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

Guia do colaborador