Skip to content

Add prefer-flow-prop-types rule #1205

Open
@keithkml

Description

@keithkml

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
  };
  // ...
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions