From 7ba7ec4baba332c75a5dad0ea905327ae240821d Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 4 Sep 2022 23:22:34 -0700 Subject: [PATCH] [Fix] `no-unknown-property`: allow `webkitAllowFullScreen` and `mozAllowFullScreen` Fixes #3396 --- CHANGELOG.md | 2 ++ lib/rules/no-unknown-property.js | 4 ++-- tests/lib/rules/no-unknown-property.js | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6145af952b..03915d6f3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange ### Fixed * [`no-unknown-property`]: avoid warning on `fbt` nodes entirely ([#3391][] @ljharb) * [`no-unknown-property`]: add `download` property support for `a` and `area` ([#3394][] @HJain13) +* [`no-unknown-property`]: allow `webkitAllowFullScreen` and `mozAllowFullScreen` ([#3396][] @ljharb) +[#3396]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3396 [#3394]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3394 [#3391]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3391 diff --git a/lib/rules/no-unknown-property.js b/lib/rules/no-unknown-property.js index 70cdcf26de..adb2b77f0c 100644 --- a/lib/rules/no-unknown-property.js +++ b/lib/rules/no-unknown-property.js @@ -280,7 +280,7 @@ const DOM_PROPERTY_NAMES_TWO_WORDS = [ 'autoPictureInPicture', 'controlList', 'disablePictureInPicture', 'disableRemotePlayback', ]; -const DOM_PROPERTIES_IGNORE_CASE = ['charset', 'allowfullscreen']; +const DOM_PROPERTIES_IGNORE_CASE = ['charset', 'allowFullScreen', 'webkitAllowFullScreen', 'mozAllowFullScreen']; const ARIA_PROPERTIES = [ // See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes @@ -395,7 +395,7 @@ function isValidAriaAttribute(name) { */ function isCaseIgnoredAttribute(name) { - return DOM_PROPERTIES_IGNORE_CASE.some((element) => element === name.toLowerCase()); + return DOM_PROPERTIES_IGNORE_CASE.some((element) => element.toLowerCase() === name.toLowerCase()); } /** diff --git a/tests/lib/rules/no-unknown-property.js b/tests/lib/rules/no-unknown-property.js index 9512887edd..3025d20d74 100644 --- a/tests/lib/rules/no-unknown-property.js +++ b/tests/lib/rules/no-unknown-property.js @@ -63,6 +63,7 @@ ruleTester.run('no-unknown-property', rule, { { code: '