diff --git a/packages/eslint-plugin/src/rules/enforce-module-boundaries.ts b/packages/eslint-plugin/src/rules/enforce-module-boundaries.ts index d292ba9499e4b..8615989bff468 100644 --- a/packages/eslint-plugin/src/rules/enforce-module-boundaries.ts +++ b/packages/eslint-plugin/src/rules/enforce-module-boundaries.ts @@ -337,8 +337,7 @@ export default ESLintUtils.RuleCreator( for (const importMember of imports) { const importPath = getRelativeImportPath( importMember, - join(workspaceRoot, entryPointPath.path), - sourceProject.data.sourceRoot + join(workspaceRoot, entryPointPath.path) ); // we cannot remap, so leave it as is if (importPath) { @@ -444,8 +443,7 @@ export default ESLintUtils.RuleCreator( for (const importMember of imports) { const importPath = getRelativeImportPath( importMember, - join(workspaceRoot, entryPointPath), - sourceProject.data.sourceRoot + join(workspaceRoot, entryPointPath) ); if (importPath) { // resolve the import path diff --git a/packages/eslint-plugin/src/utils/ast-utils.ts b/packages/eslint-plugin/src/utils/ast-utils.ts index 23ca93dea7ec3..4ade25665efb9 100644 --- a/packages/eslint-plugin/src/utils/ast-utils.ts +++ b/packages/eslint-plugin/src/utils/ast-utils.ts @@ -108,7 +108,7 @@ function hasMemberExport(exportedMember, filePath) { ); } -export function getRelativeImportPath(exportedMember, filePath, basePath) { +export function getRelativeImportPath(exportedMember, filePath) { const status = lstatSync(filePath, { throwIfNoEntry: false, }); @@ -273,8 +273,7 @@ export function getRelativeImportPath(exportedMember, filePath, basePath) { if (hasMemberExport(exportedMember, moduleFilePath)) { const foundFilePath = getRelativeImportPath( exportedMember, - moduleFilePath, - basePath + moduleFilePath ); if (foundFilePath) { return foundFilePath;