Skip to content

Commit 7ba7ec4

Browse files
committed
[Fix] no-unknown-property: allow webkitAllowFullScreen and mozAllowFullScreen
Fixes #3396
1 parent 3b30527 commit 7ba7ec4

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
88
### Fixed
99
* [`no-unknown-property`]: avoid warning on `fbt` nodes entirely ([#3391][] @ljharb)
1010
* [`no-unknown-property`]: add `download` property support for `a` and `area` ([#3394][] @HJain13)
11+
* [`no-unknown-property`]: allow `webkitAllowFullScreen` and `mozAllowFullScreen` ([#3396][] @ljharb)
1112

13+
[#3396]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3396
1214
[#3394]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3394
1315
[#3391]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3391
1416

lib/rules/no-unknown-property.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ const DOM_PROPERTY_NAMES_TWO_WORDS = [
280280
'autoPictureInPicture', 'controlList', 'disablePictureInPicture', 'disableRemotePlayback',
281281
];
282282

283-
const DOM_PROPERTIES_IGNORE_CASE = ['charset', 'allowfullscreen'];
283+
const DOM_PROPERTIES_IGNORE_CASE = ['charset', 'allowFullScreen', 'webkitAllowFullScreen', 'mozAllowFullScreen'];
284284

285285
const ARIA_PROPERTIES = [
286286
// See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes
@@ -395,7 +395,7 @@ function isValidAriaAttribute(name) {
395395
*/
396396

397397
function isCaseIgnoredAttribute(name) {
398-
return DOM_PROPERTIES_IGNORE_CASE.some((element) => element === name.toLowerCase());
398+
return DOM_PROPERTIES_IGNORE_CASE.some((element) => element.toLowerCase() === name.toLowerCase());
399399
}
400400

401401
/**

tests/lib/rules/no-unknown-property.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ ruleTester.run('no-unknown-property', rule, {
6363
{ code: '<script onLoad={bar} onError={foo} />' },
6464
{ code: '<source onError={foo} />' },
6565
{ code: '<link onLoad={bar} onError={foo} />' },
66+
{ code: '<div allowFullScreen webkitAllowFullScreen mozAllowFullScreen />' },
6667
{
6768
code: '<div allowTransparency="true" />',
6869
settings: {

0 commit comments

Comments
 (0)