Skip to content

Commit

Permalink
Make attribute "charset" valid
Browse files Browse the repository at this point in the history
The attribute "charset" was considered an error, but it results in valid
HTML because HTML is case-insensitive. In other words, these two lines
will be interpreted in the same way:

<meta charSet="utf-8" />
<meta charset="utf-8" />

facebook/react#11492 (comment)
  • Loading branch information
silvenon committed Jun 29, 2018
1 parent f27285f commit 386efc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/no-unknown-property.js
Expand Up @@ -117,7 +117,7 @@ const SVGDOM_ATTRIBUTE_NAMES = {
const DOM_PROPERTY_NAMES = [
// Standard
'acceptCharset', 'accessKey', 'allowFullScreen', 'allowTransparency', 'autoComplete', 'autoFocus', 'autoPlay',
'cellPadding', 'cellSpacing', 'charSet', 'classID', 'className', 'colSpan', 'contentEditable', 'contextMenu',
'cellPadding', 'cellSpacing', 'classID', 'className', 'colSpan', 'contentEditable', 'contextMenu',
'dateTime', 'encType', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget',
'frameBorder', 'hrefLang', 'htmlFor', 'httpEquiv', 'inputMode', 'keyParams', 'keyType', 'marginHeight', 'marginWidth',
'maxLength', 'mediaGroup', 'minLength', 'noValidate', 'onAnimationEnd', 'onAnimationIteration', 'onAnimationStart',
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/rules/no-unknown-property.js
Expand Up @@ -30,6 +30,8 @@ ruleTester.run('no-unknown-property', rule, {
{code: '<App class="bar" />;'},
{code: '<App for="bar" />;'},
{code: '<App accept-charset="bar" />;'},
{code: '<meta charset="utf-8" />;'},
{code: '<meta charSet="utf-8" />;'},
{code: '<App http-equiv="bar" />;'},
{code: '<App xlink:href="bar" />;'},
{code: '<App clip-path="bar" />;'},
Expand Down

0 comments on commit 386efc3

Please sign in to comment.