diff --git a/packages/eslint-plugin-nx/src/rules/enforce-module-boundaries.ts b/packages/eslint-plugin-nx/src/rules/enforce-module-boundaries.ts index ea637fef0fa94..960a4c7af5407 100644 --- a/packages/eslint-plugin-nx/src/rules/enforce-module-boundaries.ts +++ b/packages/eslint-plugin-nx/src/rules/enforce-module-boundaries.ts @@ -239,7 +239,9 @@ export default createESLintRule({ return; } - const imports = specifiers.map((s) => s.imported.name); + const imports = specifiers + .filter((s) => s.type === 'ImportSpecifier') + .map((s) => s.imported.name); // process each potential entry point and try to find the imports const importsToRemap = []; @@ -313,7 +315,9 @@ export default createESLintRule({ return; } // imported JS functions to remap - const imports = specifiers.map((s) => s.imported.name); + const imports = specifiers + .filter((s) => s.type === 'ImportSpecifier') + .map((s) => s.imported.name); // process each potential entry point and try to find the imports const importsToRemap = [];