From 3ec86a0e258b1d5f5182f0093adf43c54e82578e Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 30 Apr 2024 14:40:43 -0700 Subject: [PATCH] fix(linting): no-unused-vars (#7456) --- workspaces/config/lib/index.js | 11 ++++------- workspaces/libnpmdiff/lib/tarball.js | 2 +- workspaces/libnpmfund/lib/index.js | 2 +- workspaces/libnpmversion/test/retrieve-tag.js | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/workspaces/config/lib/index.js b/workspaces/config/lib/index.js index 49c4f0a18115c..c99292db9afb4 100644 --- a/workspaces/config/lib/index.js +++ b/workspaces/config/lib/index.js @@ -557,7 +557,7 @@ class Config { const k = envReplace(key, this.env) const v = this.parseField(value, k) if (where !== 'default') { - this.#checkDeprecated(k, where, obj, [key, value]) + this.#checkDeprecated(k) if (this.definitions[key]?.exclusive) { for (const exclusive of this.definitions[key].exclusive) { if (!this.isDefault(exclusive)) { @@ -571,7 +571,7 @@ class Config { } } - #checkDeprecated (key, where, obj, kv) { + #checkDeprecated (key) { // XXX(npm9+) make this throw an error if (this.deprecated[key]) { log.warn('config', key, this.deprecated[key]) @@ -739,7 +739,7 @@ class Config { const iniData = ini.stringify(conf.raw).trim() + '\n' if (!iniData.trim()) { // ignore the unlink error (eg, if file doesn't exist) - await unlink(conf.source).catch(er => {}) + await unlink(conf.source).catch(() => {}) return } const dir = dirname(conf.source) @@ -774,12 +774,9 @@ class Config { this.delete(`${nerfed}:keyfile`, level) } - setCredentialsByURI (uri, { token, username, password, email, certfile, keyfile }) { + setCredentialsByURI (uri, { token, username, password, certfile, keyfile }) { const nerfed = nerfDart(uri) - // email is either provided, a top level key, or nothing - email = email || this.get('email', 'user') - // field that hasn't been used as documented for a LONG time, // and as of npm 7.10.0, isn't used at all. We just always // send auth if we have it, only to the URIs under the nerf dart. diff --git a/workspaces/libnpmdiff/lib/tarball.js b/workspaces/libnpmdiff/lib/tarball.js index 930d624f2d5b6..41ea84a6885a5 100644 --- a/workspaces/libnpmdiff/lib/tarball.js +++ b/workspaces/libnpmdiff/lib/tarball.js @@ -9,7 +9,7 @@ const tar = require('tar') // returns a simplified tarball when reading files from node_modules folder, // thus avoiding running the prepare scripts and the extra logic from packlist -const nodeModulesTarball = (manifest, opts) => +const nodeModulesTarball = (manifest) => pkgContents({ path: manifest._resolved, depth: 1 }) .then(files => files.map(file => relative(manifest._resolved, file)) diff --git a/workspaces/libnpmfund/lib/index.js b/workspaces/libnpmfund/lib/index.js index a53893dc1cf87..39b69afc0abcc 100644 --- a/workspaces/libnpmfund/lib/index.js +++ b/workspaces/libnpmfund/lib/index.js @@ -133,7 +133,7 @@ function readTree (tree, opts) { }) return directDepsWithFunding.reduce( - (res, { node, fundingItem }, i) => { + (res, { node, fundingItem }) => { if (!fundingItem || fundingItem.length === 0 || !node) { diff --git a/workspaces/libnpmversion/test/retrieve-tag.js b/workspaces/libnpmversion/test/retrieve-tag.js index 29155acdf5195..78989ddd57054 100644 --- a/workspaces/libnpmversion/test/retrieve-tag.js +++ b/workspaces/libnpmversion/test/retrieve-tag.js @@ -3,7 +3,7 @@ const requireInject = require('require-inject') let tag const retrieveTag = requireInject('../lib/retrieve-tag.js', { '@npmcli/git': { - spawn: async (cmd, opts) => ({ stdout: tag + '\n' }), + spawn: async () => ({ stdout: tag + '\n' }), }, })