Skip to content

Commit 4523e73

Browse files
committed
[Fix] jsx-no-constructed-context-values, jsx-no-useless-fragment: add a rule schema
1 parent d2194a5 commit 4523e73

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
77

88
### Fixed
99
* configs: restore `parserOptions` in legacy configs ([#3523][] @ljharb)
10+
* [`jsx-no-constructed-context-values`], [`jsx-no-useless-fragment`]: add a rule schema (@ljharb)
1011

1112
[#3520]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3523
1213

docs/rules/jsx-no-useless-fragment.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ const cat = <>meow</>
6363
{showFullName ? fullName : firstName}
6464
```
6565

66+
## Rule Options
67+
6668
### `allowExpressions`
6769

6870
When `true` single expressions in a fragment will be allowed. This is useful in

lib/rules/jsx-no-constructed-context-values.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ module.exports = {
138138
url: docsUrl('jsx-no-constructed-context-values'),
139139
},
140140
messages,
141+
schema: {},
141142
},
142143

143144
// eslint-disable-next-line arrow-body-style

lib/rules/jsx-no-useless-fragment.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ module.exports = {
9494
url: docsUrl('jsx-no-useless-fragment'),
9595
},
9696
messages,
97+
schema: [{
98+
type: 'object',
99+
properties: {
100+
allowExpressions: {
101+
type: 'boolean',
102+
},
103+
},
104+
}],
97105
},
98106

99107
create(context) {

0 commit comments

Comments
 (0)