Skip to content

Commit 492c34c

Browse files
stefanprobstljharb
authored andcommitted
[Fix] no-unknown-property: allow fill prop on <symbol>
1 parent f56851b commit 492c34c

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
1515
* [`jsx-curly-brace-presence`]: handle single and only expression template literals ([#3538][] @taozhou-glean)
1616
* [`no-unknown-property`]: allow `onLoad` on `source` (@ljharb)
1717
* [`jsx-first-prop-new-line`]: ensure autofix preserves generics in component name ([#3546][] @ljharb)
18+
* [`no-unknown-property`]: allow `fill` prop on `<symbol>` ([#3555][] @stefanprobst)
1819

20+
[#3555]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3555
1921
[#3548]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3548
2022
[#3546]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3546
2123
[#3538]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3538

lib/rules/no-unknown-property.js

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const ATTRIBUTE_TAGS_MAP = {
4949
'polyline',
5050
'rect',
5151
'svg',
52+
'symbol',
5253
'text',
5354
'textPath',
5455
'tref',

tests/lib/rules/no-unknown-property.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ ruleTester.run('no-unknown-property', rule, {
5858
{ 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>' },
5959
{ code: '<g fill="#7B82A0" fillRule="evenodd"></g>' },
6060
{ code: '<mask fill="#7B82A0"></mask>' },
61+
{ code: '<symbol fill="#7B82A0"></symbol>' },
6162
{ code: '<meta property="og:type" content="website" />' },
6263
{ code: '<input type="checkbox" checked={checked} disabled={disabled} id={id} onChange={onChange} />' },
6364
{ code: '<video playsInline />' },
@@ -472,7 +473,7 @@ ruleTester.run('no-unknown-property', rule, {
472473
data: {
473474
name: 'fill',
474475
tagName: 'div',
475-
allowedTags: 'altGlyph, circle, ellipse, g, line, marker, mask, path, polygon, polyline, rect, svg, text, textPath, tref, tspan, use, animate, animateColor, animateMotion, animateTransform, set',
476+
allowedTags: 'altGlyph, circle, ellipse, g, line, marker, mask, path, polygon, polyline, rect, svg, symbol, text, textPath, tref, tspan, use, animate, animateColor, animateMotion, animateTransform, set',
476477
},
477478
},
478479
],

0 commit comments

Comments
 (0)