Skip to content

Commit f329a01

Browse files
authored
Add unimported to workflow (#2441)
* Remove unused file: lib/sinon/blob.js The last reference to this file was removed in 6b1841f, making it safe to remove * Move getConfig into test/ This has only been in use by tests since e37e1a6, so doesn't belong in the src/ folder anymore * Remove unused lib/sinon/util/core/restore.js Searching the git history, we find that the last reference to this file was removed with e37e1a6. ``` git log -p --full-history --all -G'require.*restore"' li ``` Therefore, it is safe to remove the file. * Add check for unimported files This allows us to find files that are no longer in use in the project and can be safely removed. See https://github.com/smeijer/unimported * fixup! Remove unused lib/sinon/util/core/restore.js
1 parent 209f71f commit f329a01

File tree

10 files changed

+1556
-104
lines changed

10 files changed

+1556
-104
lines changed

.github/workflows/main.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- master
77
pull_request:
88
branches:
9-
- '**'
9+
- "**"
1010

1111
jobs:
1212
prettier:
@@ -56,6 +56,29 @@ jobs:
5656
run: |
5757
npm run lint
5858
59+
unused:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v2
63+
- uses: actions/setup-node@v2
64+
with:
65+
node-version: "lts/*"
66+
- name: Cache modules
67+
uses: actions/cache@v2
68+
with:
69+
path: ~/.npm
70+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
71+
restore-keys: |
72+
${{ runner.os }}-node-
73+
- name: Install dependencies
74+
run: |
75+
npm ci
76+
env:
77+
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
78+
- name: Find unused files
79+
run: |
80+
npm run unimported
81+
5982
browser-test:
6083
runs-on: ubuntu-latest
6184
steps:

.unimportedrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"entry": ["lib/sinon.js", "lib/sinon-esm.js"],
3+
"extensions": [".js"],
4+
"ignorePatterns": ["**/node_modules/**"],
5+
"ignoreUnresolved": [],
6+
"ignoreUnimported": ["docs/**", "pkg/**", "test/**"],
7+
"ignoreUnused": []
8+
}

lib/sinon/blob.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

lib/sinon/util/core/restore.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)