Skip to content

Commit

Permalink
Fixed crossorigin naming convention to match React's supported HTML a…
Browse files Browse the repository at this point in the history
…ttributes.
  • Loading branch information
Johnny Zarate authored and ljharb committed Jan 26, 2018
1 parent 843d71a commit f947536
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const DOM_ATTRIBUTE_NAMES = {
class: 'className',
for: 'htmlFor',
'http-equiv': 'httpEquiv',
crossOrigin: 'crossorigin'
crossorigin: 'crossOrigin'
};

const ATTRIBUTE_TAGS_MAP = {
crossorigin: ['script', 'img', 'video']
crossOrigin: ['script', 'img', 'video']
};

const SVGDOM_ATTRIBUTE_NAMES = {
Expand Down
14 changes: 7 additions & 7 deletions tests/lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ruleTester.run('no-unknown-property', rule, {
code: '<div class="bar"></div>;',
options: [{ignore: ['class']}]
},
{code: '<script crossorigin />'}
{code: '<script crossOrigin />'}
],
invalid: [{
code: '<div class="bar"></div>;',
Expand Down Expand Up @@ -81,13 +81,13 @@ ruleTester.run('no-unknown-property', rule, {
output: '<rect clipPath="bar" />;',
errors: [{message: 'Unknown property \'clip-path\' found, use \'clipPath\' instead'}]
}, {
code: '<script crossOrigin />',
errors: [{message: 'Unknown property \'crossOrigin\' found, use \'crossorigin\' instead'}]
}, {
code: '<div crossOrigin />',
errors: [{message: 'Unknown property \'crossOrigin\' found, use \'crossorigin\' instead'}]
code: '<script crossorigin />',
errors: [{message: 'Unknown property \'crossorigin\' found, use \'crossOrigin\' instead'}]
}, {
code: '<div crossorigin />',
errors: [{message: 'Invalid property \'crossorigin\' found on tag \'div\', but it is only allowed on: script, img, video'}]
errors: [{message: 'Unknown property \'crossorigin\' found, use \'crossOrigin\' instead'}]
}, {
code: '<div crossOrigin />',
errors: [{message: 'Invalid property \'crossOrigin\' found on tag \'div\', but it is only allowed on: script, img, video'}]
}]
});

0 comments on commit f947536

Please sign in to comment.