Skip to content

Commit c3275a4

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

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy