Skip to content

Commit b3049b1

Browse files
committed
Removed nested ifs
1 parent 0b9a565 commit b3049b1

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/rules/no-aria-hidden-on-focusable.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ const rule: Rule.RuleModule = {
1818
return defineTemplateBodyVisitor(context, {
1919
VElement(node) {
2020
const hasAriaHidden = getElementAttributeValue(node, 'aria-hidden');
21-
if (hasAriaHidden) {
22-
if (hasFocusableElements(node)) {
23-
context.report({
24-
node: node as any,
25-
messageId: 'default',
26-
});
27-
}
21+
if (hasAriaHidden && hasFocusableElements(node)) {
22+
context.report({
23+
node: node as any,
24+
messageId: 'default',
25+
});
2826
}
2927
},
3028
});

src/rules/no-role-presentation-on-focusable.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ const rule: Rule.RuleModule = {
1919
return defineTemplateBodyVisitor(context, {
2020
VElement(node) {
2121
const hasRolePresentation = getElementAttributeValue(node, 'role') === 'presentation';
22-
if (hasRolePresentation) {
23-
if (hasFocusableElements(node)) {
24-
context.report({
25-
node: node as any,
26-
messageId: 'default',
27-
});
28-
}
22+
if (hasRolePresentation && hasFocusableElements(node)) {
23+
context.report({
24+
node: node as any,
25+
messageId: 'default',
26+
});
2927
}
3028
},
3129
});

0 commit comments

Comments
 (0)