Skip to content

Commit 4ed6fd9

Browse files
committed
Return just a boolean from find
1 parent b056134 commit 4ed6fd9

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/rules/accessible-emoji.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,9 @@ module.exports = {
2424

2525
create: context => ({
2626
JSXOpeningElement: (node) => {
27-
const literalChildValue = node.parent.children.find((child) => {
28-
if (child.type === 'Literal') {
29-
return child.value;
30-
}
31-
return false;
32-
});
27+
const literalChildValue = node.parent.children.find(
28+
child => child.type === 'Literal',
29+
);
3330

3431
if (literalChildValue && emojiRegex().test(literalChildValue.value)) {
3532
const rolePropValue = getLiteralPropValue(getProp(node.attributes, 'role'));

0 commit comments

Comments
 (0)