Skip to content

Commit fbbd9a6

Browse files
committed
[Fix] no-unknown-property: allowed on element
1 parent 981d5d7 commit fbbd9a6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/rules/no-unknown-property.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ const ATTRIBUTE_TAGS_MAP = {
6868
onEmptied: ['audio', 'video'],
6969
onEncrypted: ['audio', 'video'],
7070
onEnded: ['audio', 'video'],
71-
onError: ['audio', 'video', 'img', 'link', 'source', 'script', 'picture'],
72-
onLoad: ['script', 'img', 'link', 'picture'],
71+
onError: ['audio', 'video', 'img', 'link', 'source', 'script', 'picture', 'iframe'],
72+
onLoad: ['script', 'img', 'link', 'picture', 'iframe'],
7373
onLoadedData: ['audio', 'video'],
7474
onLoadedMetadata: ['audio', 'video'],
7575
onLoadStart: ['audio', 'video'],

tests/lib/rules/no-unknown-property.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ ruleTester.run('no-unknown-property', rule, {
6161
{ code: '<video playsInline />' },
6262
{ code: '<img onError={foo} onLoad={bar} />' },
6363
{ code: '<picture onError={foo} onLoad={bar} />' },
64+
{ code: '<iframe onError={foo} onLoad={bar} />' },
6465
{ code: '<script onLoad={bar} onError={foo} />' },
6566
{ code: '<source onError={foo} />' },
6667
{ code: '<link onLoad={bar} onError={foo} />' },
@@ -401,7 +402,7 @@ ruleTester.run('no-unknown-property', rule, {
401402
data: {
402403
name: 'onError',
403404
tagName: 'div',
404-
allowedTags: 'audio, video, img, link, source, script, picture',
405+
allowedTags: 'audio, video, img, link, source, script, picture, iframe',
405406
},
406407
},
407408
],
@@ -414,7 +415,7 @@ ruleTester.run('no-unknown-property', rule, {
414415
data: {
415416
name: 'onLoad',
416417
tagName: 'div',
417-
allowedTags: 'script, img, link, picture',
418+
allowedTags: 'script, img, link, picture, iframe',
418419
},
419420
},
420421
],

0 commit comments

Comments
 (0)