diff --git a/CHANGELOG.md b/CHANGELOG.md index 215b11630f..8f716f017c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange ### Fixed * configs: restore `parserOptions` in legacy configs ([#3523][] @ljharb) +* [`jsx-no-constructed-context-values`], [`jsx-no-useless-fragment`]: add a rule schema (@ljharb) [#3520]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3523 diff --git a/docs/rules/jsx-no-useless-fragment.md b/docs/rules/jsx-no-useless-fragment.md index 4420d8cc1b..34e81a0047 100644 --- a/docs/rules/jsx-no-useless-fragment.md +++ b/docs/rules/jsx-no-useless-fragment.md @@ -63,6 +63,8 @@ const cat = <>meow {showFullName ? fullName : firstName} ``` +## Rule Options + ### `allowExpressions` When `true` single expressions in a fragment will be allowed. This is useful in diff --git a/lib/rules/jsx-no-constructed-context-values.js b/lib/rules/jsx-no-constructed-context-values.js index ac34ead85e..8bcf045dad 100644 --- a/lib/rules/jsx-no-constructed-context-values.js +++ b/lib/rules/jsx-no-constructed-context-values.js @@ -138,6 +138,7 @@ module.exports = { url: docsUrl('jsx-no-constructed-context-values'), }, messages, + schema: {}, }, // eslint-disable-next-line arrow-body-style diff --git a/lib/rules/jsx-no-useless-fragment.js b/lib/rules/jsx-no-useless-fragment.js index 56c6baea70..2d2711a5f9 100644 --- a/lib/rules/jsx-no-useless-fragment.js +++ b/lib/rules/jsx-no-useless-fragment.js @@ -94,6 +94,14 @@ module.exports = { url: docsUrl('jsx-no-useless-fragment'), }, messages, + schema: [{ + type: 'object', + properties: { + allowExpressions: { + type: 'boolean', + }, + }, + }], }, create(context) {