From 4de41082d625c1513d2dc192bf562000e21de1c8 Mon Sep 17 00:00:00 2001 From: Lars Kappert Date: Fri, 19 Apr 2024 10:24:46 +0200 Subject: [PATCH] Remove obsolete `by` set --- packages/knip/src/index.ts | 1 - packages/knip/src/types/serializable-map.ts | 1 - packages/knip/src/typescript/getImportsAndExports.ts | 3 --- 3 files changed, 5 deletions(-) diff --git a/packages/knip/src/index.ts b/packages/knip/src/index.ts index 717457e17..f724772df 100644 --- a/packages/knip/src/index.ts +++ b/packages/knip/src/index.ts @@ -253,7 +253,6 @@ export const main = async (unresolvedConfiguration: CommandLineOptions) => { for (const id of importItems.importedNs) importedModule.importedNs.add(id); for (const id of importItems.isReExportedBy) importedModule.isReExportedBy.add(id); for (const id of importItems.isReExportedNs) importedModule.isReExportedNs.add(id); - for (const id of importItems.by) importedModule.by.add(id); if (importItems.hasStar) importedModule.hasStar = true; if (importItems.isReExport) importedModule.isReExport = true; }; diff --git a/packages/knip/src/types/serializable-map.ts b/packages/knip/src/types/serializable-map.ts index b21efb227..baa7eed73 100644 --- a/packages/knip/src/types/serializable-map.ts +++ b/packages/knip/src/types/serializable-map.ts @@ -17,7 +17,6 @@ export type SerializableImports = { isReExportedBy: Set; isReExportedAs: Set<[string, string]>; isReExportedNs: Set<[string, string]>; - by: Set; }; export type SerializableImportMap = Record; diff --git a/packages/knip/src/typescript/getImportsAndExports.ts b/packages/knip/src/typescript/getImportsAndExports.ts index d976bf90f..a48e00ecb 100644 --- a/packages/knip/src/typescript/getImportsAndExports.ts +++ b/packages/knip/src/typescript/getImportsAndExports.ts @@ -104,11 +104,8 @@ const getImportsAndExports = ( isReExportedNs: new Set(), importedNs: new Set(), identifiers: new Set(), - by: new Set(), }); - internalImport.by.add(sourceFile.fileName); - if (isReExport) { internalImport.isReExport = true; if (namespace && isStar) internalImport.isReExportedAs.add([sourceFile.fileName, namespace]);