Skip to content

Commit 76348c8

Browse files
authored
Merge pull request #592 from divinetettey/413-detect-unused-dependencies
chore: added a CI step to detect unused dependencies
2 parents 0ba98b2 + d4110dc commit 76348c8

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
fail-on-severity: high
1919
allow-licenses: MIT, Apache-2.0, BSD-3-Clause, ISC, BSD-2-Clause, Unlicense, CC0-1.0, 0BSD, X11, MPL-2.0, MPL-1.0, MPL-1.1, MPL-2.0
2020
fail-on-scopes: development, runtime
21-
allow-dependencies-licenses: 'pkg:npm/caniuse-lite'
21+
allow-dependencies-licenses: 'pkg:npm/caniuse-lite'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: 'Unused Dependencies'
2+
on: [pull_request]
3+
4+
permissions:
5+
contents: read
6+
7+
jobs:
8+
unused-dependecies:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: 'Checkout Repository'
12+
uses: actions/checkout@v4
13+
- name: 'Setup Node.js'
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: '18.x'
17+
- name: 'Run depcheck'
18+
run: |
19+
npx depcheck --skip-missing --ignores="@babel/*,@commitlint/*,eslint,eslint-*,husky,mocha,concurrently,nyc,prettier"
20+
echo $?
21+
if [[ $? == 1 ]]; then
22+
echo "Unused dependencies or devDependencies found"
23+
exit 1
24+
fi
25+

0 commit comments

Comments
 (0)