Closed
Description
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
Metadata
Metadata
Assignees
Labels
No labels
Activity
nmain commentedon 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 toElement.prototype.setAttribute
calls, which forces lower case on the attribute name. https://jsfiddle.net/6u0scetz/rommguy commentedon 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 commentedon May 15, 2019
@rommguy feel free to start a PR. Sounds like a reasonable fix.
stale commentedon 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.
Update jsx-no-duplicate-props config to not ignore case. Resolves fac…
rommguy commentedon Jun 16, 2019
@ianschmitz I opened a PR for this
stale commentedon 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.
rommguy commentedon Jul 16, 2019
Still waiting for PR to be reviewed