use eslint autofix to start fixing violations

This commit is contained in:
spalger
2017-06-14 18:48:24 -07:00
parent da8e558817
commit 3d75c6ff0f
97 changed files with 1281 additions and 1280 deletions

View File

@ -1,10 +1,10 @@
var clock = require('sinon').useFakeTimers();
var Client = require('../../src/elasticsearch').Client;
var _ = require('lodash');
var times = require('async').times;
const clock = require('sinon').useFakeTimers();
const Client = require('../../src/elasticsearch').Client;
const _ = require('lodash');
const times = require('async').times;
process.once('message', function (port) {
var es = new Client({
const es = new Client({
host: 'http://127.0.0.1:' + port,
log: false
});
@ -19,8 +19,8 @@ process.once('message', function (port) {
}, done);
clock.tick(10);
}, function (err) {
var conns = es.transport.connectionPool._conns;
var sockets = _([].concat(conns.dead, conns.alive))
const conns = es.transport.connectionPool._conns;
const sockets = _([].concat(conns.dead, conns.alive))
.transform(function (sockets, conn) {
sockets.push(_.values(conn.agent.sockets), _.values(conn.agent.freeSockets));
}, [])
@ -29,7 +29,7 @@ process.once('message', function (port) {
es.close();
var out = {
const out = {
socketCount: err || sockets.length,
remaining: _.filter(sockets, { destroyed: true }).length - sockets.length,
timeouts: _.size(clock.timers) && _.map(clock.timers, 'func').map(String)

View File

@ -4,13 +4,13 @@
// which prevent sinon from being able to ensure
// timeouts aren't being left behind
var express = require('express');
var app = express().post('/_search', function (req, res) {
const express = require('express');
const app = express().post('/_search', function (req, res) {
res.json(200, { hits: { hits: [] } });
});
var server = require('http').createServer(app);
const server = require('http').createServer(app);
server.listen(function () {
var port = server.address().port;
const port = server.address().port;
process.connected ? process.send(port) : console.log(port);
});