Skip to content

Commit

Permalink
fix(linting): no-unused-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed May 3, 2024
1 parent dc0202d commit 095786d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions lib/bin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
/* eslint-disable no-console */

const run = conf => {
const pacote = require('../')
Expand Down
2 changes: 1 addition & 1 deletion lib/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class GitFetcher extends Fetcher {
[_resolvedFromClone] () {
// do a full or shallow clone, then look at the HEAD
// kind of wasteful, but no other option, really
return this[_clone](dir => this.resolved)
return this[_clone](() => this.resolved)
}

[_prepareDir] (dir) {
Expand Down
2 changes: 1 addition & 1 deletion test/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pacote.manifest = (spec, conf) => Promise.resolve({
pacote.packument = (spec, conf) => Promise.resolve({ method: 'packument', spec, conf })
pacote.tarball.file = (spec, file, conf) => Promise.resolve({ method: 'tarball', spec, file, conf })
const { Minipass } = require('minipass')
pacote.tarball.stream = (spec, handler, conf) => handler(new Minipass().end('tarball data'))
pacote.tarball.stream = (spec, handler) => handler(new Minipass().end('tarball data'))
pacote.extract = (spec, dest, conf) => Promise.resolve({ method: 'extract', spec, dest, conf })

t.test('running bin runs main file', t => {
Expand Down
4 changes: 2 additions & 2 deletions test/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ t.test('tarball data', async t => {

t.test('tarballFile', t => {
const target = resolve(me, 'tarball-file')
t.test('basic copy', t =>
t.test('basic copy', () =>
new FileFetcher(abbrevspec, { cache })
.tarballFile(target + '/basic/1.tgz'))

t.test('again, folder already created', t =>
t.test('again, folder already created', () =>
new FileFetcher(abbrevspec, { cache })
.tarballFile(target + '/basic/2.tgz'))

Expand Down
12 changes: 6 additions & 6 deletions test/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const tar = require('tar')

let REPO_HEAD = ''
t.test('setup', { bail: true }, t => {
t.test('create repo', t => {
t.test('create repo', () => {
const git = (...cmd) => spawnGit(cmd, { cwd: repo })
const write = (f, c) => fs.writeFileSync(`${repo}/${f}`, c)
const npm = (...cmd) => spawnNpm('npm', [
Expand Down Expand Up @@ -162,7 +162,7 @@ t.test('setup', { bail: true }, t => {
.then(({ stdout }) => REPO_HEAD = stdout.trim())
})

t.test('create cycle of git prepared deps', async t => {
t.test('create cycle of git prepared deps', async () => {
for (const repoDir of [cycleA, cycleB]) {
const git = (...cmd) => spawnGit(cmd, { cwd: repoDir })
const write = (f, c) => fs.writeFileSync(`${repoDir}/${f}`, c)
Expand Down Expand Up @@ -227,7 +227,7 @@ t.test('setup', { bail: true }, t => {
daemon.on('close', () => rmSync(me, { recursive: true, force: true }))
})

t.test('create a repo with a submodule', t => {
t.test('create a repo with a submodule', () => {
const submoduleRepo = resolve(me, 'submodule-repo')
const git = (...cmd) => spawnGit(cmd, { cwd: submoduleRepo })
const write = (f, c) => fs.writeFileSync(`${submoduleRepo}/${f}`, c)
Expand Down Expand Up @@ -285,7 +285,7 @@ t.test('setup', { bail: true }, t => {
.then(() => git('commit', '-m', 'package'))
})

t.test('create a repo with workspaces', t => {
t.test('create a repo with workspaces', () => {
const workspacesRepo = resolve(me, 'workspaces-repo')
const wsfolder = resolve(me, 'workspaces-repo/a')
const git = (...cmd) => spawnGit(cmd, { cwd: workspacesRepo })
Expand Down Expand Up @@ -315,7 +315,7 @@ t.test('setup', { bail: true }, t => {
.then(() => git('commit', '-m', 'a/package.json'))
})

t.test('create a repo with only a prepack script', t => {
t.test('create a repo with only a prepack script', () => {
const prepackRepo = resolve(me, 'prepack-repo')
const git = (...cmd) => spawnGit(cmd, { cwd: prepackRepo })
const write = (f, c) => fs.writeFileSync(`${prepackRepo}/${f}`, c)
Expand Down Expand Up @@ -608,7 +608,7 @@ t.test('fetch a weird ref', t => {
t.end()
})

t.test('fetch a private repo where the tgz is a 404', t => {
t.test('fetch a private repo where the tgz is a 404', () => {
const gf = new GitFetcher(`localhost:repo/x#${REPO_HEAD}`, opts)
gf.spec.hosted.tarball = () => `${hostedUrl}/not-found.tgz`
// should fetch it by falling back to ssh when it gets an http error
Expand Down

0 comments on commit 095786d

Please sign in to comment.