diff --git a/CHANGELOG.md b/CHANGELOG.md index 59623060b8..5bdec8dd6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,13 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange ### Added * [`destructuring-assignment`]: add option `destructureInSignature` ([#3235][] @golopot) +* [`no-unknown-property`]: Allow crossOrigin on image tag (SVG) ([#3251][] @zpao) ### Fixed * [`hook-use-state`]: Allow UPPERCASE setState setter prefixes ([#3244][] @duncanbeevers) * `propTypes`: add `VFC` to react generic type param map ([#3230][] @dlech) +[#3251]: https://github.com/yannickcr/eslint-plugin-react/pull/3251 [#3244]: https://github.com/yannickcr/eslint-plugin-react/pull/3244 [#3235]: https://github.com/yannickcr/eslint-plugin-react/pull/3235 [#3230]: https://github.com/yannickcr/eslint-plugin-react/issues/3230 diff --git a/lib/rules/no-unknown-property.js b/lib/rules/no-unknown-property.js index a1a155216c..7e5099347f 100644 --- a/lib/rules/no-unknown-property.js +++ b/lib/rules/no-unknown-property.js @@ -27,7 +27,8 @@ const DOM_ATTRIBUTE_NAMES = { }; const ATTRIBUTE_TAGS_MAP = { - crossOrigin: ['script', 'img', 'video', 'audio', 'link'], + // image is required for SVG support, all other tags are HTML. + crossOrigin: ['script', 'img', 'video', 'audio', 'link', 'image'], }; const SVGDOM_ATTRIBUTE_NAMES = { diff --git a/tests/lib/rules/no-unknown-property.js b/tests/lib/rules/no-unknown-property.js index c273ac7b2e..5191401f34 100644 --- a/tests/lib/rules/no-unknown-property.js +++ b/tests/lib/rules/no-unknown-property.js @@ -53,6 +53,7 @@ ruleTester.run('no-unknown-property', rule, { { code: '