mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 20:45:58 +01:00
ESlint key-spacing, no-trailing-spaces
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
"no-empty": ["error", { "allowEmptyCatch": true }],
|
"no-empty": ["error", { "allowEmptyCatch": true }],
|
||||||
"prefer-rest-params": "off",
|
"prefer-rest-params": "off",
|
||||||
"prefer-spread": "off",
|
"prefer-spread": "off",
|
||||||
|
"no-underscore-dangle": "off",
|
||||||
|
|
||||||
// "linebreak-style": "off",
|
// "linebreak-style": "off",
|
||||||
// "one-var": "off",
|
// "one-var": "off",
|
||||||
@@ -95,9 +96,8 @@
|
|||||||
"no-mixed-operators": "off",
|
"no-mixed-operators": "off",
|
||||||
"comma-spacing": "off",
|
"comma-spacing": "off",
|
||||||
"global-require": "off",
|
"global-require": "off",
|
||||||
"no-trailing-spaces": "off",
|
// "no-trailing-spaces": "off",
|
||||||
"key-spacing": "off",
|
// "key-spacing": "off",
|
||||||
"no-underscore-dangle": "off",
|
|
||||||
// "no-multiple-empty-lines": "off",
|
// "no-multiple-empty-lines": "off",
|
||||||
// "spaced-comment": "off",
|
// "spaced-comment": "off",
|
||||||
// "space-in-parens": "off",
|
// "space-in-parens": "off",
|
||||||
|
|||||||
@@ -34,4 +34,3 @@ define('admin/appearance/customise', ['admin/settings'], function (Settings) {
|
|||||||
|
|
||||||
return Customise;
|
return Customise;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -155,8 +155,8 @@ define('admin/manage/tags', [
|
|||||||
function save(tag) {
|
function save(tag) {
|
||||||
var data = {
|
var data = {
|
||||||
tag: tag.attr('data-tag'),
|
tag: tag.attr('data-tag'),
|
||||||
bgColor : tag.find('[data-name="bgColor"]').val(),
|
bgColor: tag.find('[data-name="bgColor"]').val(),
|
||||||
color : tag.find('[data-name="color"]').val(),
|
color: tag.find('[data-name="color"]').val(),
|
||||||
};
|
};
|
||||||
|
|
||||||
socket.emit('admin.tags.update', data, function (err) {
|
socket.emit('admin.tags.update', data, function (err) {
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ app.cacheBuster = null;
|
|||||||
app.createStatusTooltips = function () {
|
app.createStatusTooltips = function () {
|
||||||
if (!utils.isTouchDevice()) {
|
if (!utils.isTouchDevice()) {
|
||||||
$('body').tooltip({
|
$('body').tooltip({
|
||||||
selector:'.fa-circle.status',
|
selector: '.fa-circle.status',
|
||||||
placement: 'top',
|
placement: 'top',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -481,7 +481,7 @@ app.cacheBuster = null;
|
|||||||
searchButton.on('click', function (e) {
|
searchButton.on('click', function (e) {
|
||||||
if (!config.loggedIn && !config.allowGuestSearching) {
|
if (!config.loggedIn && !config.allowGuestSearching) {
|
||||||
app.alert({
|
app.alert({
|
||||||
message:'[[error:search-requires-login]]',
|
message: '[[error:search-requires-login]]',
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||
});
|
});
|
||||||
ajaxify.go('login');
|
ajaxify.go('login');
|
||||||
|
|||||||
@@ -155,10 +155,10 @@ define('forum/topic', [
|
|||||||
message: '[[topic:bookmark_instructions]]',
|
message: '[[topic:bookmark_instructions]]',
|
||||||
timeout: 0,
|
timeout: 0,
|
||||||
type: 'info',
|
type: 'info',
|
||||||
clickfn : function () {
|
clickfn: function () {
|
||||||
navigator.scrollToPost(parseInt(bookmark - 1, 10), true);
|
navigator.scrollToPost(parseInt(bookmark - 1, 10), true);
|
||||||
},
|
},
|
||||||
closefn : function () {
|
closefn: function () {
|
||||||
localStorage.removeItem('topic:' + tid + ':bookmark');
|
localStorage.removeItem('topic:' + tid + ':bookmark');
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -187,10 +187,10 @@ define('chat', [
|
|||||||
});
|
});
|
||||||
|
|
||||||
chatModal.draggable({
|
chatModal.draggable({
|
||||||
start:function () {
|
start: function () {
|
||||||
module.bringModalToTop(chatModal);
|
module.bringModalToTop(chatModal);
|
||||||
},
|
},
|
||||||
stop:function () {
|
stop: function () {
|
||||||
chatModal.find('#chat-message-input').focus();
|
chatModal.find('#chat-message-input').focus();
|
||||||
},
|
},
|
||||||
distance: 10,
|
distance: 10,
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ if ('undefined' !== typeof window) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}(jQuery || {fn:{}}));
|
}(jQuery || {fn: {}}));
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
// FIX FOR #1245 - https://github.com/NodeBB/NodeBB/issues/1245
|
// FIX FOR #1245 - https://github.com/NodeBB/NodeBB/issues/1245
|
||||||
|
|||||||
@@ -241,9 +241,9 @@
|
|||||||
return Date.prototype.toISOString ? new Date(parseInt(timestamp, 10)).toISOString() : timestamp;
|
return Date.prototype.toISOString ? new Date(parseInt(timestamp, 10)).toISOString() : timestamp;
|
||||||
},
|
},
|
||||||
|
|
||||||
tags : ['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'map', 'mark', 'menu', 'meta', 'meter', 'nav', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr'],
|
tags: ['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'map', 'mark', 'menu', 'meta', 'meter', 'nav', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr'],
|
||||||
|
|
||||||
stripTags : ['abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'base', 'basefont',
|
stripTags: ['abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'base', 'basefont',
|
||||||
'bdi', 'bdo', 'big', 'blink', 'body', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup',
|
'bdi', 'bdo', 'big', 'blink', 'body', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup',
|
||||||
'command', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'em', 'embed',
|
'command', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'em', 'embed',
|
||||||
'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
|
'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
|
||||||
|
|||||||
@@ -20,14 +20,14 @@ dashboardController.get = function (req, res, next) {
|
|||||||
{
|
{
|
||||||
done: !meta.reloadRequired,
|
done: !meta.reloadRequired,
|
||||||
doneText: '[[admin/general/dashboard:restart-not-required]]',
|
doneText: '[[admin/general/dashboard:restart-not-required]]',
|
||||||
notDoneText:'[[admin/general/dashboard:restart-required]]',
|
notDoneText: '[[admin/general/dashboard:restart-required]]',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
done: plugins.hasListeners('filter:search.query'),
|
done: plugins.hasListeners('filter:search.query'),
|
||||||
doneText: '[[admin/general/dashboard:search-plugin-installed]]',
|
doneText: '[[admin/general/dashboard:search-plugin-installed]]',
|
||||||
notDoneText:'[[admin/general/dashboard:search-plugin-not-installed]]',
|
notDoneText: '[[admin/general/dashboard:search-plugin-not-installed]]',
|
||||||
tooltip: '[[admin/general/dashboard:search-plugin-tooltip]]',
|
tooltip: '[[admin/general/dashboard:search-plugin-tooltip]]',
|
||||||
link:'/admin/extend/plugins',
|
link: '/admin/extend/plugins',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
plugins.fireHook('filter:admin.notices', notices, next);
|
plugins.fireHook('filter:admin.notices', notices, next);
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ groupsController.details = function (req, res, callback) {
|
|||||||
posts: function (next) {
|
posts: function (next) {
|
||||||
groups.getLatestMemberPosts(groupName, 10, req.uid, next);
|
groups.getLatestMemberPosts(groupName, 10, req.uid, next);
|
||||||
},
|
},
|
||||||
isAdmin:function (next) {
|
isAdmin: function (next) {
|
||||||
user.isAdministrator(req.uid, next);
|
user.isAdministrator(req.uid, next);
|
||||||
},
|
},
|
||||||
isGlobalMod: function (next) {
|
isGlobalMod: function (next) {
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ module.exports = function (db, module) {
|
|||||||
data[field] = '';
|
data[field] = '';
|
||||||
});
|
});
|
||||||
|
|
||||||
db.collection('objects').update({_key: key}, {$unset : data}, function (err) {
|
db.collection('objects').update({_key: key}, {$unset: data}, function (err) {
|
||||||
callback(err);
|
callback(err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ module.exports = function (db, module) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (exists) {
|
if (exists) {
|
||||||
db.collection('objects').update({_key:key}, {$push: {array: {$each: [value], $position: 0}}}, {upsert:true, w:1 }, function (err, res) {
|
db.collection('objects').update({_key: key}, {$push: {array: {$each: [value], $position: 0}}}, {upsert: true, w: 1 }, function (err, res) {
|
||||||
callback(err);
|
callback(err);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -33,7 +33,7 @@ module.exports = function (db, module) {
|
|||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
value = helpers.valueToString(value);
|
value = helpers.valueToString(value);
|
||||||
db.collection('objects').update({ _key: key }, { $push: { array: value } }, {upsert:true, w:1}, function (err, res) {
|
db.collection('objects').update({ _key: key }, { $push: { array: value } }, {upsert: true, w: 1}, function (err, res) {
|
||||||
callback(err);
|
callback(err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -87,7 +87,7 @@ module.exports = function (db, module) {
|
|||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
db.collection('objects').findOne({_key:key}, { array: 1}, function (err, data) {
|
db.collection('objects').findOne({_key: key}, { array: 1}, function (err, data) {
|
||||||
if(err || !(data && data.array)) {
|
if(err || !(data && data.array)) {
|
||||||
return callback(err, []);
|
return callback(err, []);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ module.exports = function (db, module) {
|
|||||||
|
|
||||||
module.rename = function (oldKey, newKey, callback) {
|
module.rename = function (oldKey, newKey, callback) {
|
||||||
callback = callback || helpers.noop;
|
callback = callback || helpers.noop;
|
||||||
db.collection('objects').update({_key: oldKey}, {$set:{_key: newKey}}, {multi: true}, function (err, res) {
|
db.collection('objects').update({_key: oldKey}, {$set: {_key: newKey}}, {multi: true}, function (err, res) {
|
||||||
callback(err);
|
callback(err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ module.exports = function (db, module) {
|
|||||||
}
|
}
|
||||||
value = helpers.valueToString(value);
|
value = helpers.valueToString(value);
|
||||||
|
|
||||||
db.collection('objects').find({_key: {$in : sets}, members: value}, {_id:0, members: 0}).toArray(function (err, result) {
|
db.collection('objects').find({_key: {$in: sets}, members: value}, {_id: 0, members: 0}).toArray(function (err, result) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
@@ -205,7 +205,7 @@ module.exports = function (db, module) {
|
|||||||
|
|
||||||
module.setRemoveRandom = function (key, callback) {
|
module.setRemoveRandom = function (key, callback) {
|
||||||
callback = callback || function () {};
|
callback = callback || function () {};
|
||||||
db.collection('objects').findOne({_key:key}, function (err, data) {
|
db.collection('objects').findOne({_key: key}, function (err, data) {
|
||||||
if(err || !data) {
|
if(err || !data) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ module.exports = function (db, module) {
|
|||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
var pipeline = [
|
var pipeline = [
|
||||||
{ $match : { _key : { $in: keys } } } ,
|
{ $match: { _key: { $in: keys } } } ,
|
||||||
{ $group: { _id: {_key: '$_key'}, count: { $sum: 1 } } },
|
{ $group: { _id: {_key: '$_key'}, count: { $sum: 1 } } },
|
||||||
{ $project: { _id: 1, count: '$count' } },
|
{ $project: { _id: 1, count: '$count' } },
|
||||||
];
|
];
|
||||||
@@ -244,7 +244,7 @@ module.exports = function (db, module) {
|
|||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
value = helpers.valueToString(value);
|
value = helpers.valueToString(value);
|
||||||
db.collection('objects').findOne({_key: key, value: value}, {fields:{_id: 0, score: 1}}, function (err, result) {
|
db.collection('objects').findOne({_key: key, value: value}, {fields: {_id: 0, score: 1}}, function (err, result) {
|
||||||
callback(err, result ? result.score : null);
|
callback(err, result ? result.score : null);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -254,7 +254,7 @@ module.exports = function (db, module) {
|
|||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
value = helpers.valueToString(value);
|
value = helpers.valueToString(value);
|
||||||
db.collection('objects').find({_key:{$in:keys}, value: value}, {_id:0, _key:1, score: 1}).toArray(function (err, result) {
|
db.collection('objects').find({_key: {$in: keys}, value: value}, {_id: 0, _key: 1, score: 1}).toArray(function (err, result) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ module.exports = function (db, module) {
|
|||||||
|
|
||||||
value = helpers.valueToString(value);
|
value = helpers.valueToString(value);
|
||||||
|
|
||||||
db.collection('objects').update({_key: key, value: value}, {$set: {score: parseFloat(score)}}, {upsert:true, w: 1}, function (err) {
|
db.collection('objects').update({_key: key, value: value}, {$set: {score: parseFloat(score)}}, {upsert: true, w: 1}, function (err) {
|
||||||
if (err && err.message.startsWith('E11000 duplicate key error')) {
|
if (err && err.message.startsWith('E11000 duplicate key error')) {
|
||||||
return process.nextTick(module.sortedSetAdd, key, score, value, callback);
|
return process.nextTick(module.sortedSetAdd, key, score, value, callback);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,13 +17,13 @@ var opts = {
|
|||||||
/*
|
/*
|
||||||
* state used by Logger
|
* state used by Logger
|
||||||
*/
|
*/
|
||||||
express : {
|
express: {
|
||||||
app : {},
|
app: {},
|
||||||
set : 0,
|
set: 0,
|
||||||
ofn : null,
|
ofn: null,
|
||||||
},
|
},
|
||||||
streams : {
|
streams: {
|
||||||
log : { f : process.stdout },
|
log: { f: process.stdout },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ var opts = {
|
|||||||
/*
|
/*
|
||||||
* Always initialize "ofn" (original function) with the original logger function
|
* Always initialize "ofn" (original function) with the original logger function
|
||||||
*/
|
*/
|
||||||
opts.express.ofn = morgan('combined', {stream : opts.streams.log.f});
|
opts.express.ofn = morgan('combined', {stream: opts.streams.log.f});
|
||||||
};
|
};
|
||||||
|
|
||||||
Logger.expressLogger = function (req,res,next) {
|
Logger.expressLogger = function (req,res,next) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ module.exports = function (Topics) {
|
|||||||
|
|
||||||
Topics.getRecentTopics = function (cid, uid, start, stop, filter, callback) {
|
Topics.getRecentTopics = function (cid, uid, start, stop, filter, callback) {
|
||||||
var recentTopics = {
|
var recentTopics = {
|
||||||
nextStart : 0,
|
nextStart: 0,
|
||||||
topics: [],
|
topics: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ module.exports = function (Topics) {
|
|||||||
|
|
||||||
var unreadTopics = {
|
var unreadTopics = {
|
||||||
showSelect: true,
|
showSelect: true,
|
||||||
nextStart : 0,
|
nextStart: 0,
|
||||||
topics: [],
|
topics: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ module.exports = function (User) {
|
|||||||
async.parallel([
|
async.parallel([
|
||||||
async.apply(db.sortedSetRemove.bind(db), 'users:banned:expire', uid),
|
async.apply(db.sortedSetRemove.bind(db), 'users:banned:expire', uid),
|
||||||
async.apply(db.sortedSetRemove.bind(db), 'users:banned', uid),
|
async.apply(db.sortedSetRemove.bind(db), 'users:banned', uid),
|
||||||
async.apply(User.setUserFields, uid, {banned:0, 'banned:expire': 0}),
|
async.apply(User.setUserFields, uid, {banned: 0, 'banned:expire': 0}),
|
||||||
], function (err) {
|
], function (err) {
|
||||||
next(err, false);
|
next(err, false);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ module.exports = function (User) {
|
|||||||
restrictChat: data.restrictChat,
|
restrictChat: data.restrictChat,
|
||||||
topicSearchEnabled: data.topicSearchEnabled,
|
topicSearchEnabled: data.topicSearchEnabled,
|
||||||
delayImageLoading: data.delayImageLoading,
|
delayImageLoading: data.delayImageLoading,
|
||||||
homePageRoute : ((data.homePageRoute === 'custom' ? data.homePageCustom : data.homePageRoute) || '').replace(/^\//, ''),
|
homePageRoute: ((data.homePageRoute === 'custom' ? data.homePageCustom : data.homePageRoute) || '').replace(/^\//, ''),
|
||||||
scrollToMyPost: data.scrollToMyPost,
|
scrollToMyPost: data.scrollToMyPost,
|
||||||
notificationSound: data.notificationSound,
|
notificationSound: data.notificationSound,
|
||||||
incomingChatSound: data.incomingChatSound,
|
incomingChatSound: data.incomingChatSound,
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ describe('Hash methods', function () {
|
|||||||
describe('getObjectsFields()', function () {
|
describe('getObjectsFields()', function () {
|
||||||
before(function (done) {
|
before(function (done) {
|
||||||
async.parallel([
|
async.parallel([
|
||||||
async.apply(db.setObject, 'testObject8', {name: 'baris', age:99}),
|
async.apply(db.setObject, 'testObject8', {name: 'baris', age: 99}),
|
||||||
async.apply(db.setObject, 'testObject9', {name: 'ginger', age: 3}),
|
async.apply(db.setObject, 'testObject9', {name: 'ginger', age: 3}),
|
||||||
], done);
|
], done);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user