Skip to content

Commit b7cfff0

Browse files
committed
fix: rename isAllowedDetailsChild to isSummaryFirstChildOfDetails after rebase
1 parent 91ad5d7 commit b7cfff0

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

lib/rules/template-no-nested-interactive.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,19 @@ function isCompositeWidgetPattern(parentRole, childRole) {
5050
return false;
5151
}
5252

53-
function isAllowedDetailsChild(childNode, parentEntry) {
54-
if (parentEntry.tag !== 'details') {
53+
function isSummaryFirstChildOfDetails(summaryNode, parentEntry) {
54+
if (summaryNode.tag !== 'summary' || parentEntry.tag !== 'details') {
5555
return false;
5656
}
57-
// Non-<summary> children are flow content in the disclosed panel — allowed.
58-
// <summary> is only allowed as the first non-whitespace child of <details>.
59-
if (childNode.tag !== 'summary') {
60-
return true;
61-
}
62-
const children = parentEntry.node.children || [];
57+
const parentNode = parentEntry.node;
58+
const children = parentNode.children || [];
6359
const firstNonWhitespace = children.find((child) => {
6460
if (child.type === 'GlimmerTextNode') {
6561
return child.chars.trim().length > 0;
6662
}
6763
return true;
6864
});
69-
return firstNonWhitespace === childNode;
65+
return firstNonWhitespace === summaryNode;
7066
}
7167

7268
/** @type {import('eslint').Rule.RuleModule} */

0 commit comments

Comments
 (0)