Skip to content

Commit 1aa653d

Browse files
committed
[Fix] no-unknown-property: support popover, popovertarget, popovertargetaction attributes
Fixes #3707
1 parent a920463 commit 1aa653d

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
1010
* [`boolean-prop-naming`]: detect TS interfaces ([#3701][] @developer-bandi)
1111
* [`boolean-prop-naming`]: literalType error fix ([#3704][] @developer-bandi)
1212
* [`boolean-prop-naming`]: allow TSIntersectionType ([#3705][] @developer-bandi)
13+
* [`no-unknown-property`]: support `popover`, `popovertarget`, `popovertargetaction` attributes ([#3707][] @ljharb)
1314

1415
### Changed
1516
* [`boolean-prop-naming`]: improve error message (@ljharb)
1617

18+
[#3707]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3707
1719
[#3705]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3705
1820
[#3704]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3704
1921
[#3701]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3701

lib/rules/no-unknown-property.js

+2
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ const DOM_PROPERTY_NAMES_ONE_WORD = [
238238
'results', 'security',
239239
// Video specific
240240
'controls',
241+
// popovers
242+
'popover', 'popovertarget', 'popovertargetaction',
241243
];
242244

243245
const DOM_PROPERTY_NAMES_TWO_WORDS = [

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

+9
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,15 @@ ruleTester.run('no-unknown-property', rule, {
169169
</div>
170170
`,
171171
},
172+
{
173+
code: `
174+
<div>
175+
<button popovertarget="my-popover" popovertargetaction="toggle">Open Popover</button>
176+
177+
<div popover id="my-popover">Greetings, one and all!</div>
178+
</div>
179+
`,
180+
}
172181
]),
173182
invalid: parsers.all([
174183
{

0 commit comments

Comments
 (0)