Skip to content

Commit ce1fec7

Browse files
committed
Add JSXText support to no-unescaped-entities
1 parent ed3370b commit ce1fec7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/rules/no-unescaped-entities.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ module.exports = {
7272

7373
return {
7474
Literal: function(node) {
75-
if (node.type === 'Literal' && node.parent.type === 'JSXElement') {
75+
if (node.parent.type === 'JSXElement') {
76+
reportInvalidEntity(node);
77+
}
78+
},
79+
80+
JSXText: function(node) {
81+
if (node.parent.type === 'JSXElement') {
7682
reportInvalidEntity(node);
7783
}
7884
}

0 commit comments

Comments
 (0)