Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(linting): no-unused-vars #7456

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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