From b42a0f3e54a60da5badcd6a07fce011b2b6ca3bb Mon Sep 17 00:00:00 2001 From: Almeida Date: Mon, 10 Oct 2022 12:16:14 +0000 Subject: [PATCH] [Fix] `no-unknown-property`: allow `allowFullScreen` on `iframe` Fixes #3456. --- CHANGELOG.md | 4 ++++ lib/rules/no-unknown-property.js | 6 +++--- tests/lib/rules/no-unknown-property.js | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca108097f7..0cd25d61fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange * [`hook-use-state`]: add `allowDestructuredState` option ([#3449][] @ljharb) * add [`sort-default-props`] and deprecate [`jsx-sort-default-props`] ([#1861][] @alexzherdev) +### Fixed +* [`no-unknown-property`]: allow `allowFullScreen` on `iframe` ([#3455][] @almeidx) + +[#3455]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3455 [#3449]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3449 [#3424]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3429 [#1861]: https://github.com/jsx-eslint/eslint-plugin-react/pull/1861 diff --git a/lib/rules/no-unknown-property.js b/lib/rules/no-unknown-property.js index 7c8b66ac24..83fa695bec 100644 --- a/lib/rules/no-unknown-property.js +++ b/lib/rules/no-unknown-property.js @@ -104,9 +104,9 @@ const ATTRIBUTE_TAGS_MAP = { loop: ['audio', 'video'], muted: ['audio', 'video'], playsInline: ['video'], - allowFullScreen: ['video'], - webkitAllowFullScreen: ['video'], - mozAllowFullScreen: ['video'], + allowFullScreen: ['iframe', 'video'], + webkitAllowFullScreen: ['iframe', 'video'], + mozAllowFullScreen: ['iframe', 'video'], poster: ['video'], preload: ['audio', 'video'], scrolling: ['iframe'], diff --git a/tests/lib/rules/no-unknown-property.js b/tests/lib/rules/no-unknown-property.js index 2fbc264185..86caae5437 100644 --- a/tests/lib/rules/no-unknown-property.js +++ b/tests/lib/rules/no-unknown-property.js @@ -70,6 +70,7 @@ ruleTester.run('no-unknown-property', rule, { { code: '' }, { code: '' }, { code: '