Skip to content

Commit

Permalink
[Fix] no-unknown-property: allow webkitAllowFullScreen and `mozAl…
Browse files Browse the repository at this point in the history
…lowFullScreen`

Fixes #3396
  • Loading branch information
ljharb committed Sep 5, 2022
1 parent 3b30527 commit 7ba7ec4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/rules/no-unknown-property.js
Expand Up @@ -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
Expand Down Expand Up @@ -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());
}

/**
Expand Down
1 change: 1 addition & 0 deletions tests/lib/rules/no-unknown-property.js
Expand Up @@ -63,6 +63,7 @@ ruleTester.run('no-unknown-property', rule, {
{ code: '<script onLoad={bar} onError={foo} />' },
{ code: '<source onError={foo} />' },
{ code: '<link onLoad={bar} onError={foo} />' },
{ code: '<div allowFullScreen webkitAllowFullScreen mozAllowFullScreen />' },
{
code: '<div allowTransparency="true" />',
settings: {
Expand Down

0 comments on commit 7ba7ec4

Please sign in to comment.