1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00

Replace jshint with eslint and add lots of rules

Fix eslint errors accordingly
This commit is contained in:
Ruben Bridgewater
2016-03-26 04:05:43 +01:00
parent 12579e5e8e
commit 94e9f1fcfc
98 changed files with 1621 additions and 1551 deletions

View File

@@ -2,7 +2,7 @@
// This Command constructor is ever so slightly faster than using an object literal, but more importantly, using
// a named constructor helps it show up meaningfully in the V8 CPU profiler and in heap snapshots.
function Command(command, args, callback) {
function Command (command, args, callback) {
this.command = command;
this.args = args; // We only need the args for the offline commands => move them into another class. We need the number of args though for pub sub
this.buffer_args = false;
@@ -10,7 +10,7 @@ function Command(command, args, callback) {
this.sub_commands_left = args.length;
}
function OfflineCommand(command, args, callback) {
function OfflineCommand (command, args, callback) {
this.command = command;
this.args = args;
this.callback = callback;

View File

@@ -3,7 +3,7 @@
var Queue = require('double-ended-queue');
var utils = require('./utils');
function Multi(client, args) {
function Multi (client, args) {
this._client = client;
this.queue = new Queue();
var command, tmp_args;
@@ -147,7 +147,7 @@ Multi.prototype.exec_transaction = function exec_transaction (callback) {
pipeline_transaction_command(self, command, args[1], index, cb);
}
self._client.send_command('exec', [], function(err, replies) {
self._client.send_command('exec', [], function (err, replies) {
multi_callback(self, err, replies);
});
self._client.uncork();
@@ -173,7 +173,6 @@ Multi.prototype.exec = Multi.prototype.EXEC = Multi.prototype.exec_batch = funct
var len = self.queue.length;
var index = 0;
var args;
var args_len = 1;
var callback_without_own_cb = function (err, res) {
if (err) {
self.results.push(err);
@@ -203,7 +202,6 @@ Multi.prototype.exec = Multi.prototype.EXEC = Multi.prototype.exec_batch = funct
while (args = self.queue.shift()) {
var command = args[0];
var cb;
args_len = args[1].length - 1;
if (typeof args[2] === 'function') {
cb = batch_callback(self, args[2], index);
} else {

View File

@@ -2,7 +2,7 @@
// hgetall converts its replies to an Object. If the reply is empty, null is returned.
// These function are only called with internal data and have therefor always the same instanceof X
function replyToObject(reply) {
function replyToObject (reply) {
// The reply might be a string or a buffer if this is called in a transaction (multi)
if (reply.length === 0 || !(reply instanceof Array)) {
return null;
@@ -14,7 +14,7 @@ function replyToObject(reply) {
return obj;
}
function replyToStrings(reply) {
function replyToStrings (reply) {
if (reply instanceof Buffer) {
return reply.toString();
}