From 71745f766bce71c272cae6b42d50e4ed82812328 Mon Sep 17 00:00:00 2001 From: Michal Jez Date: Mon, 21 Oct 2024 17:31:21 -0400 Subject: [PATCH] cleanup(linter): remove unused basePath parameter --- .../eslint-plugin/src/rules/enforce-module-boundaries.ts | 6 ++---- packages/eslint-plugin/src/utils/ast-utils.ts | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) 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;