Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 326c7a3

Browse files
committedMay 4, 2024
fix(linting): no-unused-vars
1 parent 4a66453 commit 326c7a3

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed
 

‎lib/content/read.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function readStream (cache, integrity, opts = {}) {
7171
module.exports.copy = copy
7272

7373
function copy (cache, integrity, dest) {
74-
return withContentSri(cache, integrity, (cpath, sri) => {
74+
return withContentSri(cache, integrity, (cpath) => {
7575
return fs.copyFile(cpath, dest)
7676
})
7777
}

‎lib/content/write.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ async function makeTmp (cache, opts) {
160160
}
161161
}
162162

163-
async function moveToDestination (tmp, cache, sri, opts) {
163+
async function moveToDestination (tmp, cache, sri) {
164164
const destination = contentPath(cache, sri)
165165
const destDir = path.dirname(destination)
166166
if (moveOperations.has(destination)) {

‎lib/entry-index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ async function bucketEntries (bucket, filter) {
240240
return _bucketEntries(data, filter)
241241
}
242242

243-
function _bucketEntries (data, filter) {
243+
function _bucketEntries (data) {
244244
const entries = []
245245
data.split('\n').forEach((entry) => {
246246
if (!entry) {

‎lib/verify.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ async function verify (cache, opts) {
6868
return stats
6969
}
7070

71-
async function markStartTime (cache, opts) {
71+
async function markStartTime () {
7272
return { startTime: new Date() }
7373
}
7474

75-
async function markEndTime (cache, opts) {
75+
async function markEndTime () {
7676
return { endTime: new Date() }
7777
}
7878

@@ -213,7 +213,7 @@ async function rebuildIndex (cache, opts) {
213213
return stats
214214
}
215215

216-
async function rebuildBucket (cache, bucket, stats, opts) {
216+
async function rebuildBucket (cache, bucket, stats) {
217217
await truncate(bucket._path)
218218
// This needs to be serialized because cacache explicitly
219219
// lets very racy bucket conflicts clobber each other.

‎test/content/read.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const getReadStatFailure = (t, err) => getRead(t, {
2626
},
2727
'fs/promises': {
2828
...fs.promises,
29-
stat: async (path) => {
29+
stat: async () => {
3030
throw err
3131
},
3232
},
@@ -153,7 +153,7 @@ t.test('read: error while parsing provided integrity data', function (t) {
153153
const INTEGRITY = 'sha1-deadbeef'
154154
const mockedRead = getRead(t, {
155155
ssri: {
156-
parse (sri) {
156+
parse () {
157157
throw genericError
158158
},
159159
},
@@ -221,7 +221,7 @@ t.test('read: opening large files', function (t) {
221221
const mockedRead = getRead(t, {
222222
'fs/promises': {
223223
...fs.promises,
224-
stat: async (path) => {
224+
stat: async () => {
225225
return { size: Number.MAX_SAFE_INTEGER }
226226
},
227227
},

‎test/entry-index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const getEntryIndex = (t, opts) => t.mock('../lib/entry-index', opts)
1919
const getEntryIndexReadFileFailure = (t, err) => getEntryIndex(t, {
2020
'fs/promises': {
2121
...fs.promises,
22-
readFile: async (path, encode) => {
22+
readFile: async () => {
2323
throw err
2424
},
2525
},
@@ -177,7 +177,7 @@ t.test('find: error on parsing json data', (t) => {
177177
// mocks readFile in order to return a borked json payload
178178
const { find } = getEntryIndex(t, {
179179
'@npmcli/fs': Object.assign({}, require('@npmcli/fs'), {
180-
readFile: async (path, encode) => {
180+
readFile: async () => {
181181
return '\ncec8d2e4685534ed189b563c8ee1cb1cb7c72874\t{"""// foo'
182182
},
183183
}),
@@ -235,7 +235,7 @@ t.test('lsStream: unknown error reading dirs', (t) => {
235235
const { lsStream } = getEntryIndex(t, {
236236
'fs/promises': {
237237
...fs.promises,
238-
readdir: async (path) => {
238+
readdir: async () => {
239239
throw genericError
240240
},
241241
},

‎test/rm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ t.test('rm.content removes content, not entries', (t) => {
5050
.then(() => {
5151
return get(cache, KEY)
5252
})
53-
.then((res) => {
53+
.then(() => {
5454
throw new Error('unexpected success')
5555
})
5656
.catch((err) => {

‎test/verify.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ t.test('missing file error when validating cache content', async t => {
217217
missingFileError.code = 'ENOENT'
218218
const mockVerify = getVerify(t, {
219219
'fs/promises': Object.assign({}, fs, {
220-
stat: async (path) => {
220+
stat: async () => {
221221
throw missingFileError
222222
},
223223
}),
@@ -239,7 +239,7 @@ t.test('missing file error when validating cache content', async t => {
239239
t.test('unknown error when validating content', async t => {
240240
const mockVerify = getVerify(t, {
241241
'fs/promises': Object.assign({}, fs, {
242-
stat: async (path) => {
242+
stat: async () => {
243243
throw genericError
244244
},
245245
}),

0 commit comments

Comments
 (0)
Failed to load comments.