Skip to content

Commit 92f5313

Browse files
committed
[Fix] no-unknown-property: allow closedBy on dialog
Fixes #3980
1 parent 0adcdd0 commit 92f5313

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

CHANGELOG.md

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

1212
### Fixed
1313
* [`no-unknown-property`]: allow `onLoad` on `body` ([#3923][] @DerekStapleton)
14+
* [`no-unknown-property`]: allow `closedBy` on `dialog` ([#3980][] @ljharb)
1415

16+
[#3980]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3980
1517
[#3930]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3930
1618
[#3923]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3923
1719

lib/rules/no-unknown-property.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const ATTRIBUTE_TAGS_MAP = {
3333
abbr: ['th', 'td'],
3434
charset: ['meta'],
3535
checked: ['input'],
36+
closedBy: ['dialog'],
3637
// image is required for SVG support, all other tags are HTML.
3738
crossOrigin: ['script', 'img', 'video', 'audio', 'link', 'image'],
3839
displaystyle: ['math'],

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ ruleTester.run('no-unknown-property', rule, {
149149
{ code: '<hr align="top" />' },
150150
{ code: '<applet align="top" />' },
151151
{ code: '<marker fill="#000" />' },
152-
{ code: '<dialog onClose={handler} open id="dialog" returnValue="something" onCancel={handler2} />' },
152+
{ code: '<dialog closedBy="something" onClose={handler} open id="dialog" returnValue="something" onCancel={handler2} />' },
153153
{
154154
code: `
155155
<table align="top">

0 commit comments

Comments
 (0)