Skip to content

Commit

Permalink
Fix regression re. isIncludeEntryExports → skipExportsAnalysis from s…
Browse files Browse the repository at this point in the history
…cripts/plugins (resolves #857)
  • Loading branch information
webpro committed Nov 26, 2024
1 parent 6e62de8 commit b8379de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/knip/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export const main = async (unresolvedConfiguration: CommandLineOptions) => {
const ws =
(dependency.containingFilePath && chief.findWorkspaceByFilePath(dependency.containingFilePath)) || workspace;
const specifierFilePath = getReferencedInternalFilePath(dependency, ws);
if (specifierFilePath) principal.addEntryPath(specifierFilePath);
if (specifierFilePath) principal.addEntryPath(specifierFilePath, { skipExportsAnalysis: true });
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/knip/test/include-entry-exports-scripts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test('Skip unused exports in entry source files and scripts', async () => {
});
});

test('Report unused exports in source files and scripts (skip for plugin entry files)', async () => {
test('Report unused exports in source files (skip for scripts and plugin entry files)', async () => {
const { counters } = await main({
...baseArguments,
cwd,
Expand All @@ -30,7 +30,7 @@ test('Report unused exports in source files and scripts (skip for plugin entry f

assert.deepEqual(counters, {
...baseCounters,
exports: 5,
exports: 0, // skip for scripts and plugin entry files
processed: 5,
total: 5,
});
Expand Down

0 comments on commit b8379de

Please sign in to comment.