Skip to content

Commit b42a0f3

Browse files
almeidxljharb
authored andcommitted
[Fix] no-unknown-property: allow allowFullScreen on iframe
Fixes #3456.
1 parent 17858be commit b42a0f3

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
1010
* [`hook-use-state`]: add `allowDestructuredState` option ([#3449][] @ljharb)
1111
* add [`sort-default-props`] and deprecate [`jsx-sort-default-props`] ([#1861][] @alexzherdev)
1212

13+
### Fixed
14+
* [`no-unknown-property`]: allow `allowFullScreen` on `iframe` ([#3455][] @almeidx)
15+
16+
[#3455]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3455
1317
[#3449]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3449
1418
[#3424]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3429
1519
[#1861]: https://github.com/jsx-eslint/eslint-plugin-react/pull/1861

lib/rules/no-unknown-property.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ const ATTRIBUTE_TAGS_MAP = {
104104
loop: ['audio', 'video'],
105105
muted: ['audio', 'video'],
106106
playsInline: ['video'],
107-
allowFullScreen: ['video'],
108-
webkitAllowFullScreen: ['video'],
109-
mozAllowFullScreen: ['video'],
107+
allowFullScreen: ['iframe', 'video'],
108+
webkitAllowFullScreen: ['iframe', 'video'],
109+
mozAllowFullScreen: ['iframe', 'video'],
110110
poster: ['video'],
111111
preload: ['audio', 'video'],
112112
scrolling: ['iframe'],

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ ruleTester.run('no-unknown-property', rule, {
7070
{ code: '<link rel="preload" as="image" href="someHref" imageSrcSet="someImageSrcSet" imageSizes="someImageSizes" />' },
7171
{ code: '<object onLoad={bar} />' },
7272
{ code: '<video allowFullScreen webkitAllowFullScreen mozAllowFullScreen />' },
73+
{ code: '<iframe allowFullScreen webkitAllowFullScreen mozAllowFullScreen />' },
7374
{ code: '<table border="1" />' },
7475
{ code: '<th abbr="abbr" />' },
7576
{ code: '<td abbr="abbr" />' },
@@ -513,7 +514,7 @@ ruleTester.run('no-unknown-property', rule, {
513514
data: {
514515
name: 'allowFullScreen',
515516
tagName: 'div',
516-
allowedTags: 'video',
517+
allowedTags: 'iframe, video',
517518
},
518519
},
519520
],

0 commit comments

Comments
 (0)