Skip to content

Commit 29c248d

Browse files
committed
Add JSXText support to self-closing-comp
1 parent 632941c commit 29c248d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rules/self-closing-comp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module.exports = {
5252
const childrens = node.parent.children;
5353
if (
5454
!childrens.length ||
55-
(childrens.length === 1 && childrens[0].type === 'Literal' && !childrens[0].value.replace(/(?!\xA0)\s/g, ''))
55+
(childrens.length === 1 && (childrens[0].type === 'Literal' || childrens[0].type === 'JSXText') && !childrens[0].value.replace(/(?!\xA0)\s/g, ''))
5656
) {
5757
return false;
5858
}

0 commit comments

Comments
 (0)