Skip to content

Commit

Permalink
Add JSXText support to self-closing-comp
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcr committed May 28, 2018
1 parent 632941c commit 29c248d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/self-closing-comp.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.exports = {
const childrens = node.parent.children;
if (
!childrens.length ||
(childrens.length === 1 && childrens[0].type === 'Literal' && !childrens[0].value.replace(/(?!\xA0)\s/g, ''))
(childrens.length === 1 && (childrens[0].type === 'Literal' || childrens[0].type === 'JSXText') && !childrens[0].value.replace(/(?!\xA0)\s/g, ''))
) {
return false;
}
Expand Down

0 comments on commit 29c248d

Please sign in to comment.