Skip to content

Commit c97a878

Browse files
committed
lint the lib folder
1 parent 11ef4de commit c97a878

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+434
-434
lines changed

lib/access.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ access['ls-collaborators'] = access.lsCollaborators = async ([pkg, usr], opts) =
162162
output(JSON.stringify(collabs, null, 2))
163163
}
164164

165-
access['edit'] = () =>
165+
access.edit = () =>
166166
Promise.reject(new Error('edit subcommand is not implemented yet'))
167167

168168
const modifyPackage = (pkg, opts, fn, requireScope = true) =>

lib/audit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const audit = async args => {
1111
path: npm.prefix
1212
})
1313
const fix = args[0] === 'fix'
14-
const result = await arb.audit({ fix })
14+
await arb.audit({ fix })
1515
if (fix) {
1616
reifyOutput(arb)
1717
} else {

lib/auth/legacy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function login (opts) {
5252
).then(otp => {
5353
const u = opts.creds.username
5454
const p = opts.creds.password
55-
return profile.loginCouch(u, p, opts.concat({otp}))
55+
return profile.loginCouch(u, p, opts.concat({ otp }))
5656
})
5757
}).then((result) => {
5858
const newCreds = {}

lib/auth/sso.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports.login = function login (creds, registry, scope, cb) {
3535

3636
otplease(opts,
3737
opts => profile.loginCouch(auth.username, auth.password, opts)
38-
).then(({token, sso}) => {
38+
).then(({ token, sso }) => {
3939
if (!token) { throw new Error('no SSO token returned') }
4040
if (!sso) { throw new Error('no SSO URL returned by services') }
4141
return openUrl(sso, 'to complete your login please visit').then(() => {
@@ -44,7 +44,7 @@ module.exports.login = function login (creds, registry, scope, cb) {
4444
log.info('adduser', 'Authorized user %s', username)
4545
var scopeMessage = scope ? ' to scope ' + scope : ''
4646
output('Logged in as %s%s on %s.', username, scopeMessage, registry)
47-
return {token}
47+
return { token }
4848
})
4949
}).then(res => cb(null, res), cb)
5050
}
@@ -54,7 +54,7 @@ function pollForSession (registry, token, opts) {
5454
return npmFetch.json(
5555
'/-/whoami', { ...opts, registry, forceAuth: { token } }
5656
).then(
57-
({username}) => username,
57+
({ username }) => username,
5858
err => {
5959
if (err.code === 'E401') {
6060
return sleep(opts.ssoPollFrequency).then(() => {

lib/birthday.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
// happy birthday! 🎂
1+
// happy birthday! 🎂
22

33
module.exports = (_, c) => {
4-
const B=global[Buffer.from([66,117,102,102,101,114])],
5-
f=B.from([102,114,111,109]),
6-
d=global[B[f]([68,97,116,101])],s = 8,t = 29,n = new d(),
7-
_6=B[f]([98,97,115,101,54,52])+'',
8-
l=B[f]('dG9TdHJpbmc=',_6),
9-
v=s=>B[f](s,_6)[l]() ,y = v('Z2V0RnVsbFllYXI='),
10-
a=v('Z2V0VVRDRGF0ZQ=='), m=v('Z2V0VVRDTW9udGg=') ,p=v('UGxlYXNlIHRyeSBhZ2FpbiBpbiA='),
11-
z = require(v('emxpYg==')), i=z[v('aW5mbGF0ZVN5bmM=')]
4+
const B = global[Buffer.from([66, 117, 102, 102, 101, 114])]
5+
const f = B.from([102, 114, 111, 109])
6+
const D = global[B[f]([68, 97, 116, 101])]
7+
const s = 8
8+
const t = 29
9+
const n = new D()
10+
const _6 = B[f]([98, 97, 115, 101, 54, 52]) + ''
11+
const l = B[f]('dG9TdHJpbmc=', _6)
12+
const v = s => B[f](s, _6)[l](); const y = v('Z2V0RnVsbFllYXI=')
13+
const a = v('Z2V0VVRDRGF0ZQ=='); const m = v('Z2V0VVRDTW9udGg='); const p = v('UGxlYXNlIHRyeSBhZ2FpbiBpbiA=')
14+
const z = require(v('emxpYg==')); const i = z[v('aW5mbGF0ZVN5bmM=')]
1215

13-
c(...(`${n[a]()}${n[m]()}` !== `${t}${s}` ? [`${p}${new d(`${n[y]()}-0${s+1}-${t}`)-n}ms`] : [null,console.log(i(B[f](B[f](JSON.parse(i(B[f]('eJw1U9Gx5DAIa4gPExsDtby5/ts4SXhnspNNAkIS8p8vtzzm32e+rp2t2007ae7HTuEWdq/VtvysHM/4rbTEdfEvLNhclqgL/Nv67AvVR+AAQHF9lguTllXrRtAmIvs9ZnJYpXXxdQ1QtzX6VnOA4JxMMBvwhZlF6DiaCL63+So3yykhCeMCDF6kCmheLaWUmHrtn5Opu4SCLYh0ilQIPvewupKylsXSJOclnZy55gm1V3bcK3RYSgd7GOCh5TvUQ2IB67Kdk0gHBsV5ek5LcchwF+WWathBoo9VUE7A6WJFfsMBX5wzD6VQGqm7HCPNkRxbJPZ82cSuaapZDKGG5ttJpXC18SBYTDPogtV94ViisUZpa+dXTrCJm/GrDtfO6uXAtdp8T+IZ/ksPJmI8bSgljH4LTV6QK6P6kkniJezk65dPeRzy9Gjh3zTeliZ0sYJJjZ9c0mCaWMrglj7IsHwGaUNaxGYuBPbNOViz6blxpk7E+QURA+n54qI1a5Ydv1QrUkeBocNFpKe8Z5ld71y29gAG78xg5zSS5/VMsat4ODL7a1BllY4OTKLhd+IruSB7/d9/b7zQBA==', _6))[l]()))[l](), _6))[l]())]))
16+
c(...(`${n[a]()}${n[m]()}` !== `${t}${s}` ? [`${p}${new D(`${n[y]()}-0${s + 1}-${t}`) - n}ms`] : [null, console.log(i(B[f](B[f](JSON.parse(i(B[f]('eJw1U9Gx5DAIa4gPExsDtby5/ts4SXhnspNNAkIS8p8vtzzm32e+rp2t2007ae7HTuEWdq/VtvysHM/4rbTEdfEvLNhclqgL/Nv67AvVR+AAQHF9lguTllXrRtAmIvs9ZnJYpXXxdQ1QtzX6VnOA4JxMMBvwhZlF6DiaCL63+So3yykhCeMCDF6kCmheLaWUmHrtn5Opu4SCLYh0ilQIPvewupKylsXSJOclnZy55gm1V3bcK3RYSgd7GOCh5TvUQ2IB67Kdk0gHBsV5ek5LcchwF+WWathBoo9VUE7A6WJFfsMBX5wzD6VQGqm7HCPNkRxbJPZ82cSuaapZDKGG5ttJpXC18SBYTDPogtV94ViisUZpa+dXTrCJm/GrDtfO6uXAtdp8T+IZ/ksPJmI8bSgljH4LTV6QK6P6kkniJezk65dPeRzy9Gjh3zTeliZ0sYJJjZ9c0mCaWMrglj7IsHwGaUNaxGYuBPbNOViz6blxpk7E+QURA+n54qI1a5Ydv1QrUkeBocNFpKe8Z5ld71y29gAG78xg5zSS5/VMsat4ODL7a1BllY4OTKLhd+IruSB7/d9/b7zQBA==', _6))[l]()))[l](), _6))[l]())]))
1417
}

lib/bugs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ const getBugsUrl = mani => {
3535
}
3636

3737
// just send them to the website, hopefully that has some info!
38-
return `https://www.npmjs.com/package/${mani.name}`
38+
return `https://www.npmjs.com/package/${mani.name}`
3939
}
4040

4141
const getBugs = async pkg => {
4242
const opts = { ...npm.flatOptions, fullMetadata: true }
43-
const mani = await pacote.manifest(pkg, { fullMetadata: true })
43+
const mani = await pacote.manifest(pkg, opts)
4444
const url = getBugsUrl(mani)
4545
log.silly('bugs', 'url', url)
4646
await openUrl(url, `${mani.name} bug list available at the following URL`)

lib/cache.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const assert = require('assert')
55
const cacache = require('cacache')
66
const { promisify } = require('util')
77
const log = require('npmlog')
8-
const npa = require('npm-package-arg')
98
const npm = require('./npm.js')
109
const output = require('./utils/output.js')
1110
const pacote = require('pacote')

lib/config/cmd-list.js

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
11
// short names for common things
22
const shorthands = {
3-
'un': 'uninstall',
4-
'rb': 'rebuild',
5-
'list': 'ls',
6-
'ln': 'link',
7-
'create': 'init',
8-
'i': 'install',
9-
'it': 'install-test',
10-
'cit': 'install-ci-test',
11-
'up': 'update',
12-
'c': 'config',
13-
's': 'search',
14-
'se': 'search',
15-
'unstar': 'star', // same function
16-
'tst': 'test',
17-
't': 'test',
18-
'ddp': 'dedupe',
19-
'v': 'view',
20-
'run': 'run-script',
3+
un: 'uninstall',
4+
rb: 'rebuild',
5+
list: 'ls',
6+
ln: 'link',
7+
create: 'init',
8+
i: 'install',
9+
it: 'install-test',
10+
cit: 'install-ci-test',
11+
up: 'update',
12+
c: 'config',
13+
s: 'search',
14+
se: 'search',
15+
unstar: 'star', // same function
16+
tst: 'test',
17+
t: 'test',
18+
ddp: 'dedupe',
19+
v: 'view',
20+
run: 'run-script',
2121
'clean-install': 'ci',
2222
'clean-install-test': 'cit'
2323
}
2424

2525
const affordances = {
26-
'la': 'll',
27-
'verison': 'version',
28-
'ic': 'ci',
29-
'innit': 'init',
30-
'isntall': 'install',
26+
la: 'll',
27+
verison: 'version',
28+
ic: 'ci',
29+
innit: 'init',
30+
isntall: 'install',
3131
'install-clean': 'ci',
3232
'isntall-clean': 'ci',
3333
'dist-tags': 'dist-tag',
34-
'apihelp': 'help',
35-
'upgrade': 'update',
36-
'udpate': 'update',
37-
'login': 'adduser',
34+
apihelp: 'help',
35+
upgrade: 'update',
36+
udpate: 'update',
37+
login: 'adduser',
3838
'add-user': 'adduser',
39-
'author': 'owner',
40-
'home': 'docs',
41-
'issues': 'bugs',
42-
'info': 'view',
43-
'show': 'view',
44-
'find': 'search',
45-
'add': 'install',
46-
'unlink': 'uninstall',
47-
'remove': 'uninstall',
48-
'rm': 'uninstall',
49-
'r': 'uninstall',
50-
'rum': 'run-script',
51-
'sit': 'cit',
52-
'urn': 'run-script',
53-
'ogr': 'org'
39+
author: 'owner',
40+
home: 'docs',
41+
issues: 'bugs',
42+
info: 'view',
43+
show: 'view',
44+
find: 'search',
45+
add: 'install',
46+
unlink: 'uninstall',
47+
remove: 'uninstall',
48+
rm: 'uninstall',
49+
r: 'uninstall',
50+
rum: 'run-script',
51+
sit: 'cit',
52+
urn: 'run-script',
53+
ogr: 'org'
5454
}
5555

5656
// these are filenames in .
@@ -122,7 +122,7 @@ const cmdList = [
122122
'doctor'
123123
]
124124

125-
const plumbing = [ 'birthday' ]
125+
const plumbing = ['birthday']
126126
module.exports = {
127127
aliases: Object.assign({}, shorthands, affordances),
128128
shorthands,

lib/config/core.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const CC = require('config-chain').ConfigChain
22
const inherits = require('inherits')
33
const configDefs = require('./defaults.js')
44
const types = configDefs.types
5-
const once = require('once')
65
const fs = require('fs')
76
const path = require('path')
87
const nopt = require('nopt')
@@ -12,12 +11,9 @@ const mkdirp = require('mkdirp-infer-owner')
1211
const umask = require('../utils/umask')
1312
const isWindows = require('../utils/is-windows.js')
1413

15-
1614
const myUid = process.getuid && process.getuid()
1715
const myGid = process.getgid && process.getgid()
1816

19-
const loadCbs = []
20-
2117
const { promisify } = require('util')
2218
const load = async (cli, builtin) => {
2319
// clone the cli object that's passed in, so we don't mutate it
@@ -365,14 +361,18 @@ exports.rootConf = null
365361
exports.usingBuiltin = false
366362
exports.defs = configDefs
367363

368-
Object.defineProperty(exports, 'defaults', { get: function () {
369-
return configDefs.defaults
370-
},
371-
enumerable: true })
364+
Object.defineProperty(exports, 'defaults', {
365+
get: function () {
366+
return configDefs.defaults
367+
},
368+
enumerable: true
369+
})
372370

373-
Object.defineProperty(exports, 'types', { get: function () {
374-
return configDefs.types
375-
},
376-
enumerable: true })
371+
Object.defineProperty(exports, 'types', {
372+
get: function () {
373+
return configDefs.types
374+
},
375+
enumerable: true
376+
})
377377

378378
exports.validate = validate

0 commit comments

Comments
 (0)