From 0a065feafc22797e6caef3780ebf11126aa7d5fe Mon Sep 17 00:00:00 2001 From: anubra266 Date: Fri, 17 May 2024 19:34:55 -0500 Subject: [PATCH] Closes #81 --- .changeset/twenty-queens-grin.md | 5 +++++ plugin/src/utils/helpers.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/twenty-queens-grin.md diff --git a/.changeset/twenty-queens-grin.md b/.changeset/twenty-queens-grin.md new file mode 100644 index 0000000..e997f95 --- /dev/null +++ b/.changeset/twenty-queens-grin.md @@ -0,0 +1,5 @@ +--- +"@pandacss/eslint-plugin": patch +--- + +Fix empty imports diff --git a/plugin/src/utils/helpers.ts b/plugin/src/utils/helpers.ts index 4dd5623..77b97b6 100644 --- a/plugin/src/utils/helpers.ts +++ b/plugin/src/utils/helpers.ts @@ -39,7 +39,7 @@ const getSyncOpts = (context: RuleContext) => { export const getImportSpecifiers = (context: RuleContext) => { const specifiers: { specifier: TSESTree.ImportSpecifier; mod: string }[] = [] - context.sourceCode.ast.body.forEach((node) => { + context.sourceCode?.ast.body.forEach((node) => { if (!isImportDeclaration(node)) return const mod = node.source.value