Skip to content

Commit

Permalink
Stop using package.json as fallback containingFilePath
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Dec 10, 2024
1 parent 8658378 commit de6682b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/knip/src/WorkspaceWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ export class WorkspaceWorker {
}

const finalEntryPaths = getFinalEntryPaths(plugin, options, configEntryPaths);
for (const id of finalEntryPaths) addInput(id, id.containingFilePath ?? containingFilePath);
for (const id of finalEntryPaths) addInput(id, id.containingFilePath);

if (hasResolve) {
const dependencies = (await plugin.resolve?.(options)) ?? [];
Expand Down
2 changes: 1 addition & 1 deletion packages/knip/src/util/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ export const toDeferResolveEntry = (specifier: string): Input => ({ type: 'defer
export const isDeferResolveEntry = (input: Input) => input.type === 'deferResolveEntry';

export const toDebugString = (input: Input) =>
`${input.type}:${input.specifier} ${input.containingFilePath ? `(${toRelative(input.containingFilePath)})` : ''}`;
`${input.type}:${input.specifier}${input.containingFilePath ? ` (${toRelative(input.containingFilePath)})` : ''}`;

0 comments on commit de6682b

Please sign in to comment.