Skip to content

Allow custom component parent classes #1856

@haggholm

Description

@haggholm

We have a shallow hierarchy of components, so very few things actually extend React.Component or React.PureComponent directly, which renders rules like react/display-name kind of useless. It would be very useful for us to be able to configure the detection of classes. Maybe something like settings.pragma could allow for a list or regex of parent classes? E.g. Component.isES6Component could look up a custom regex in addition to the default ^(${pragma}\\.)?(Pure)?Component$.

(This looks pretty easy to me, though I’m not super familiar with the shared config; but if this would be welcome, I’d be happy to create a PR.)

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