[eslint] remove exception for one-var, fix violations

This commit is contained in:
spalger
2017-06-14 19:10:40 -07:00
parent ccf333ad9f
commit d50eea6d6f
8 changed files with 28 additions and 10 deletions

View File

@ -2,7 +2,6 @@
extends: "@elastic/eslint-config-kibana"
rules:
one-var: warn
new-cap: warn
space-unary-ops: warn
dot-notation: warn

View File

@ -183,7 +183,9 @@ const castType = {
};
function resolveUrl(url, params) {
let vars = {}, i, key;
const vars = {};
let i;
let key;
if (url.req) {
// url has required params

View File

@ -65,7 +65,8 @@ HttpConnector.prototype.onStatusSet = _.handler(function (status) {
_.each(agent.sockets, collectSockets);
_.each(agent.freeSockets, collectSockets);
_.each(toRemove, function (args) {
let host = args[0], socket = args[1];
const host = args[0];
const socket = args[1];
agent.removeSocket(socket, parseUrl(host));
socket.destroy();
});

View File

@ -44,7 +44,8 @@ Json.prototype.deserialize = function (str) {
};
Json.prototype.bulkBody = function (val) {
let body = '', i;
let body = '';
let i;
if (_.isArray(val)) {
for (i = 0; i < val.length; i++) {

View File

@ -97,7 +97,10 @@ function adjustWordCase(firstWordCap, otherWordsCap, sep) {
let i = 0;
const words = [];
let word = '';
let code, c, upper, lower;
let code;
let c;
let upper;
let lower;
for (; i < string.length; i++) {
code = string.charCodeAt(i);

View File

@ -19,7 +19,11 @@ function listenerCount(emitter, event) {
describe('Connection Pool', function () {
describe('Adding/Removing/Syncing Connections', function () {
let pool, host, connection, host2, connection2;
let pool;
let host;
let connection;
let host2;
let connection2;
beforeEach(function () {
pool = new ConnectionPool({});
@ -93,7 +97,9 @@ describe('Connection Pool', function () {
});
describe('Connection selection', function () {
let pool, host, host2;
let pool;
let host;
let host2;
beforeEach(function () {
pool = new ConnectionPool({});
@ -211,7 +217,11 @@ describe('Connection Pool', function () {
});
describe('Connection state management', function () {
let pool, host, host2, connection, connection2;
let pool;
let host;
let host2;
let connection;
let connection2;
beforeEach(function () {
pool = new ConnectionPool({});

View File

@ -128,7 +128,8 @@ describe('Log class', function () {
});
describe('instance without one output listening to all events', function () {
let log, call;
let log;
let call;
beforeEach(function () {
call = void 0;
log = new Log({

View File

@ -817,7 +817,8 @@ describe('Transport Class', function () {
]);
sinon.assert.calledOnce(trans.connectionPool.setHosts);
let host, hosts = trans.connectionPool.setHosts.firstCall.args[0];
let host;
const hosts = trans.connectionPool.setHosts.firstCall.args[0];
expect(hosts).to.have.length(3);