Skip to content

Commit

Permalink
Rename function and remove no-op if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Joachim Seminck committed May 28, 2017
1 parent dc03975 commit 3ad837f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/rules/no-unescaped-entities.js
Expand Up @@ -35,7 +35,7 @@ module.exports = {
},

create: function(context) {
function isInvalidEntity(node) {
function reportInvalidEntity(node) {
var configuration = context.options[0] || {};
var entities = configuration.forbid || DEFAULTS;

Expand Down Expand Up @@ -70,9 +70,7 @@ module.exports = {
return {
Literal: function(node) {
if (node.type === 'Literal' && node.parent.type === 'JSXElement') {
if (isInvalidEntity(node)) {
context.report(node, 'HTML entities must be escaped.');
}
reportInvalidEntity(node);
}
}
};
Expand Down

0 comments on commit 3ad837f

Please sign in to comment.