Skip to content
Permalink
Browse files

Update to eslint-config-godaddy (#14)

  • Loading branch information...
thumbsupep authored and indexzero committed Aug 15, 2017
1 parent cfd4c01 commit 14e161927e8fa3df4ec363c823608a02eb9ed961
@@ -1,6 +1,7 @@
{
"extends": "./node_modules/godaddy-style/dist/.eslintrc",
"extends": "godaddy",
"rules": {
"strict": 0
"strict": 0,
"no-shadow": 0
}
}
@@ -2,10 +2,10 @@
/* eslint no-process-env: 0 */

var util = require('util'),
url = require('url'),
errs = require('errs'),
httpProxy = require('http-proxy'),
slay = require('slay');
url = require('url'),
errs = require('errs'),
httpProxy = require('http-proxy'),
slay = require('slay');

/**
* @constructor App
@@ -18,7 +18,7 @@ var Classifier = module.exports = function Classifier(opts) {
});

return acc;
}, {})
}, {});
};

/**
@@ -49,8 +49,8 @@ Classifier.prototype.getProject = function (data, options) {
// Allow additional rules to be defined and merge against the default.
//
var classy = merge(this.classification, options.classification),
keyword = options.keyword || 'check',
match = '';
keyword = options.keyword || 'check',
match = '';

//
// The classification can also be read directly from the data.
@@ -39,7 +39,7 @@ function LoadingBay(options) {
// This could be more generic but we make certain assumptions here in general
// so meh for now
//
this.conditions = { conditions: { partitioner: 'cached' } };
this.conditions = { conditions: { partitioner: 'cached' }};
this.ttl = options.ttl || 3E5; // 5 minutes
this.expired = options.expired || '__package_cache__';
//
@@ -7,7 +7,7 @@
// it to all logs attached to the request/response
// and dump the final headers/content

var DEBUG_PATTERN = /^(?:|[\*])$/;
var DEBUG_PATTERN = /^\*?$/;

function bufferStringOrValue(value) {
if (Buffer.isBuffer(value)) {
@@ -1,9 +1,9 @@
'use strict';

var cookieParser = require('cookie-parser'),
bodyParser = require('body-parser'),
cors = require('access-control'),
debugParam = require('./debug');
bodyParser = require('body-parser'),
cors = require('access-control'),
debugParam = require('./debug');

var healthcheck = /healthcheck/;
var rid = 0;
@@ -1,9 +1,9 @@
/*eslint no-unused-vars: 0*/
/*eslint no-bitwise: 0*/
/* eslint no-unused-vars: 0*/
/* eslint no-bitwise: 0*/
'use strict';

var errs = require('errs'),
semver = require('semver');
semver = require('semver');

//
// TODO: this should be in configuration or constants
@@ -1,7 +1,7 @@
'use strict';

var Publisher = require('./publisher'),
Tagger = require('./tagger');
Tagger = require('./tagger');

module.exports = function (app, options, done) {
//
@@ -2,20 +2,20 @@
'use strict';

var PublishSplitStream = require('npm-publish-split-stream'),
EventEmitter = require('events').EventEmitter,
VerifyStream = require('npm-verify-stream'),
fork = require('child_process').fork,
Gjallarhorn = require('gjallarhorn'),
Classifier = require('../classifier'),
concat = require('concat-stream'),
params = require('./params'),
ndjson = require('ndjson'),
async = require('async'),
path = require('path'),
util = require('util'),
once = require('once'),
errs = require('errs'),
url = require('url');
EventEmitter = require('events').EventEmitter,
VerifyStream = require('npm-verify-stream'),
fork = require('child_process').fork,
Gjallarhorn = require('gjallarhorn'),
Classifier = require('../classifier'),
concat = require('concat-stream'),
params = require('./params'),
ndjson = require('ndjson'),
async = require('async'),
path = require('path'),
util = require('util'),
once = require('once'),
errs = require('errs'),
url = require('url');

var checkmate = require.resolve(path.resolve(__dirname, '..', 'checkmate'));

@@ -43,7 +43,7 @@ module.exports = function (app) {
});
})
.put(auth, function putDistTagNPMPackageRoute(req, res, next) {
/*eslint no-unused-vars: 0*/
/* eslint no-unused-vars: 0*/

//
// Remark: as of npm@2.13.5 this is not consumed anywhere, but it is
@@ -54,7 +54,7 @@ module.exports = function (app) {
res.status(400).json({ message: 'Not implemented' });
})
.post(auth, function postDistTagNPMPackageRoute(req, res, next) {
/*eslint no-unused-vars: 0*/
/* eslint no-unused-vars: 0*/

//
// Remark: as of npm@2.13.5 this is not consumed anywhere, but it is
@@ -247,7 +247,7 @@ module.exports = function (app) {
// details. In the case of any build errors remove the dist-tag.
// Add tag as environment to package and trigger build.
//
pack.env = spec.env
pack.env = spec.env;
log.info('No previous build for %s, carpenter trigger', version, spec);
app.carpenter.build({ data: pack }, function response(err, buildLog) {
if (err) { return done(err); }
@@ -27,7 +27,7 @@ var Tagger = module.exports = function Tagger(opts) {
*/
Tagger.prototype.delete = function (opts, callback) {
var pkg = opts.pkg,
tag = opts.tag;
tag = opts.tag;

var update = {
name: pkg,
@@ -59,9 +59,9 @@ Tagger.prototype.delete = function (opts, callback) {
*/
Tagger.prototype.add = function (opts, callback) {
var pkg = opts.pkg,
tag = opts.tag,
version = opts.version,
Package = this.Package;
tag = opts.tag,
version = opts.version,
Package = this.Package;

//
// Create update body for cassandra
@@ -38,10 +38,11 @@ module.exports = function (app, options, done) {
authenticator(req, res, authError => {
// function to send back responses that npm client understands
if (!authError) return void next(null);
// eslint-disable-next-line new-cap
NPMStrategyErrorHandler(authError, req, res, next);
});
});
}
};


done();
@@ -1,11 +1,11 @@
/*eslint no-bitwise: 0*/
/* eslint no-bitwise: 0*/
'use strict';

var comment = require('commenting'),
zipline = require('zipline'),
hyperquest = require('hyperquest'),
mime = require('mime'),
path = require('path');
zipline = require('zipline'),
hyperquest = require('hyperquest'),
mime = require('mime'),
path = require('path');

//
// As our intention is to primary serve JS builds, this should be our default
@@ -23,10 +23,10 @@ module.exports = function (app) {
*/
app.routes.get('/assets/:hash', function (req, res) {
var extension = path.extname(req.params.hash),
gzip = !!~zipline.accepts(req).indexOf('gzip'),
fingerprint = extension
? req.params.hash.slice(0, -(extension.length))
: req.params.hash;
gzip = !!~zipline.accepts(req).indexOf('gzip'),
fingerprint = extension
? req.params.hash.slice(0, -(extension.length))
: req.params.hash;

res.setHeader('Content-Type', mime.lookup(req.params.hash));
res.statusCode = 200;
@@ -76,7 +76,7 @@ module.exports = function (app) {
.get(function (req, res, next) {
// TODO: fetch the latest build from artifactory or CDN
// Investigate how this interacts with the CDN.
/*eslint no-unused-vars: 0*/
/* eslint no-unused-vars: 0*/
next();
})

@@ -210,5 +210,5 @@ module.exports = function (app) {
function iso639(locale) {
const parts = locale.split('-');
if (parts[0] === locale) return null;
else { return parts[0]; }
return parts[0];
}
@@ -1,4 +1,4 @@
/*eslint no-unused-vars: 0*/
/* eslint no-unused-vars: 0*/
'use strict';

module.exports = function (app) {
@@ -1,8 +1,8 @@
/*eslint no-bitwise: 0*/
/* eslint no-bitwise: 0*/
'use strict';

var path = require('path'),
errs = require('errs');
errs = require('errs');

//
// TODO: this should be in configuration or constants
@@ -9,12 +9,10 @@
"scripts": {
"start": "./bin/server",
"cover": "istanbul cover ./node_modules/.bin/_mocha test/",
"pretest": "npm run lint",
"pretest": "npm run eslint",
"test": "npm run cover && npm run report",
"report": "istanbul report cobertura",
"eslint": "godaddy-js-style-eslint -c .eslintrc lib/ test/",
"jscs": "godaddy-js-style-jscs lib/ test/",
"lint": "npm run jscs && npm run eslint",
"eslint": "eslint-godaddy -c .eslintrc lib/ test/",
"sandbox": "npm-registry-echo"
},
"repository": {
@@ -76,11 +74,11 @@
"babel-eslint": "^6.1.2",
"datastar-test-tools": "~1.0.0",
"diagnostics": "~1.1.0",
"eslint": "~3.19.0",
"eslint": "^4.4.1",
"eslint-config-godaddy-react": "^2.0.0",
"eslint-plugin-json": "^1.2.0",
"eslint-plugin-mocha": "^2.0.0",
"eslint-plugin-react": "^4.1.0",
"godaddy-style": "~3.2.1",
"eslint-plugin-mocha": "^4.11.0",
"eslint-plugin-react": "^7.1.0",
"hock": "^1.2.0",
"istanbul": "^0.3.17",
"mocha": "^2.2.5",
@@ -27,5 +27,5 @@ exports.createPassportNPMOptions = () => {
err.status = 403;
return void done(err);
}
}
}
};
};
@@ -1,11 +1,11 @@
'use strict';

var fs = require('fs'),
path = require('path'),
async = require('async'),
etag = require('etag'),
extend = require('extend'),
registry = require('../lib');
path = require('path'),
async = require('async'),
etag = require('etag'),
extend = require('extend'),
registry = require('../lib');

/**
* @property {defaultStart} Object
@@ -23,7 +23,7 @@ var defaultAppOpts = {
npm: {
urls: {
write: {
default: 'http://localhost:8091',
'default': 'http://localhost:8091',
'@good': 'http://localhost:8091'
}
}
@@ -1,11 +1,11 @@
'use strict';

var assume = require('assume'),
url = require('url'),
path = require('path'),
hyperquest = require('hyperquest'),
concat = require('concat-stream'),
registry = require('../../lib');
url = require('url'),
path = require('path'),
hyperquest = require('hyperquest'),
concat = require('concat-stream'),
registry = require('../../lib');

function address(app, properties) {
const socket = app.servers.http.address();
@@ -1,12 +1,12 @@
'use strict';

var path = require('path'),
macros = require('../../macros'),
helpers = require('../../helpers'),
assume = require('assume');
macros = require('../../macros'),
helpers = require('../../helpers'),
assume = require('assume');

const npmrc = name => {
return path.join(__dirname, '..', '..', 'fixtures', 'npm-auth', `${name}.npmrc`)
return path.join(__dirname, '..', '..', 'fixtures', 'npm-auth', `${name}.npmrc`);
};

describe('npm auth', function () {
@@ -34,7 +34,7 @@ describe('npm auth', function () {
});
afterEach(() => {
teardowns.forEach(fn => fn());
})
});
it('handles basic auth', function (done) {
macros.testNPM(context.registry, {
teardown,
@@ -1,14 +1,14 @@
'use strict';

var async = require('async'),
assume = require('assume'),
request = require('request'),
mocks = require('../../mocks'),
helpers = require('../../helpers');
assume = require('assume'),
request = require('request'),
mocks = require('../../mocks'),
helpers = require('../../helpers');

describe('npm routes', function () {
var app,
registry;
registry;

before(function (done) {
helpers.integrationSetup({
Oops, something went wrong.

0 comments on commit 14e1619

Please sign in to comment.
You can’t perform that action at this time.