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 350bfcd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
4 changes: 3 additions & 1 deletion tests/lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ 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: '<link onLoad={bar} onError={foo} />' },
{ code: '<object onLoad={bar} />' },
{ code: '<div allowFullScreen webkitAllowFullScreen mozAllowFullScreen />' },
{ code: '<table border="1" />' },
{
Expand Down Expand Up @@ -435,7 +437,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 350bfcd

Please sign in to comment.