Skip to content

Commit

Permalink
[Fix] no-unknown-property: move allowfullscreen to case ignored att…
Browse files Browse the repository at this point in the history
…ributes
  • Loading branch information
sjarva authored and ljharb committed Sep 4, 2022
1 parent 9a77a1b commit 487ef70
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
* [`no-unknown-property`]: `onError` and `onLoad` both work on `img` and `script` ([#3388][] @ljharb)
* [`no-unknown-property`]: data-* attributes can have numbers ([#3390][] @sjarva)
* [`no-unknown-property`]: add more audio/video attributes ([#3390][] @sjarva)
* [`no-unknown-property`]: move allowfullscreen to case ignored attributes ([#3390][] @sjarva)

[#3390]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3390
[#3388]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3388
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ const DOM_PROPERTY_NAMES_TWO_WORDS = [
// Element specific attributes
// See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes (includes global attributes too)
// To be considered if these should be added also to ATTRIBUTE_TAGS_MAP
'acceptCharset', 'allowFullScreen', 'autoComplete', 'autoPlay', 'cellPadding', 'cellSpacing', 'classID', 'codeBase',
'acceptCharset', 'autoComplete', 'autoPlay', 'cellPadding', 'cellSpacing', 'classID', 'codeBase',
'colSpan', 'contextMenu', 'dateTime', 'encType', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget',
'frameBorder', 'hrefLang', 'httpEquiv', 'isMap', 'keyParams', 'keyType', 'marginHeight', 'marginWidth',
'maxLength', 'mediaGroup', 'minLength', 'noValidate', 'onAnimationEnd', 'onAnimationIteration', 'onAnimationStart',
Expand Down Expand Up @@ -274,7 +274,7 @@ const DOM_PROPERTY_NAMES_TWO_WORDS = [
'autoPictureInPicture', 'controlList', 'disablePictureInPicture', 'disableRemotePlayback',
];

const DOM_PROPERTIES_IGNORE_CASE = ['charset'];
const DOM_PROPERTIES_IGNORE_CASE = ['charset', 'allowfullscreen'];

const ARIA_PROPERTIES = [
// See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ ruleTester.run('no-unknown-property', rule, {
],
},
{
code: '<div controls={this.controls} loop={true} muted={false} src={this.videoSrc} playsInline={true}></div>',
code: '<div controls={this.controls} loop={true} muted={false} src={this.videoSrc} playsInline={true} allowFullScreen></div>',
errors: [
{
messageId: 'invalidPropOnTag',
Expand Down

0 comments on commit 487ef70

Please sign in to comment.