Skip to content

Commit

Permalink
Apply code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
rafbgarcia committed Dec 12, 2019
1 parent ae71722 commit b759ec9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/rules/jsx-curly-brace-presence.js
Expand Up @@ -298,10 +298,11 @@ module.exports = {
return areRuleConditionsSatisfied(parent, config, OPTION_NEVER);
}

function shouldCheckForMissingCurly(parent, node, config) {
function shouldCheckForMissingCurly(node, config) {
if (node.raw.trim() === '') {
return false;
}
const parent = node.parent;
if (
parent.children &&
parent.children.length === 1 &&
Expand All @@ -325,7 +326,7 @@ module.exports = {
},

'Literal, JSXText': (node) => {
if (shouldCheckForMissingCurly(node.parent, node, userConfig)) {
if (shouldCheckForMissingCurly(node, userConfig)) {
reportMissingCurly(node);
}
}
Expand Down

0 comments on commit b759ec9

Please sign in to comment.