Skip to content

Commit 937b7f8

Browse files
committed
fix(macros): Ignore macro usages inside type annotations
1 parent bfad6cf commit 937b7f8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/import-replacer-helper/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ function createReplacerMacro(config) {
4141
jsxClosingElementNamePath.replaceWith(types.JSXIdentifier(id));
4242
break;
4343
case 'Identifier':
44+
if (
45+
types.isTSQualifiedName(reference.parentPath)
46+
|| types.isQualifiedTypeIdentifier(reference.parentPath)
47+
) {
48+
break;
49+
}
4450
if (!types.isMemberExpression(reference.parentPath)) {
4551
throw new TypeError(`Unexpected parent node type: ${reference.parentPath.type}`);
4652
}

0 commit comments

Comments
 (0)