Skip to content

Commit

Permalink
[Fix] no-unknown-property: allow allowFullScreen on iframe (#3455)
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 96062ea commit 74bfbc1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange

## Unreleased

### Fixed
* [`no-unknown-property`]: allow `allowFullScreen` on `iframe` ([#3455][] @almeidx)

[#3455]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3455

## [7.31.9] - 2022.10.09

### Fixed
Expand Down
6 changes: 3 additions & 3 deletions lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 74bfbc1

Please sign in to comment.