Skip to content

Commit d8602ac

Browse files
committed
[Fix] jsx-curly-brace-presence: the string "never" defaults to propElementValues as ignore
Fixes #3228
1 parent 9090999 commit d8602ac

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

CHANGELOG.md

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

88
### Fixed
99
* [`no-unused-state`]: avoid a crash on type-only gDSFP declarations ([#3225][] @ljharb)
10+
* [`jsx-curly-brace-presence`]: the string "never" defaults to `propElementValues` as `ignore` ([#3228][] @ljharb)
1011

12+
[#3228]: https://github.com/yannickcr/eslint-plugin-react/issues/3228
1113
[#3225]: https://github.com/yannickcr/eslint-plugin-react/issues/3225
1214

1315
## [7.29.2] - 2022.02.25

lib/rules/jsx-curly-brace-presence.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ module.exports = {
7272
const HTML_ENTITY_REGEX = () => /&[A-Za-z\d#]+;/g;
7373
const ruleOptions = context.options[0];
7474
const userConfig = typeof ruleOptions === 'string'
75-
? { props: ruleOptions, children: ruleOptions, propElementValues: ruleOptions }
75+
? { props: ruleOptions, children: ruleOptions, propElementValues: OPTION_IGNORE }
7676
: Object.assign({}, DEFAULT_CONFIG, ruleOptions);
7777

7878
function containsLineTerminators(rawStringValue) {

tests/lib/rules/jsx-curly-brace-presence.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,15 @@ ruleTester.run('jsx-curly-brace-presence', rule, {
459459
code: `
460460
<script>{\`window.foo = "bar"\`}</script>
461461
`,
462+
},
463+
{
464+
code: `
465+
<CollapsibleTitle
466+
extra={<span className="activity-type">{activity.type}</span>}
467+
/>
468+
`,
469+
features: ['no-ts'],
470+
options: ['never'],
462471
}
463472
)),
464473

0 commit comments

Comments
 (0)