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