Skip to content

Commit 1fa0888

Browse files
OleksiiKachanljharb
OleksiiKachan
authored andcommitted
[Fix] no-unknown-property: allow onLoad on <object>
1 parent 73350de commit 1fa0888

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
88
### Fixed
99
* [`no-unknown-property`]: add `viewBox` on `marker` ([#3416][] @ljharb)
1010
* [`no-unknown-property`]: add `noModule` on `script` ([#3414][] @ljharb)
11+
* [`no-unknown-property`]: allow `onLoad` on `<object>` ([#3415][] @OleksiiKachan)
1112

1213
### Changed
1314

1415
* [Meta] npmignore markdownlint config ([#3413][] @jorrit)
1516

1617
[#3416]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3416
18+
[#3415]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3415
1719
[#3414]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3414
1820
[#3413]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3413
1921

lib/rules/no-unknown-property.js

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

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ 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: '<object onLoad={bar} />' },
6970
{ code: '<div allowFullScreen webkitAllowFullScreen mozAllowFullScreen />' },
7071
{ code: '<table border="1" />' },
7172
{
@@ -443,7 +444,7 @@ ruleTester.run('no-unknown-property', rule, {
443444
data: {
444445
name: 'onLoad',
445446
tagName: 'div',
446-
allowedTags: 'script, img, link, picture, iframe',
447+
allowedTags: 'script, img, link, picture, iframe, object',
447448
},
448449
},
449450
],

0 commit comments

Comments
 (0)