From c3275a4fb2e796799680a584c0203c4734c3682e Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 11 Mar 2024 20:00:53 -0700 Subject: [PATCH] [Fix] `no-unknown-property`: support `popover`, `popovertarget`, `popovertargetaction` attributes Fixes #3707 --- CHANGELOG.md | 2 ++ lib/rules/no-unknown-property.js | 2 ++ tests/lib/rules/no-unknown-property.js | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e307437ab2..b14a5c1bd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,12 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange * [`boolean-prop-naming`]: detect TS interfaces ([#3701][] @developer-bandi) * [`boolean-prop-naming`]: literalType error fix ([#3704][] @developer-bandi) * [`boolean-prop-naming`]: allow TSIntersectionType ([#3705][] @developer-bandi) +* [`no-unknown-property`]: support `popover`, `popovertarget`, `popovertargetaction` attributes ([#3707][] @ljharb) ### Changed * [`boolean-prop-naming`]: improve error message (@ljharb) +[#3707]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3707 [#3705]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3705 [#3704]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3704 [#3701]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3701 diff --git a/lib/rules/no-unknown-property.js b/lib/rules/no-unknown-property.js index ec913e1fca..781e5495bc 100644 --- a/lib/rules/no-unknown-property.js +++ b/lib/rules/no-unknown-property.js @@ -238,6 +238,8 @@ const DOM_PROPERTY_NAMES_ONE_WORD = [ 'results', 'security', // Video specific 'controls', + // popovers + 'popover', 'popovertarget', 'popovertargetaction', ]; const DOM_PROPERTY_NAMES_TWO_WORDS = [ diff --git a/tests/lib/rules/no-unknown-property.js b/tests/lib/rules/no-unknown-property.js index 89624d540a..704d8429d5 100644 --- a/tests/lib/rules/no-unknown-property.js +++ b/tests/lib/rules/no-unknown-property.js @@ -169,6 +169,15 @@ ruleTester.run('no-unknown-property', rule, { `, }, + { + code: ` +
+ + +
Greetings, one and all!
+
+ `, + }, ]), invalid: parsers.all([ {