Skip to content

forbid-prop-types: Checking forbidden proptypes as part of another proptype #2657

@thany

Description

@thany

Say for example, I forbid the any proptype. Quite common to do so.

This would be forbidden:

AwesomeComponent.propTypes = { foo: PropTypes.any };

But this would still be allowed:

AwesomeComponent.propTypes = { foo: PropTypes.arrayOf(PropTypes.any) };

Even though is clearly has that pesky any in there.

Can this rule please be extended to (optionally) also check for proptypes that are part of other proptypes? Call them sub-proptypes, I suppose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions