Create a lint rule to prevent certain components to be rendered as a child

Viewed 36

I have a component Paragraph and I want to prevent a component called MarkupRenderer for being rendered as a child. I know that's sounds strange but I'm curious if there's some way to do that creating a lint rule.

  export const Paragraph = () => {
      return (
        <Text>
          {children}
        </Text>
      );
    };

The code bellow is what I want to prevent

<Paragraph>
   <MarkupRenderer />
</Paragraph>
0 Answers
Related