diff --git a/CHANGELOG.md b/CHANGELOG.md index 207d9baa1a..92b95392e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange ## Unreleased +### Fixed +* [`no-unknown-property`]: support `checked` on inputs ([#3383][] @ljharb) + +[#3383]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3383 + ## [7.31.3] - 2022.09.03 ### Fixed diff --git a/lib/rules/no-unknown-property.js b/lib/rules/no-unknown-property.js index a39bfde18a..2f883af8fb 100644 --- a/lib/rules/no-unknown-property.js +++ b/lib/rules/no-unknown-property.js @@ -27,6 +27,7 @@ const DOM_ATTRIBUTE_NAMES = { }; const ATTRIBUTE_TAGS_MAP = { + checked: ['input'], // image is required for SVG support, all other tags are HTML. crossOrigin: ['script', 'img', 'video', 'audio', 'link', 'image'], fill: ['svg'], diff --git a/tests/lib/rules/no-unknown-property.js b/tests/lib/rules/no-unknown-property.js index b6b8173efe..7883afd23c 100644 --- a/tests/lib/rules/no-unknown-property.js +++ b/tests/lib/rules/no-unknown-property.js @@ -52,6 +52,7 @@ ruleTester.run('no-unknown-property', rule, { { code: ';' }, { code: '' }, { code: '' }, + { code: '' }, // Case ignored attributes, for `charset` discussion see https://github.com/jsx-eslint/eslint-plugin-react/pull/1863 { code: ';' }, { code: ';' },