Skip to content

Commit

Permalink
Let's start out a tad more conservative
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Oct 22, 2024
1 parent f4dc1e1 commit 58ba79f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
3 changes: 1 addition & 2 deletions knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"entry": [
"{remark,scripts}/*.ts",
"src/components/{Head,Header,Footer}.astro!"
],
"ignore": "config.ts"
]
}
}
}
2 changes: 1 addition & 1 deletion packages/knip/src/util/handle-referenced-dependency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions packages/knip/test/npm-scripts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ test('Unused dependencies in npm scripts', async () => {
dependencies: 1,
devDependencies: 1,
binaries: 2,
unresolved: 1,
processed: 2,
total: 2,
});
Expand Down Expand Up @@ -101,7 +100,6 @@ test('Unused dependencies in npm scripts (strict)', async () => {
...baseCounters,
files: 1,
dependencies: 2,
unresolved: 1,
processed: 1,
total: 2,
});
Expand Down
5 changes: 1 addition & 4 deletions packages/knip/test/plugins/angular2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down

0 comments on commit 58ba79f

Please sign in to comment.