ESlint key-spacing, no-trailing-spaces

v1.18.x
Peter Jaszkowiak 8 years ago
parent 34e233fe1d
commit 277a7fb8b4

@ -20,6 +20,7 @@
"no-empty": ["error", { "allowEmptyCatch": true }],
"prefer-rest-params": "off",
"prefer-spread": "off",
"no-underscore-dangle": "off",
// "linebreak-style": "off",
// "one-var": "off",
@ -95,9 +96,8 @@
"no-mixed-operators": "off",
"comma-spacing": "off",
"global-require": "off",
"no-trailing-spaces": "off",
"key-spacing": "off",
"no-underscore-dangle": "off",
// "no-trailing-spaces": "off",
// "key-spacing": "off",
// "no-multiple-empty-lines": "off",
// "spaced-comment": "off",
// "space-in-parens": "off",

@ -34,4 +34,3 @@ define('admin/appearance/customise', ['admin/settings'], function (Settings) {
return Customise;
});

@ -89,7 +89,7 @@ define('admin/manage/tags', [
var title = tagsToModify.length > 1 ? '[[admin/manage/tags:alerts.editing-multiple]]' : '[[admin/manage/tags:alerts.editing-x, ' + firstTag.find('.tag-item').text() + ']]';
var modal = bootbox.dialog({
title: title,
title: title,
message: firstTag.find('.tag-modal').html(),
buttons: {
success: {
@ -155,8 +155,8 @@ define('admin/manage/tags', [
function save(tag) {
var data = {
tag: tag.attr('data-tag'),
bgColor : tag.find('[data-name="bgColor"]').val(),
color : tag.find('[data-name="color"]').val(),
bgColor: tag.find('[data-name="bgColor"]').val(),
color: tag.find('[data-name="color"]').val(),
};
socket.emit('admin.tags.update', data, function (err) {

@ -223,7 +223,7 @@ app.cacheBuster = null;
app.createStatusTooltips = function () {
if (!utils.isTouchDevice()) {
$('body').tooltip({
selector:'.fa-circle.status',
selector: '.fa-circle.status',
placement: 'top',
});
}
@ -481,7 +481,7 @@ app.cacheBuster = null;
searchButton.on('click', function (e) {
if (!config.loggedIn && !config.allowGuestSearching) {
app.alert({
message:'[[error:search-requires-login]]',
message: '[[error:search-requires-login]]',
timeout: 3000,
});
ajaxify.go('login');

@ -155,10 +155,10 @@ define('forum/topic', [
message: '[[topic:bookmark_instructions]]',
timeout: 0,
type: 'info',
clickfn : function () {
clickfn: function () {
navigator.scrollToPost(parseInt(bookmark - 1, 10), true);
},
closefn : function () {
closefn: function () {
localStorage.removeItem('topic:' + tid + ':bookmark');
},
});

@ -187,10 +187,10 @@ define('chat', [
});
chatModal.draggable({
start:function () {
start: function () {
module.bringModalToTop(chatModal);
},
stop:function () {
stop: function () {
chatModal.find('#chat-message-input').focus();
},
distance: 10,

@ -85,7 +85,7 @@ if ('undefined' !== typeof window) {
});
}
});
}(jQuery || {fn:{}}));
}(jQuery || {fn: {}}));
(function () {
// 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;
},
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',
'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',

@ -20,14 +20,14 @@ dashboardController.get = function (req, res, next) {
{
done: !meta.reloadRequired,
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'),
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]]',
link:'/admin/extend/plugins',
link: '/admin/extend/plugins',
},
];
plugins.fireHook('filter:admin.notices', notices, next);

@ -90,7 +90,7 @@ groupsController.details = function (req, res, callback) {
posts: function (next) {
groups.getLatestMemberPosts(groupName, 10, req.uid, next);
},
isAdmin:function (next) {
isAdmin: function (next) {
user.isAdministrator(req.uid, next);
},
isGlobalMod: function (next) {

@ -216,7 +216,7 @@ module.exports = function (db, module) {
data[field] = '';
});
db.collection('objects').update({_key: key}, {$unset : data}, function (err) {
db.collection('objects').update({_key: key}, {$unset: data}, function (err) {
callback(err);
});
};

@ -18,7 +18,7 @@ module.exports = function (db, module) {
}
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);
});
} else {
@ -33,7 +33,7 @@ module.exports = function (db, module) {
return callback();
}
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);
});
};
@ -87,7 +87,7 @@ module.exports = function (db, module) {
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)) {
return callback(err, []);
}

@ -76,7 +76,7 @@ module.exports = function (db, module) {
module.rename = function (oldKey, newKey, callback) {
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);
});
};

@ -133,7 +133,7 @@ module.exports = function (db, module) {
}
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) {
return callback(err);
}
@ -205,7 +205,7 @@ module.exports = function (db, module) {
module.setRemoveRandom = function (key, callback) {
callback = callback || function () {};
db.collection('objects').findOne({_key:key}, function (err, data) {
db.collection('objects').findOne({_key: key}, function (err, data) {
if(err || !data) {
return callback(err);
}

@ -157,7 +157,7 @@ module.exports = function (db, module) {
return callback();
}
var pipeline = [
{ $match : { _key : { $in: keys } } } ,
{ $match: { _key: { $in: keys } } } ,
{ $group: { _id: {_key: '$_key'}, count: { $sum: 1 } } },
{ $project: { _id: 1, count: '$count' } },
];
@ -244,7 +244,7 @@ module.exports = function (db, module) {
return callback();
}
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);
});
};
@ -254,7 +254,7 @@ module.exports = function (db, module) {
return callback();
}
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) {
return callback(err);
}

@ -15,7 +15,7 @@ module.exports = function (db, module) {
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')) {
return process.nextTick(module.sortedSetAdd, key, score, value, callback);
}

@ -17,13 +17,13 @@ var opts = {
/*
* state used by Logger
*/
express : {
app : {},
set : 0,
ofn : null,
express: {
app: {},
set: 0,
ofn: null,
},
streams : {
log : { f : process.stdout },
streams: {
log: { f: process.stdout },
},
};
@ -124,7 +124,7 @@ var opts = {
/*
* 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) {

@ -19,7 +19,7 @@ module.exports = function (Topics) {
Topics.getRecentTopics = function (cid, uid, start, stop, filter, callback) {
var recentTopics = {
nextStart : 0,
nextStart: 0,
topics: [],
};

@ -28,7 +28,7 @@ module.exports = function (Topics) {
var unreadTopics = {
showSelect: true,
nextStart : 0,
nextStart: 0,
topics: [],
};

@ -75,7 +75,7 @@ module.exports = function (User) {
async.parallel([
async.apply(db.sortedSetRemove.bind(db), 'users:banned:expire', 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) {
next(err, false);
});

@ -120,7 +120,7 @@ module.exports = function (User) {
restrictChat: data.restrictChat,
topicSearchEnabled: data.topicSearchEnabled,
delayImageLoading: data.delayImageLoading,
homePageRoute : ((data.homePageRoute === 'custom' ? data.homePageCustom : data.homePageRoute) || '').replace(/^\//, ''),
homePageRoute: ((data.homePageRoute === 'custom' ? data.homePageCustom : data.homePageRoute) || '').replace(/^\//, ''),
scrollToMyPost: data.scrollToMyPost,
notificationSound: data.notificationSound,
incomingChatSound: data.incomingChatSound,

@ -161,7 +161,7 @@ describe('Hash methods', function () {
describe('getObjectsFields()', function () {
before(function (done) {
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}),
], done);
});

@ -155,7 +155,7 @@ describe('User', function () {
it('should not error if a non-newbie user posts if the last post time is 10 < 30 seconds', function (done) {
User.setUserFields(testUid, {
lastposttime: +new Date() - (20 * 1000),
lastposttime: +new Date() - (20 * 1000),
reputation: 10,
}, function () {
Topics.post({

Loading…
Cancel
Save