You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.)
The text was updated successfully, but these errors were encountered:
Having a hierarchy of React components is a very very big antipattern that's extremely discouraged by the React team, as well as the entire React community - you should prefer composition over inheritance.
There's a JSDoc comment that you can use to indicate to this plugin that your class is intending to be a React component, see #1220 (comment)
We have a shallow hierarchy of components, so very few things actually extend
React.Component
orReact.PureComponent
directly, which renders rules likereact/display-name
kind of useless. It would be very useful for us to be able to configure the detection of classes. Maybe something likesettings.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.)
The text was updated successfully, but these errors were encountered: