Skip to content

Commit

Permalink
Merge pull request #592 from divinetettey/413-detect-unused-dependencies
Browse files Browse the repository at this point in the history
chore: added a CI step to detect unused dependencies
  • Loading branch information
JamieSlome authored Jun 18, 2024
2 parents 0ba98b2 + d4110dc commit 76348c8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
fail-on-severity: high
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
fail-on-scopes: development, runtime
allow-dependencies-licenses: 'pkg:npm/caniuse-lite'
allow-dependencies-licenses: 'pkg:npm/caniuse-lite'
25 changes: 25 additions & 0 deletions .github/workflows/unused-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Unused Dependencies'
on: [pull_request]

permissions:
contents: read

jobs:
unused-dependecies:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Setup Node.js'
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: 'Run depcheck'
run: |
npx depcheck --skip-missing --ignores="@babel/*,@commitlint/*,eslint,eslint-*,husky,mocha,concurrently,nyc,prettier"
echo $?
if [[ $? == 1 ]]; then
echo "Unused dependencies or devDependencies found"
exit 1
fi

0 comments on commit 76348c8

Please sign in to comment.