Skip to content

Commit 0ddceff

Browse files
Fix autofix for multiple top-level children
1 parent 74a0fd5 commit 0ddceff

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,14 @@ const rules = {
204204
visitorKeys,
205205
(current, ancestors) => {
206206
if (
207+
current.type === 'JSXElement' &&
208+
current.openingElement.attributes.find(
209+
(attributeNode) =>
210+
attributeNode.name?.name === 'data-component',
211+
)
212+
) {
213+
throw DONE_WITH_SUBTREE;
214+
} else if (
207215
current.type === 'JSXElement' &&
208216
excludeComponentNames.every(
209217
(regex) =>

0 commit comments

Comments
 (0)