Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fbarbare opened this issue Apr 30, 2019 · 7 comments · Fixed by #7230
Closed

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

fbarbare opened this issue Apr 30, 2019 · 7 comments · Fixed by #7230

Comments

@fbarbare
Copy link

fbarbare commented Apr 30, 2019

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

@nmain
Copy link

nmain commented May 2, 2019

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
Copy link
Contributor

rommguy commented May 15, 2019

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
Copy link
Contributor

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

@stale
Copy link

stale bot commented Jun 14, 2019

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.

@stale stale bot added the stale label Jun 14, 2019
rommguy added a commit to rommguy/create-react-app that referenced this issue Jun 16, 2019
@rommguy
Copy link
Contributor

rommguy commented Jun 16, 2019

@ianschmitz I opened a PR for this

@stale
Copy link

stale bot commented Jul 16, 2019

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.

@stale stale bot added the stale label Jul 16, 2019
@rommguy
Copy link
Contributor

rommguy commented Jul 16, 2019

Still waiting for PR to be reviewed

@stale stale bot removed the stale label Jul 16, 2019
@lock lock bot locked and limited conversation to collaborators Jul 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants