diff --git a/knip.json b/knip.json index 3f06cf636..95ee580ee 100644 --- a/knip.json +++ b/knip.json @@ -17,8 +17,7 @@ "entry": [ "{remark,scripts}/*.ts", "src/components/{Head,Header,Footer}.astro!" - ], - "ignore": "config.ts" + ] } } } diff --git a/packages/knip/src/util/handle-referenced-dependency.ts b/packages/knip/src/util/handle-referenced-dependency.ts index 9a9ac7fb0..63f0cb36f 100644 --- a/packages/knip/src/util/handle-referenced-dependency.ts +++ b/packages/knip/src/util/handle-referenced-dependency.ts @@ -93,7 +93,7 @@ export const getReferencedDependencyHandler = workspace: workspace.name, symbol: packageName ?? specifier, }); - } else if (!isGitIgnored(filePath)) { + } else if (!isConfigPattern(dependency) && !isGitIgnored(filePath)) { collector.addIssue({ type: 'unresolved', filePath: containingFilePath, diff --git a/packages/knip/test/npm-scripts.test.ts b/packages/knip/test/npm-scripts.test.ts index b1cafada5..af9466fb5 100644 --- a/packages/knip/test/npm-scripts.test.ts +++ b/packages/knip/test/npm-scripts.test.ts @@ -71,7 +71,6 @@ test('Unused dependencies in npm scripts', async () => { dependencies: 1, devDependencies: 1, binaries: 2, - unresolved: 1, processed: 2, total: 2, }); @@ -101,7 +100,6 @@ test('Unused dependencies in npm scripts (strict)', async () => { ...baseCounters, files: 1, dependencies: 2, - unresolved: 1, processed: 1, total: 2, }); diff --git a/packages/knip/test/plugins/angular2.test.ts b/packages/knip/test/plugins/angular2.test.ts index 127b98d59..abddda0a1 100644 --- a/packages/knip/test/plugins/angular2.test.ts +++ b/packages/knip/test/plugins/angular2.test.ts @@ -8,16 +8,13 @@ import baseCounters from '../helpers/baseCounters.js'; const cwd = resolve('fixtures/plugins/angular2'); test('Find dependencies with the Angular plugin (2)', async () => { - const { issues, counters } = await main({ + const { counters } = await main({ ...baseArguments, cwd, }); - assert(issues.unresolved['angular.json']['tsconfig.spec.json']); - assert.deepEqual(counters, { ...baseCounters, - unresolved: 1, processed: 2, total: 2, });