Skip to content

feat: no-danger find props on all components (not just native) #3434

Closed
@AndersDJohnson

Description

@AndersDJohnson

Unless I am mistaken, it seems today that the rule react/no-danger has specific logic to only find usages on native elements. See the isDOMComponent check here:

if (jsxUtil.isDOMComponent(node.parent) && isDangerous(node.name.name)) {

We think it could be useful to support non-native components as well, especially in cases like styled-components wrappers, or components that want to offer this prop to be forwarded internally to a native element.

This could be a new default behavior, or an opt-in behavior via a new rule option.

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