Skip to content

Why ignoring casing on jsx-no-duplicate-props? #6956

Closed
@fbarbare

Description

@fbarbare

Is this a bug report?

No

Why ignoring casing on jsx-no-duplicate-props?

When using Material-UI, you have components that can have different props with different casing as: inputProps and InputProps, input referring to the rendered DOM element and Input relating to the React Component.
Is there a specific reason on why CRA specifically ignores the casing instead of just going with the default which is "letting the casing be"? Could we change this rule as it wouldn't be a breaking change (I'm happy to make the PR)?

It's right on this line: https://github.com/facebook/create-react-app/blob/master/packages/eslint-config-react-app/index.js#L232

Thanks for your time,
Florian

Activity

nmain

nmain commented on May 2, 2019

@nmain

I have also experienced this issue with Material-UI, although I'm more willing to blame their API for having confusable names.

Case is ignored because for createElement calls that correspond to native DOM elements, most props are case insensitive because they're translated to Element.prototype.setAttribute calls, which forces lower case on the attribute name. https://jsfiddle.net/6u0scetz/

rommguy

rommguy commented on May 15, 2019

@rommguy
Contributor

I think this should be fixed to use ignoreCase: false
Having the same issue with Material UI and the only solution for now is to use comments to disable this Eslint rule for the files that contain this kind of usage.

I'll be happy to submit a PR

ianschmitz

ianschmitz commented on May 15, 2019

@ianschmitz
Contributor

@rommguy feel free to start a PR. Sounds like a reasonable fix.

stale

stale commented on Jun 14, 2019

@stale

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

added a commit that references this issue on Jun 16, 2019
3dc4c48
rommguy

rommguy commented on Jun 16, 2019

@rommguy
Contributor
stale

stale commented on Jul 16, 2019

@stale

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

rommguy

rommguy commented on Jul 16, 2019

@rommguy
Contributor

Still waiting for PR to be reviewed

locked and limited conversation to collaborators on Jul 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @rommguy@fbarbare@ianschmitz@nmain

      Issue actions

        Why ignoring casing on `jsx-no-duplicate-props`? · Issue #6956 · facebook/create-react-app