Skip to content

Commit 94e2467

Browse files
authored
[Fix] catch JSX fragments with propElementValues
1 parent f2869fd commit 94e2467

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,19 @@ module.exports = {
405405
}
406406
},
407407

408+
'JSXAttribute > JSXExpressionContainer > JSXFragment'(node) {
409+
if (userConfig.propElementValues === OPTION_NEVER) {
410+
reportUnnecessaryCurly(node.parent);
411+
}
412+
},
413+
408414
JSXExpressionContainer(node) {
409415
if (shouldCheckForUnnecessaryCurly(node, userConfig)) {
410416
lintUnnecessaryCurly(node);
411417
}
412418
},
413419

414-
'JSXAttribute > JSXElement, Literal, JSXText'(node) {
420+
'JSXAttribute > JSXElement, JSXAttribute > JSXFragment, Literal, JSXText'(node) {
415421
if (shouldCheckForMissingCurly(node, userConfig)) {
416422
reportMissingCurly(node);
417423
}

0 commit comments

Comments
 (0)