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

[Fix] no-unknown-property: allow fill prop on <symbol> #3555

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
* [`jsx-curly-brace-presence`]: handle single and only expression template literals ([#3538][] @taozhou-glean)
* [`no-unknown-property`]: allow `onLoad` on `source` (@ljharb)
* [`jsx-first-prop-new-line`]: ensure autofix preserves generics in component name ([#3546][] @ljharb)
* [`no-unknown-property`]: allow `fill` prop on `<symbol>` ([#3555][] @stefanprobst)

[#3555]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3555
[#3548]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3548
[#3546]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3546
[#3538]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3538
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const ATTRIBUTE_TAGS_MAP = {
'polyline',
'rect',
'svg',
'symbol',
'text',
'textPath',
'tref',
Expand Down
3 changes: 2 additions & 1 deletion tests/lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ ruleTester.run('no-unknown-property', rule, {
{ code: '<svg key="lock" viewBox="box" fill={10} d="d" stroke={1} strokeWidth={2} strokeLinecap={3} strokeLinejoin={4} transform="something" clipRule="else" x1={5} x2="6" y1="7" y2="8"></svg>' },
{ code: '<g fill="#7B82A0" fillRule="evenodd"></g>' },
{ code: '<mask fill="#7B82A0"></mask>' },
{ code: '<symbol fill="#7B82A0"></symbol>' },
{ code: '<meta property="og:type" content="website" />' },
{ code: '<input type="checkbox" checked={checked} disabled={disabled} id={id} onChange={onChange} />' },
{ code: '<video playsInline />' },
Expand Down Expand Up @@ -472,7 +473,7 @@ ruleTester.run('no-unknown-property', rule, {
data: {
name: 'fill',
tagName: 'div',
allowedTags: 'altGlyph, circle, ellipse, g, line, marker, mask, path, polygon, polyline, rect, svg, text, textPath, tref, tspan, use, animate, animateColor, animateMotion, animateTransform, set',
allowedTags: 'altGlyph, circle, ellipse, g, line, marker, mask, path, polygon, polyline, rect, svg, symbol, text, textPath, tref, tspan, use, animate, animateColor, animateMotion, animateTransform, set',
},
},
],
Expand Down