Skip to content

Commit d679ce8

Browse files
committed
fix(linting): no-unused-vars
1 parent 2fba4b7 commit d679ce8

31 files changed

+51
-51
lines changed

bin/npx-cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const removed = new Set([
2626

2727
const { definitions, shorthands } = require('@npmcli/config/lib/definitions')
2828
const npmSwitches = Object.entries(definitions)
29-
.filter(([key, { type }]) => type === Boolean ||
29+
.filter(([, { type }]) => type === Boolean ||
3030
(Array.isArray(type) && type.includes(Boolean)))
3131
.map(([key]) => key)
3232

docs/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const replaceConfig = (src, { path }) => {
119119
}
120120

121121
const allConfig = Object.entries(definitions).sort(sort)
122-
.map(([_, def]) => def.describe())
122+
.map(([, def]) => def.describe())
123123
.join('\n\n')
124124

125125
return src.replace(replacer, allConfig)

lib/commands/adduser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class AddUser extends BaseCommand {
1212
'auth-type',
1313
]
1414

15-
async exec (args) {
15+
async exec () {
1616
const scope = this.npm.config.get('scope')
1717
let registry = this.npm.config.get('registry')
1818

lib/commands/ci.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class CI extends ArboristWorkspaceCmd {
8181
await time.start('npm-ci:rm', async () => {
8282
const path = `${where}/node_modules`
8383
// get the list of entries so we can skip the glob for performance
84-
const entries = await fs.readdir(path, null).catch(er => [])
84+
const entries = await fs.readdir(path, null).catch(() => [])
8585
return Promise.all(entries.map(f => fs.rm(`${path}/${f}`,
8686
{ force: true, recursive: true })))
8787
})

lib/commands/completion.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ const configCompl = opts => {
248248

249249
// expand with the valid values of various config values.
250250
// not yet implemented.
251-
const configValueCompl = opts => []
251+
const configValueCompl = () => []
252252

253253
// check if the thing is a flag or not.
254254
const isFlag = word => {
@@ -265,7 +265,7 @@ const isFlag = word => {
265265

266266
// complete against the npm commands
267267
// if they all resolve to the same thing, just return the thing it already is
268-
const cmdCompl = (opts, npm) => {
268+
const cmdCompl = (opts) => {
269269
const allCommands = commands.concat(Object.keys(aliases))
270270
const matches = allCommands.filter(c => c.startsWith(opts.partialWord))
271271
if (!matches.length) {

lib/commands/dedupe.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Dedupe extends ArboristWorkspaceCmd {
2121
...super.params,
2222
]
2323

24-
async exec (args) {
24+
async exec () {
2525
if (this.npm.global) {
2626
const er = new Error('`npm dedupe` does not work in global mode.')
2727
er.code = 'EDEDUPEGLOBAL'

lib/commands/diff.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class Diff extends BaseCommand {
7878

7979
// get the package name from the packument at `path`
8080
// throws if no packument is present OR if it does not have `name` attribute
81-
async packageName (path) {
81+
async packageName () {
8282
let name
8383
try {
8484
const { content: pkg } = await pkgJson.normalize(this.prefix)
@@ -103,7 +103,7 @@ class Diff extends BaseCommand {
103103
// no arguments, defaults to comparing cwd
104104
// to its latest published registry version
105105
if (!a) {
106-
const pkgName = await this.packageName(this.prefix)
106+
const pkgName = await this.packageName()
107107
return [
108108
`${pkgName}@${this.npm.config.get('tag')}`,
109109
`file:${this.prefix.replace(/#/g, '%23')}`,

lib/commands/doctor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ class Doctor extends BaseCommand {
254254
}
255255

256256
if (st.isDirectory()) {
257-
const entries = await readdir(f).catch(er => {
257+
const entries = await readdir(f).catch(() => {
258258
ok = false
259259
log.warn('doctor', 'checkFilesPermission', 'error reading directory ' + f)
260260
return []

lib/commands/find-dupes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class FindDupes extends ArboristWorkspaceCmd {
1919
...super.params,
2020
]
2121

22-
async exec (args) {
22+
async exec () {
2323
this.npm.config.set('dry-run', true)
2424
return this.npm.exec('dedupe', [])
2525
}

lib/commands/help-search.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class HelpSearch extends BaseCommand {
2222
// preserve glob@8 behavior
2323
files = files.sort((a, b) => a.localeCompare(b, 'en'))
2424
const data = await this.readFiles(files)
25-
const results = await this.searchFiles(args, data, files)
25+
const results = await this.searchFiles(args, data)
2626
const formatted = this.formatResults(args, results)
2727
if (!formatted.trim()) {
2828
output.standard(`No matches in help for: ${args.join(' ')}\n`)
@@ -40,7 +40,7 @@ class HelpSearch extends BaseCommand {
4040
return res
4141
}
4242

43-
async searchFiles (args, data, files) {
43+
async searchFiles (args, data) {
4444
const results = []
4545
for (const [file, content] of Object.entries(data)) {
4646
const lowerCase = content.toLowerCase()

0 commit comments

Comments
 (0)