Skip to content

rule proposal: forbid element/components #887

@kentor

Description

@kentor

It would be useful to have a rule that forbids elements/components from a list of names.

In my organization we want to ban using <button> in favor of a custom <Button> component that is simply:

Button = (props) => <button type="button" {...props}>{props.children}</button>

The reason is to prevent a bug in IE where pressing enter on an input could trigger the click event on a button even when they don't share a parent form if the button has type="submit" (default if no type). (https://www.tjvantoll.com/2013/05/22/why-are-enter-keypresses-clicking-my-buttons-in-ie/)

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