diff --git a/CHANGELOG.md b/CHANGELOG.md index 3359afacd0..54cb112a4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,12 +8,14 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange ### Fixed * [`no-unknown-property`]: add `viewBox` on `marker` ([#3416][] @ljharb) * [`no-unknown-property`]: add `noModule` on `script` ([#3414][] @ljharb) +* [`no-unknown-property`]: allow `onLoad` on `` ([#3415][] @OleksiiKachan) ### Changed * [Meta] npmignore markdownlint config ([#3413][] @jorrit) [#3416]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3416 +[#3415]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3415 [#3414]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3414 [#3413]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3413 diff --git a/lib/rules/no-unknown-property.js b/lib/rules/no-unknown-property.js index 2f1a4fc6fd..26e39fd24f 100644 --- a/lib/rules/no-unknown-property.js +++ b/lib/rules/no-unknown-property.js @@ -75,7 +75,7 @@ const ATTRIBUTE_TAGS_MAP = { onEncrypted: ['audio', 'video'], onEnded: ['audio', 'video'], onError: ['audio', 'video', 'img', 'link', 'source', 'script', 'picture', 'iframe'], - onLoad: ['script', 'img', 'link', 'picture', 'iframe'], + onLoad: ['script', 'img', 'link', 'picture', 'iframe', 'object'], onLoadedData: ['audio', 'video'], onLoadedMetadata: ['audio', 'video'], onLoadStart: ['audio', 'video'], diff --git a/tests/lib/rules/no-unknown-property.js b/tests/lib/rules/no-unknown-property.js index d58c6e21c1..911d28179b 100644 --- a/tests/lib/rules/no-unknown-property.js +++ b/tests/lib/rules/no-unknown-property.js @@ -66,6 +66,7 @@ ruleTester.run('no-unknown-property', rule, { { code: '' }, { code: '' }, { code: '' }, + { code: '' }, { code: '
' }, { code: '' }, { @@ -443,7 +444,7 @@ ruleTester.run('no-unknown-property', rule, { data: { name: 'onLoad', tagName: 'div', - allowedTags: 'script, img, link, picture, iframe', + allowedTags: 'script, img, link, picture, iframe, object', }, }, ],