jsx-eslint/eslint-plugin-react
Ver no GitHubAdd prefer-flow-prop-types rule
Open
#1.205 aberto em 18 de mai. de 2017
flowhelp wantednew rule
Métricas do repositório
- Stars
- (8.630 stars)
- Métricas de merge de PR
- (Nenhuma PRs mesclada em 30d)
Description
I would love a rule for preferring Flow types instead of propTypes. Our team is migrating and it would be great to use the linter for this purpose.
For example, it would produce an error on the following code:
export default class Statements extends React.Component {
static propTypes = {
items: PropTypes.array.isRequired,
fetchStatements: PropTypes.func,
isLoading: PropTypes.bool
};
// ...
}
But this code would remain valid:
export default class Statements extends React.Component {
props : {
items: string[],
fetchStatements?: () => void,
isLoading?: boolean
};
// ...
}