Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup(linter): remove unused basePath parameter #28549

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions packages/eslint-plugin/src/utils/ast-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down Expand Up @@ -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;
Expand Down