From 1a75017c04d6661b53f6a59d3d58c31f273caeaa Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 13 Mar 2023 22:28:58 -0700 Subject: [PATCH] [Fix] `no-unknown-property`: allow `onLoad` on `source` See https://github.com/jsx-eslint/eslint-plugin-react/issues/3505#issuecomment-1463577002 --- CHANGELOG.md | 1 + lib/rules/no-unknown-property.js | 2 +- tests/lib/rules/no-unknown-property.js | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ff143d196..9d957976ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange ### Fixed * [`no-array-index-key`]: consider flatMap ([#3530][] @k-yle) * [`jsx-curly-brace-presence`]: handle single and only expression template literals ([#3538][] @taozhou-glean) +* [`no-unknown-property`]: allow `onLoad` on `source` (@ljharb) [#3538]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3538 [#3530]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3530 diff --git a/lib/rules/no-unknown-property.js b/lib/rules/no-unknown-property.js index de0404bfc1..dbb111a0ea 100644 --- a/lib/rules/no-unknown-property.js +++ b/lib/rules/no-unknown-property.js @@ -81,7 +81,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', 'object'], + onLoad: ['script', 'img', 'link', 'picture', 'iframe', 'object', 'source'], 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 4ea068030c..97fb9f3dc1 100644 --- a/tests/lib/rules/no-unknown-property.js +++ b/tests/lib/rules/no-unknown-property.js @@ -65,7 +65,7 @@ ruleTester.run('no-unknown-property', rule, { { code: '' }, { code: '