Skip to content

Commit bf21d8d

Browse files
author
OleksiiKachan
committed
[FIX] no-unknown-property: allow onLoad on object element
1 parent 22c569b commit bf21d8d

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
55

66
## Unreleased
77

8+
### Fixed
9+
* [`no-unknown-property`]: allow `onLoad` on `<object>` ([#3391][] @OleksiiKachan)
10+
811
## [7.31.7] - 2022.09.05
912

1013
### Fixed

lib/rules/no-unknown-property.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const ATTRIBUTE_TAGS_MAP = {
7373
onEncrypted: ['audio', 'video'],
7474
onEnded: ['audio', 'video'],
7575
onError: ['audio', 'video', 'img', 'link', 'source', 'script', 'picture', 'iframe'],
76-
onLoad: ['script', 'img', 'link', 'picture', 'iframe'],
76+
onLoad: ['script', 'img', 'link', 'picture', 'iframe', 'object'],
7777
onLoadedData: ['audio', 'video'],
7878
onLoadedMetadata: ['audio', 'video'],
7979
onLoadStart: ['audio', 'video'],

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ ruleTester.run('no-unknown-property', rule, {
6666
{ code: '<source onError={foo} />' },
6767
{ code: '<link onLoad={bar} onError={foo} />' },
6868
{ code: '<link rel="preload" as="image" href="someHref" imageSrcSet="someImageSrcSet" imageSizes="someImageSizes" />' },
69+
{ code: '<link onLoad={bar} onError={foo} />' },
70+
{ code: '<object onLoad={bar} />' },
6971
{ code: '<div allowFullScreen webkitAllowFullScreen mozAllowFullScreen />' },
7072
{ code: '<table border="1" />' },
7173
{
@@ -435,7 +437,7 @@ ruleTester.run('no-unknown-property', rule, {
435437
data: {
436438
name: 'onLoad',
437439
tagName: 'div',
438-
allowedTags: 'script, img, link, picture, iframe',
440+
allowedTags: 'script, img, link, picture, iframe, object',
439441
},
440442
},
441443
],

0 commit comments

Comments
 (0)