Skip to content

Commit a1b95eb

Browse files
committedApr 30, 2024··
fix(linting): no-unused-vars
1 parent 356c374 commit a1b95eb

12 files changed

+26
-26
lines changed
 

‎workspaces/arborist/lib/arborist/build-ideal-tree.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ module.exports = cls => class IdealTreeBuilder extends cls {
463463
}
464464
const dir = resolve(nm, name)
465465
const st = await lstat(dir)
466-
.catch(/* istanbul ignore next */ er => null)
466+
.catch(/* istanbul ignore next */ () => null)
467467
if (st && st.isSymbolicLink()) {
468468
const target = await readlink(dir)
469469
const real = resolve(dirname(dir), target).replace(/#/g, '%23')
@@ -1024,7 +1024,7 @@ This is a one-time fix-up, please be patient...
10241024
for (const e of this.#problemEdges(placed)) {
10251025
promises.push(() =>
10261026
this.#fetchManifest(npa.resolve(e.name, e.spec, fromPath(placed, e)))
1027-
.catch(er => null)
1027+
.catch(() => null)
10281028
)
10291029
}
10301030
},
@@ -1273,7 +1273,7 @@ This is a one-time fix-up, please be patient...
12731273
})
12741274
}
12751275

1276-
#linkFromSpec (name, spec, parent, edge) {
1276+
#linkFromSpec (name, spec, parent) {
12771277
const realpath = spec.fetchSpec
12781278
const { installLinks, legacyPeerDeps } = this
12791279
return rpj(realpath + '/package.json').catch(() => ({})).then(pkg => {

‎workspaces/arborist/lib/arborist/isolated-reifier.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ module.exports = cls => class IsolatedReifier extends cls {
212212
return { edges, nodes }
213213
}
214214

215-
async [_createIsolatedTree] (idealTree) {
215+
async [_createIsolatedTree] () {
216216
await this[_makeIdealGraph](this.options)
217217

218218
const proxiedIdealTree = this.idealGraph

‎workspaces/arborist/lib/arborist/load-actual.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ module.exports = cls => class ActualLoader extends cls {
336336
await this.#loadFSChildren(node.target)
337337
return Promise.all(
338338
[...node.target.children.entries()]
339-
.filter(([name, kid]) => !did.has(kid.realpath))
340-
.map(([name, kid]) => this.#loadFSTree(kid))
339+
.filter(([, kid]) => !did.has(kid.realpath))
340+
.map(([, kid]) => this.#loadFSTree(kid))
341341
)
342342
}
343343
}

‎workspaces/arborist/lib/arborist/load-virtual.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ module.exports = cls => class VirtualLoader extends cls {
283283
return node
284284
}
285285

286-
#loadLink (location, targetLoc, target, meta) {
286+
#loadLink (location, targetLoc, target) {
287287
const path = resolve(this.path, location)
288288
const link = new Link({
289289
installLinks: this.installLinks,

‎workspaces/arborist/lib/arborist/reify.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ module.exports = cls => class Reifier extends cls {
136136
// this is currently technical debt which will be resolved in a refactor
137137
// of Node/Link trees
138138
log.warn('reify', 'The "linked" install strategy is EXPERIMENTAL and may contain bugs.')
139-
this.idealTree = await this[_createIsolatedTree](this.idealTree)
139+
this.idealTree = await this[_createIsolatedTree]()
140140
}
141141
await this[_diffTrees]()
142142
await this[_reifyPackages]()
@@ -540,7 +540,7 @@ module.exports = cls => class Reifier extends cls {
540540
.map(([from, to]) => this[_renamePath](to, from))
541541
return promiseAllRejectLate(movePromises)
542542
// ignore subsequent rollback errors
543-
.catch(er => {})
543+
.catch(() => {})
544544
.then(timeEnd)
545545
.then(() => {
546546
throw er
@@ -608,7 +608,7 @@ module.exports = cls => class Reifier extends cls {
608608
continue
609609
}
610610
dirsChecked.add(d)
611-
const st = await lstat(d).catch(er => null)
611+
const st = await lstat(d).catch(() => null)
612612
// this can happen if we have a link to a package with a name
613613
// that the filesystem treats as if it is the same thing.
614614
// would be nice to have conditional istanbul ignores here...
@@ -779,7 +779,7 @@ module.exports = cls => class Reifier extends cls {
779779
return
780780
}
781781
await debug(async () => {
782-
const st = await lstat(node.path).catch(e => null)
782+
const st = await lstat(node.path).catch(() => null)
783783
if (st && !st.isDirectory()) {
784784
debug.log('unpacking into a non-directory', node)
785785
throw Object.assign(new Error('ENOTDIR: not a directory'), {
@@ -815,7 +815,7 @@ module.exports = cls => class Reifier extends cls {
815815
// if the node is optional, then the failure of the promise is nonfatal
816816
// just add it and its optional set to the trash list.
817817
[_handleOptionalFailure] (node, p) {
818-
return (node.optional ? p.catch(er => {
818+
return (node.optional ? p.catch(() => {
819819
const set = optionalSet(node)
820820
for (node of set) {
821821
log.verbose('reify', 'failed optional dependency', node.path)

‎workspaces/arborist/lib/dep-valid.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const linkValid = (child, requested, requestor) => {
124124
return isLink && relative(child.realpath, requested.fetchSpec) === ''
125125
}
126126

127-
const tarballValid = (child, requested, requestor) => {
127+
const tarballValid = (child, requested) => {
128128
if (child.isLink) {
129129
return false
130130
}

‎workspaces/arborist/lib/inventory.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class Inventory extends Map {
130130
return super.get(node.location) === node
131131
}
132132

133-
set (k, v) {
133+
set () {
134134
throw new Error('direct set() not supported, use inventory.add(node)')
135135
}
136136
}

‎workspaces/arborist/lib/query-selector-all.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -650,27 +650,27 @@ class Results {
650650
// operators for attribute selectors
651651
const attributeOperators = {
652652
// attribute value is equivalent
653-
'=' ({ attr, value, insensitive }) {
653+
'=' ({ attr, value }) {
654654
return attr === value
655655
},
656656
// attribute value contains word
657-
'~=' ({ attr, value, insensitive }) {
657+
'~=' ({ attr, value }) {
658658
return (attr.match(/\w+/g) || []).includes(value)
659659
},
660660
// attribute value contains string
661-
'*=' ({ attr, value, insensitive }) {
661+
'*=' ({ attr, value }) {
662662
return attr.includes(value)
663663
},
664664
// attribute value is equal or starts with
665-
'|=' ({ attr, value, insensitive }) {
665+
'|=' ({ attr, value }) {
666666
return attr.startsWith(`${value}-`)
667667
},
668668
// attribute value starts with
669-
'^=' ({ attr, value, insensitive }) {
669+
'^=' ({ attr, value }) {
670670
return attr.startsWith(value)
671671
},
672672
// attribute value ends with
673-
'$=' ({ attr, value, insensitive }) {
673+
'$=' ({ attr, value }) {
674674
return attr.endsWith(value)
675675
},
676676
}

‎workspaces/arborist/test/arborist/build-ideal-tree.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ t.test('fail on malformed package.json', t => {
136136
)
137137
})
138138

139-
t.test('ignore mismatched engine for optional dependencies', async t => {
139+
t.test('ignore mismatched engine for optional dependencies', async () => {
140140
const path = resolve(fixtures, 'optional-engine-specification')
141141
await buildIdeal(path, {
142142
...OPT,

‎workspaces/arborist/test/arborist/load-actual-ctor-throw.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const rpj = require('read-package-json-fast')
22
const t = require('tap')
33
const rpjMock = Object.assign((...args) => rpj(...args), {
44
...rpj,
5-
normalize: (...args) => {
5+
normalize: () => {
66
throw new Error('boom')
77
},
88
})

‎workspaces/arborist/test/arborist/rebuild.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ t.test('rebuild node-gyp dependencies lacking both preinstall and install script
438438
t.test('do not rebuild node-gyp dependencies with gypfile:false', async t => {
439439
// use require-inject so we don't need an actual massive binary dep fixture
440440
const Arborist = t.mock('../../lib/arborist/index.js', {
441-
'@npmcli/run-script': async opts => {
441+
'@npmcli/run-script': async () => {
442442
throw new Error('should not run any scripts')
443443
},
444444
})

‎workspaces/arborist/test/arborist/reify.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ t.test('rollbacks', { buffered: false }, t => {
791791
const check = warningTracker()
792792
return t.rejects(a.reify({
793793
update: ['@isaacs/testing-bundledeps-parent'],
794-
}).then(tree => 'it worked'), new Error('poop'))
794+
}).then(() => 'it worked'), new Error('poop'))
795795
// eslint-disable-next-line promise/always-return
796796
.then(() => {
797797
const warnings = check()
@@ -843,7 +843,7 @@ t.test('rollbacks', { buffered: false }, t => {
843843
a[kLoadBundles] = (depth, bundlesByDepth) => {
844844
const kRN = Symbol.for('reifyNode')
845845
const reifyNode = a[kRN]
846-
a[kRN] = node => {
846+
a[kRN] = () => {
847847
a[kRN] = reifyNode
848848
return Promise.reject(new Error('poop'))
849849
}
@@ -861,7 +861,7 @@ t.test('rollbacks', { buffered: false }, t => {
861861
a[kUnpack] = () => {
862862
const kReify = Symbol.for('reifyNode')
863863
const reifyNode = a[kReify]
864-
a[kReify] = node => {
864+
a[kReify] = () => {
865865
a[kReify] = reifyNode
866866
return Promise.reject(new Error('poop'))
867867
}

0 commit comments

Comments
 (0)
Please sign in to comment.