Skip to content

Commit

Permalink
Restore tests and crossorigin attribute map
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 27, 2018
1 parent d64a16b commit 1d13218
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const DOM_ATTRIBUTE_NAMES = {
'accept-charset': 'acceptCharset',
class: 'className',
for: 'htmlFor',
'http-equiv': 'httpEquiv'
'http-equiv': 'httpEquiv',
crossorigin: 'crossOrigin'
};

const ATTRIBUTE_TAGS_MAP = {
Expand Down
6 changes: 6 additions & 0 deletions tests/lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ ruleTester.run('no-unknown-property', rule, {
code: '<rect clip-path="bar" />;',
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: '<div crossOrigin />',
errors: [{message: 'Invalid property \'crossOrigin\' found on tag \'div\', but it is only allowed on: script, img, video, link'}]
Expand Down

0 comments on commit 1d13218

Please sign in to comment.