Skip to content

Commit 3e49ef3

Browse files
authored
ci: Replace depcheck with knip (#223)
Due to the deprecation of depcheck we migrated to knip, which is in active development and has more features. As a first step we only activate the checking of unused dependencies. JIRA: CPOUI5FOUNDATION-1126
1 parent 029d376 commit 3e49ef3

5 files changed

Lines changed: 496 additions & 644 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: npm run check-licenses
3232

3333
- name: Perform dependency check
34-
run: npm run depcheck
34+
run: npm run knip
3535

3636
- name: Perform build
3737
run: npm run build-test

.nycrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"reporter": ["lcov", "text", "text-summary"],
44
"include": ["src/**"],
55
"exclude": [
6-
"**/*.d.ts"
6+
"**/*.d.ts",
7+
"knip.config.js"
78
],
89
"check-coverage": true,
910
"statements": 85,

knip.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const config = {
2+
/**
3+
* We only need dependency checking at the moment,
4+
* so all checks except for dependencies are turned off.
5+
*/
6+
rules: {
7+
files: "off",
8+
duplicates: "off",
9+
classMembers: "off",
10+
unlisted: "off",
11+
binaries: "off",
12+
unresolved: "off",
13+
catalog: "off",
14+
exports: "off",
15+
types: "off",
16+
enumMembers: "off",
17+
},
18+
19+
ignoreDependencies: [
20+
/**
21+
* Used via nyc ava --node-arguments="--experimental-loader=@istanbuljs/esm-loader-hook"
22+
* which is not detected by knip as a usage of this package
23+
*/
24+
"@istanbuljs/esm-loader-hook",
25+
],
26+
};
27+
28+
export default config;

0 commit comments

Comments
 (0)