From d59bd10d6c2f2168fc9925338a4153e700f7f550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Jona=C5=A1?= Date: Wed, 2 Nov 2022 22:39:04 +0100 Subject: [PATCH] fix(linter): do not remap namespace import specifiers as import specifiers (#12954) --- .../src/rules/enforce-module-boundaries.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 1ac7200d0f67e..0d067184a915e 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 = [];