Skip to content

Commit

Permalink
Merge 2a595fd into 0c1cb28
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinyoste committed Oct 15, 2019
2 parents 0c1cb28 + 2a595fd commit 8b57762
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/rules/jsx-curly-brace-presence.js
Expand Up @@ -242,12 +242,18 @@ module.exports = {
}

function hasAdjacentJsxExpressionContainers(node, children) {
if (!children) {
return false;
}
const childrenExcludingWhitespaceLiteral = children.filter(child => !isWhiteSpaceLiteral(child));
const adjSiblings = getAdjacentSiblings(node, childrenExcludingWhitespaceLiteral);

return adjSiblings.some(x => x.type && x.type === 'JSXExpressionContainer');
}
function hasAdjacentJsx(node, children) {
if (!children) {
return false;
}
const childrenExcludingWhitespaceLiteral = children.filter(child => !isWhiteSpaceLiteral(child));
const adjSiblings = getAdjacentSiblings(node, childrenExcludingWhitespaceLiteral);

Expand Down
3 changes: 3 additions & 0 deletions tests/lib/rules/jsx-curly-brace-presence.js
Expand Up @@ -145,6 +145,9 @@ ruleTester.run('jsx-curly-brace-presence', rule, {
{
code: `<App prop='bar'>{'foo \\n bar'}</App>`
},
{
code: `<App prop={ ' ' }/>`
},
{
code: `<MyComponent prop='bar'>foo</MyComponent>`,
options: [{props: 'never'}]
Expand Down

0 comments on commit 8b57762

Please sign in to comment.