-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
False positives in jsx-pascal-case when a variable and an element has the same name #329
Comments
I've encountered the same issue with |
I started looking into fixing this by adding the following test case to the {
code: [
'<svg>',
' <defs>',
' <linearGradient',
' x1="-1"',
' y1="0%"',
' x2="1"',
' y2="0%"',
' gradientTransform="rotate(5 .5 .5)"',
' >',
' <stop offset="0%" style={{ stopColor: BACKGROUND_COLOR }} />',
' <stop offset="20%" style={{ stopColor: SHIMMER_COLOR }} />',
' <stop offset="40%" style={{ stopColor: BACKGROUND_COLOR }} />',
' </linearGradient>',
' </defs>',
'</svg>'
].join('\n'),
ecmaFeatures: {
jsx: true
}
} and it passed. So maybe this has been fixed somewhere, or the problem exists in some combination of things that aren't true in this test but are true in our environments? |
Ok, I think the problem only occurs if you have a variable with the same name as your element. Another example by @yordis: <label htmlFor={name}>{label}</label> |
Is this being worked on? |
I have a component that renders some SVG elements that are showing up as false positives for the new jsx-pascal-case rule. The one I've found so far is the
<stop>
element, which is demonstrated by the following code:I'm not sure if there are others.
The text was updated successfully, but these errors were encountered: