Skip to content

Commit

Permalink
fix(linting): no-unused-vars (#7456)
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar authored Apr 30, 2024
1 parent f76e769 commit 3ec86a0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
11 changes: 4 additions & 7 deletions workspaces/config/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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])
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion workspaces/libnpmdiff/lib/tarball.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion workspaces/libnpmfund/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function readTree (tree, opts) {
})

return directDepsWithFunding.reduce(
(res, { node, fundingItem }, i) => {
(res, { node, fundingItem }) => {
if (!fundingItem ||
fundingItem.length === 0 ||
!node) {
Expand Down
2 changes: 1 addition & 1 deletion workspaces/libnpmversion/test/retrieve-tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' }),
},
})

Expand Down

0 comments on commit 3ec86a0

Please sign in to comment.