Skip to content

Commit 7cb5b8e

Browse files
committed
[Fix] accessible-emoji: find JSXText nodes as well
1 parent 4256518 commit 7cb5b8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rules/accessible-emoji.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = {
2525

2626
create: context => ({
2727
JSXOpeningElement: (node) => {
28-
const literalChildValue = node.parent.children.find(child => child.type === 'Literal');
28+
const literalChildValue = node.parent.children.find(child => child.type === 'Literal' || child.type === 'JSXText');
2929

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

0 commit comments

Comments
 (0)