jsx-eslint/eslint-plugin-react

prop-types Validating external propTypes (eg. decorators)

Open

#322 geöffnet am 19. Nov. 2015

Auf GitHub ansehen
 (13 Kommentare) (7 Reaktionen) (0 zugewiesene Personen)JavaScript (2.797 Forks)batch import
enhancementhelp wantedrule

Repository-Metriken

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

Beschreibung

This is something that comes from loggur/react-redux-provide#1 as propTypes are used to actually define data that will be provided to the component like this:

@provide({
  list: PropTypes.arrayOf(PropTypes.object).isRequired,
  pushItem: PropTypes.func.isRequired
})
export default class GoodTimes extends Component {
}

That doesn't coop well with this rule unfortunately. I am wondering if there is a way how to analyze this and read propTypes from higher-order component / decorator also.

I have noticed some undocumented customValidators, but I am not sure how does that works. If I understand correctly it accepts list of props that will be ignored?

Contributor Guide