From 487ef7055959a160aa546dc0753aa173c48383a3 Mon Sep 17 00:00:00 2001 From: Senja Jarva Date: Sun, 4 Sep 2022 15:36:53 +0300 Subject: [PATCH] [Fix] `no-unknown-property`: move allowfullscreen to case ignored attributes --- CHANGELOG.md | 1 + lib/rules/no-unknown-property.js | 4 ++-- tests/lib/rules/no-unknown-property.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2aee95eadb..2579fe0ba1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/rules/no-unknown-property.js b/lib/rules/no-unknown-property.js index 87efa391ed..5ae19a207a 100644 --- a/lib/rules/no-unknown-property.js +++ b/lib/rules/no-unknown-property.js @@ -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', @@ -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 diff --git a/tests/lib/rules/no-unknown-property.js b/tests/lib/rules/no-unknown-property.js index ccdaf0dc88..e9da7da27a 100644 --- a/tests/lib/rules/no-unknown-property.js +++ b/tests/lib/rules/no-unknown-property.js @@ -393,7 +393,7 @@ ruleTester.run('no-unknown-property', rule, { ], }, { - code: '
', + code: '
', errors: [ { messageId: 'invalidPropOnTag',