Skip to content

Commit

Permalink
Add JSXText support to no-unescaped-entities
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcr committed May 28, 2018
1 parent ed3370b commit ce1fec7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/rules/no-unescaped-entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ module.exports = {

return {
Literal: function(node) {
if (node.type === 'Literal' && node.parent.type === 'JSXElement') {
if (node.parent.type === 'JSXElement') {
reportInvalidEntity(node);
}
},

JSXText: function(node) {
if (node.parent.type === 'JSXElement') {
reportInvalidEntity(node);
}
}
Expand Down

0 comments on commit ce1fec7

Please sign in to comment.