Skip to content

Commit

Permalink
Return undefined if no manifest (shouldn't happen anyway)
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Feb 23, 2024
1 parent 0b11c77 commit 624c001
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/knip/src/ConfigurationChief.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ export class ConfigurationChief {
}

public getManifestForWorkspace(dir: string) {
return this.availableWorkspaceManifests?.find(item => item.dir === dir)?.manifest ?? {};
return this.availableWorkspaceManifests?.find(item => item.dir === dir)?.manifest;
}

public getIncludedWorkspaces() {
Expand Down
2 changes: 2 additions & 0 deletions packages/knip/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ export const main = async (unresolvedConfiguration: CommandLineOptions) => {
const manifest = chief.getManifestForWorkspace(dir);
const { ignoreBinaries, ignoreDependencies } = chief.getIgnores(name);

if (!manifest) continue;

deputy.addWorkspace({ name, cwd, dir, manifestPath, manifest, ignoreBinaries, ignoreDependencies });
const dependencies = deputy.getDependencies(name);

Expand Down

0 comments on commit 624c001

Please sign in to comment.