Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-unknown-property: allow allowFullScreen on iframe #3455

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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