Skip to content

Commit

Permalink
[Fix] no-unknown-property: allow allowFullScreen on iframe
Browse files Browse the repository at this point in the history
Fixes #3456.
  • Loading branch information
almeidx authored and ljharb committed Oct 10, 2022
1 parent 17858be commit b42a0f3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/rules/no-unknown-property.js
Expand Up @@ -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'],
Expand Down
3 changes: 2 additions & 1 deletion tests/lib/rules/no-unknown-property.js
Expand Up @@ -70,6 +70,7 @@ ruleTester.run('no-unknown-property', rule, {
{ code: '<link rel="preload" as="image" href="someHref" imageSrcSet="someImageSrcSet" imageSizes="someImageSizes" />' },
{ code: '<object onLoad={bar} />' },
{ code: '<video allowFullScreen webkitAllowFullScreen mozAllowFullScreen />' },
{ code: '<iframe allowFullScreen webkitAllowFullScreen mozAllowFullScreen />' },
{ code: '<table border="1" />' },
{ code: '<th abbr="abbr" />' },
{ code: '<td abbr="abbr" />' },
Expand Down Expand Up @@ -513,7 +514,7 @@ ruleTester.run('no-unknown-property', rule, {
data: {
name: 'allowFullScreen',
tagName: 'div',
allowedTags: 'video',
allowedTags: 'iframe, video',
},
},
],
Expand Down

0 comments on commit b42a0f3

Please sign in to comment.