Skip to content

Commit

Permalink
Clean up arrow parens
Browse files Browse the repository at this point in the history
  • Loading branch information
rstacruz committed Jan 28, 2016
1 parent 0cfd2a2 commit 320d5ab
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
8 changes: 7 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
extends: ['standard']
extends: ['standard'],
rules: {
"arrow-parens": [2, "as-needed"],
"no-unused-vars": [2, {
"argsIgnorePattern": "_"
}]
}
}
4 changes: 2 additions & 2 deletions lib/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = function fetch (dir, tarball, shasum, log) {

stream
.on('response', start)
.on('data', (_) => { actualShasum.update(_) })
.on('data', _ => { actualShasum.update(_) })
.on('error', reject)
.pipe(gunzip()).on('error', reject)
.pipe(tar.extract(dir, { strip: 1 })).on('error', reject)
Expand All @@ -30,7 +30,7 @@ module.exports = function fetch (dir, tarball, shasum, log) {

if ('content-length' in res.headers) {
size = +res.headers['content-length']
res.on('data', (chunk) => {
res.on('data', chunk => {
downloaded += chunk.length
log('downloading', { done: downloaded, total: size })
})
Expand Down
6 changes: 3 additions & 3 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ module.exports = function install (ctx, pkg, modules, options) {
var tmp = join(ctx.tmp, getUuid()) // 'node_modules/.tmp/000-11...'

return fs.stat(join(modules, pkgSpec.name, 'package.json'))
.catch((err) => {
.catch(err => {
if (err.code !== 'ENOENT') throw err
return resolve(pkgSpec)
.then(set)
.then(_ => log('resolved', pkgData))
.then(_ => fs.stat(join(target, 'package.json'))) // todo: verify version?
.catch((err) => {
.catch(err => {
if (err.code !== 'ENOENT') throw err
if (isLocked(ctx, target)) return Promise.resolve()
return Promise.resolve()
Expand All @@ -78,7 +78,7 @@ module.exports = function install (ctx, pkg, modules, options) {
.then(_ => symlinkToModules(fullname, name, modules, depth))
})
.then(_ => log('done'))
.catch((err) => {
.catch(err => {
log('error', err)
throw err
})
Expand Down
2 changes: 1 addition & 1 deletion lib/install/link_bins.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = function linkBins (modules, target, fullname) {

var bins = binify(pkg)

return Object.keys(bins).map((bin) => {
return Object.keys(bins).map(bin => {
var actualBin = bins[bin]

return Promise.resolve()
Expand Down
2 changes: 1 addition & 1 deletion lib/install_multiple.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function arrayify (pkgs) {
if (typeof pkgs !== 'object') return [ pkgs ]
if (Array.isArray(pkgs)) return pkgs

return Object.keys(pkgs).map((name) => {
return Object.keys(pkgs).map(name => {
return '' + name + '@' + pkgs[name]
})
}

0 comments on commit 320d5ab

Please sign in to comment.