jsx-eslint/eslint-plugin-react

Allow prop-types rule to skip non-exported SFCs

Aberta

#494 aberto em 9 de mar. de 2016

 (20 comentários) (5 reações) (0 responsável)JavaScript (2.731 forks)batch import
help wantednew rule

Métricas do repositório

Stars
 (9.293 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

From the docs:

For now we should detect components created with:

  • React.createClass()
  • an ES6 class that inherit from React.Component or Component
  • a stateless function that return JSX or the result of a React.createElement call.

It would be great if we could enforce propTypes being defined on React.createClass() and React.Component-extended components, but not stateless functions which return JSX.

In fact, defining .propTypes in function use such as { arr.map((name, i) => <Row key={ i }>{ name }</Row>) } would increase verbosity considerably

Guia do colaborador