ESlint comma-dangle

This commit is contained in:
Peter Jaszkowiak
2017-02-17 19:31:21 -07:00
parent aa64ec7db1
commit bc1d70c126
345 changed files with 1974 additions and 1978 deletions

View File

@@ -47,7 +47,7 @@ module.exports = function (SocketPosts) {
uid: socket.uid,
ip: socket.ip,
oldTitle: validator.escape(String(result.topic.oldTitle)),
newTitle: validator.escape(String(result.topic.title))
newTitle: validator.escape(String(result.topic.title)),
});
}
@@ -60,7 +60,7 @@ module.exports = function (SocketPosts) {
'administrators',
'Global Moderators',
'cid:' + result.topic.cid + ':privileges:mods',
'cid:' + result.topic.cid + ':privileges:groups:moderate'
'cid:' + result.topic.cid + ':privileges:groups:moderate',
], next);
},
function (results, next) {
@@ -69,7 +69,7 @@ module.exports = function (SocketPosts) {
websockets.in('uid_' + uid).emit('event:post_edited', editResult);
});
next(null, editResult.post);
}
},
], callback);
};
};

View File

@@ -48,7 +48,7 @@ module.exports = function (SocketPosts) {
},
userData: function (next) {
user.getUserFields(socket.uid, ['username', 'reputation', 'banned'], next);
}
},
}, next);
},
function (user, next) {
@@ -79,7 +79,7 @@ module.exports = function (SocketPosts) {
},
moderators: function (next) {
groups.getMembers('cid:' + post.topic.cid + ':privileges:mods', 0, -1, next);
}
},
}, next);
},
function (results, next) {
@@ -94,7 +94,7 @@ module.exports = function (SocketPosts) {
nid: 'post_flag:' + data.pid + ':uid:' + socket.uid,
from: socket.uid,
mergeId: 'notifications:user_flagged_post_in|' + data.pid,
topicTitle: post.topic.title
topicTitle: post.topic.title,
}, function (err, notification) {
if (err || !notification) {
return next(err);
@@ -103,7 +103,7 @@ module.exports = function (SocketPosts) {
plugins.fireHook('action:post.flag', {post: post, reason: data.reason, flaggingUser: flaggingUser});
notifications.push(notification, results.admins.concat(results.moderators).concat(results.globalMods), next);
});
}
},
], callback);
};
@@ -120,7 +120,7 @@ module.exports = function (SocketPosts) {
return next(new Error('[[no-privileges]]'));
}
posts.dismissFlag(pid, next);
}
},
], callback);
};
@@ -134,7 +134,7 @@ module.exports = function (SocketPosts) {
return next(new Error('[[no-privileges]]'));
}
posts.dismissAllFlags(next);
}
},
], callback);
};
@@ -149,7 +149,7 @@ module.exports = function (SocketPosts) {
function (next) {
async.parallel([
async.apply(user.isAdminOrGlobalMod, socket.uid),
async.apply(user.isModeratorOfAnyCategory, socket.uid)
async.apply(user.isModeratorOfAnyCategory, socket.uid),
], function (err, results) {
next(err, results[0] || results[1]);
});
@@ -166,7 +166,7 @@ module.exports = function (SocketPosts) {
}, payload);
posts.updateFlagData(socket.uid, data.pid, payload, next);
}
},
], callback);
};
};

View File

@@ -26,7 +26,7 @@ helpers.postCommand = function (socket, command, eventName, notification, data,
},
deleted: function (next) {
posts.getPostField(data.pid, 'deleted', next);
}
},
}, next);
},
function (results, next) {
@@ -50,7 +50,7 @@ helpers.postCommand = function (socket, command, eventName, notification, data,
},
function (filteredData, next) {
executeCommand(socket, command, eventName, notification, filteredData.data, next);
}
},
], callback);
};
@@ -71,6 +71,6 @@ function executeCommand(socket, command, eventName, notification, data, callback
socketHelpers.rescindUpvoteNotification(data.pid, socket.uid);
}
next(null, result);
}
},
], callback);
}

View File

@@ -30,7 +30,7 @@ module.exports = function (SocketPosts) {
function (next) {
socketHelpers.sendNotificationToPostOwner(data.pid, socket.uid, 'move', 'notifications:moved_your_post');
next();
}
},
], callback);
};

View File

@@ -41,7 +41,7 @@ module.exports = function (SocketPosts) {
},
postSharing: function (next) {
social.getActivePostSharing(next);
}
},
}, next);
},
function (results, next) {
@@ -54,7 +54,7 @@ module.exports = function (SocketPosts) {
results.posts.display_moderator_tools = results.posts.display_edit_tools || results.posts.display_delete_tools;
results.posts.display_move_tools = results.isAdminOrMod;
next(null, results);
}
},
], callback);
};
@@ -85,11 +85,11 @@ module.exports = function (SocketPosts) {
type: 'post-delete',
uid: socket.uid,
pid: data.pid,
ip: socket.ip
ip: socket.ip,
});
next();
}
},
], callback);
};
@@ -110,11 +110,11 @@ module.exports = function (SocketPosts) {
type: 'post-restore',
uid: socket.uid,
pid: data.pid,
ip: socket.ip
ip: socket.ip,
});
setImmediate(next);
}
},
], callback);
};
@@ -171,9 +171,9 @@ module.exports = function (SocketPosts) {
uid: socket.uid,
pid: data.pid,
ip: socket.ip,
title: validator.escape(String(title))
title: validator.escape(String(title)),
}, next);
}
},
], callback);
};
@@ -184,7 +184,7 @@ module.exports = function (SocketPosts) {
},
function (topic, next) {
socketTopics.doTopicAction('delete', 'event:topic_deleted', socket, {tids: [topic.tid], cid: topic.cid}, next);
}
},
], callback);
}
@@ -197,7 +197,7 @@ module.exports = function (SocketPosts) {
posts.getTopicFields(pid, ['postcount'], function (err, topic) {
next(err, topic ? parseInt(topic.postcount, 10) === 1 : false);
});
}
},
}, callback);
}

View File

@@ -30,7 +30,7 @@ module.exports = function (SocketPosts) {
},
downvoteUids: function (next) {
db.getSetMembers('pid:' + data.pid + ':downvote', next);
}
},
}, next);
},
function (results, next) {
@@ -46,9 +46,9 @@ module.exports = function (SocketPosts) {
},
downvoteCount: function (next) {
next(null, results.downvoteUids.length);
}
},
}, next);
}
},
], callback);
};
@@ -71,7 +71,7 @@ module.exports = function (SocketPosts) {
user.getUsernamesByUids(uids, function (err, usernames) {
next(err, {
otherCount: otherCount,
usernames: usernames
usernames: usernames,
});
});
}, callback);