Skip to content

Commit

Permalink
[FIX] no-unknown-property: allow onLoad on object element
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksiiKachan committed Sep 6, 2022
1 parent 22c569b commit 6a75c06
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange

## Unreleased

### Fixed
* [`no-unknown-property`]: allow `onLoad` on `<object>` ([#3415][] @OleksiiKachan)

## [7.31.7] - 2022.09.05

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unknown-property.js
Expand Up @@ -73,7 +73,7 @@ const ATTRIBUTE_TAGS_MAP = {
onEncrypted: ['audio', 'video'],
onEnded: ['audio', 'video'],
onError: ['audio', 'video', 'img', 'link', 'source', 'script', 'picture', 'iframe'],
onLoad: ['script', 'img', 'link', 'picture', 'iframe'],
onLoad: ['script', 'img', 'link', 'picture', 'iframe', 'object'],
onLoadedData: ['audio', 'video'],
onLoadedMetadata: ['audio', 'video'],
onLoadStart: ['audio', 'video'],
Expand Down
3 changes: 2 additions & 1 deletion tests/lib/rules/no-unknown-property.js
Expand Up @@ -66,6 +66,7 @@ ruleTester.run('no-unknown-property', rule, {
{ code: '<source onError={foo} />' },
{ code: '<link onLoad={bar} onError={foo} />' },
{ code: '<link rel="preload" as="image" href="someHref" imageSrcSet="someImageSrcSet" imageSizes="someImageSizes" />' },
{ code: '<object onLoad={bar} />' },
{ code: '<div allowFullScreen webkitAllowFullScreen mozAllowFullScreen />' },
{ code: '<table border="1" />' },
{
Expand Down Expand Up @@ -435,7 +436,7 @@ ruleTester.run('no-unknown-property', rule, {
data: {
name: 'onLoad',
tagName: 'div',
allowedTags: 'script, img, link, picture, iframe',
allowedTags: 'script, img, link, picture, iframe, object',
},
},
],
Expand Down

0 comments on commit 6a75c06

Please sign in to comment.