mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
ESlint radix
This commit is contained in:
@@ -70,7 +70,7 @@
|
||||
"one-var-declaration-per-line": "off",
|
||||
"new-cap": "off",
|
||||
"no-lonely-if": "off",
|
||||
"radix": "off",
|
||||
// "radix": "off",
|
||||
// "no-else-return": "off",
|
||||
// "no-useless-escape": "off",
|
||||
// "block-scoped-var": "off",
|
||||
|
||||
@@ -111,7 +111,7 @@ define('forum/chats/messages', ['components', 'sounds', 'translator'], function
|
||||
messages.onChatMessageEdit = function () {
|
||||
socket.on('event:chats.edit', function (data) {
|
||||
data.messages.forEach(function (message) {
|
||||
var self = parseInt(message.fromuid, 10) === parseInt(app.user.uid);
|
||||
var self = parseInt(message.fromuid, 10) === parseInt(app.user.uid, 10);
|
||||
message.self = self ? 1 : 0;
|
||||
messages.parseMessage(message, function (html) {
|
||||
var body = components.get('chat/message', message.messageId);
|
||||
|
||||
@@ -130,7 +130,7 @@ module.exports = function (Categories) {
|
||||
results.teasers.forEach(function (teaser, index) {
|
||||
if (teaser) {
|
||||
teaser.cid = topicData[index].cid;
|
||||
teaser.parentCid = parseInt(parentCids[teaser.cid]) || 0;
|
||||
teaser.parentCid = parseInt(parentCids[teaser.cid], 10) || 0;
|
||||
teaser.tid = teaser.uid = teaser.user.uid = undefined;
|
||||
teaser.topic = {
|
||||
slug: topicData[index].slug,
|
||||
|
||||
@@ -25,7 +25,7 @@ editController.get = function (req, res, callback) {
|
||||
userData.maximumSignatureLength = parseInt(meta.config.maximumSignatureLength, 10) || 255;
|
||||
userData.maximumAboutMeLength = parseInt(meta.config.maximumAboutMeLength, 10) || 1000;
|
||||
userData.maximumProfileImageSize = parseInt(meta.config.maximumProfileImageSize, 10);
|
||||
userData.allowProfileImageUploads = parseInt(meta.config.allowProfileImageUploads) === 1;
|
||||
userData.allowProfileImageUploads = parseInt(meta.config.allowProfileImageUploads, 10) === 1;
|
||||
userData.allowAccountDelete = parseInt(meta.config.allowAccountDelete, 10) === 1;
|
||||
|
||||
userData.groups = userData.groups.filter(function (group) {
|
||||
|
||||
@@ -406,7 +406,7 @@ var utils = require('../public/src/utils');
|
||||
group.hidden = parseInt(group.hidden, 10) === 1;
|
||||
group.system = parseInt(group.system, 10) === 1;
|
||||
group.private = (group.private === null || group.private === undefined) ? true : !!parseInt(group.private, 10);
|
||||
group.disableJoinRequests = parseInt(group.disableJoinRequests) === 1;
|
||||
group.disableJoinRequests = parseInt(group.disableJoinRequests, 10) === 1;
|
||||
|
||||
group['cover:url'] = group['cover:url'] || require('./coverPhoto').getDefaultGroupCover(group.name);
|
||||
group['cover:thumb:url'] = group['cover:thumb:url'] || group['cover:url'];
|
||||
|
||||
@@ -218,7 +218,7 @@ Messaging.getTeaser = function (uid, roomId, callback) {
|
||||
};
|
||||
|
||||
Messaging.canMessageUser = function (uid, toUid, callback) {
|
||||
if (parseInt(meta.config.disableChat) === 1 || !uid || uid === toUid) {
|
||||
if (parseInt(meta.config.disableChat, 10) === 1 || !uid || uid === toUid) {
|
||||
return callback(new Error('[[error:chat-disabled]]'));
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ Messaging.canMessageUser = function (uid, toUid, callback) {
|
||||
};
|
||||
|
||||
Messaging.canMessageRoom = function (uid, roomId, callback) {
|
||||
if (parseInt(meta.config.disableChat) === 1 || !uid) {
|
||||
if (parseInt(meta.config.disableChat, 10) === 1 || !uid) {
|
||||
return callback(new Error('[[error:chat-disabled]]'));
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ module.exports = function (Messaging) {
|
||||
message: messageObj,
|
||||
};
|
||||
uids.forEach(function (uid) {
|
||||
data.self = parseInt(uid, 10) === parseInt(fromUid) ? 1 : 0;
|
||||
data.self = parseInt(uid, 10) === parseInt(fromUid, 10) ? 1 : 0;
|
||||
Messaging.pushUnreadCount(uid);
|
||||
sockets.in('uid_' + uid).emit('event:chats.receive', data);
|
||||
});
|
||||
|
||||
@@ -153,7 +153,7 @@ module.exports = function (Posts) {
|
||||
return callback(new Error('self-vote'));
|
||||
}
|
||||
|
||||
if (command === 'downvote' && parseInt(results.reputation) < parseInt(meta.config['privileges:downvote'], 10)) {
|
||||
if (command === 'downvote' && parseInt(results.reputation, 10) < parseInt(meta.config['privileges:downvote'], 10)) {
|
||||
return callback(new Error('[[error:not-enough-reputation-to-downvote]]'));
|
||||
}
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@ function filterByPostcount(posts, postCount, repliesFilter) {
|
||||
}
|
||||
|
||||
function filterByTimerange(posts, timeRange, timeFilter) {
|
||||
timeRange = parseInt(timeRange) * 1000;
|
||||
timeRange = parseInt(timeRange, 10) * 1000;
|
||||
if (timeRange) {
|
||||
var time = Date.now() - timeRange;
|
||||
if (timeFilter === 'newer') {
|
||||
|
||||
@@ -50,7 +50,7 @@ module.exports = function (SocketPosts) {
|
||||
});
|
||||
}
|
||||
|
||||
if (parseInt(result.post.deleted) !== 1) {
|
||||
if (parseInt(result.post.deleted, 10) !== 1) {
|
||||
websockets.in('topic_' + result.topic.tid).emit('event:post_edited', result);
|
||||
return callback(null, result.post);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ module.exports = function (User) {
|
||||
var keepAllVersions = parseInt(meta.config['profile:keepAllUserImages'], 10) === 1;
|
||||
var uploadedImage;
|
||||
|
||||
if (parseInt(meta.config.allowProfileImageUploads) !== 1) {
|
||||
if (parseInt(meta.config.allowProfileImageUploads, 10) !== 1) {
|
||||
return callback(new Error('[[error:profile-image-uploads-disabled]]'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user