diff --git a/.eslintrc b/.eslintrc index 7a8490fa3b..57105ee349 100644 --- a/.eslintrc +++ b/.eslintrc @@ -63,8 +63,8 @@ // "brace-style": "off", "max-statements-per-line": "off", "no-unused-vars": "off", - "no-mixed-spaces-and-tabs": "off", - "no-useless-concat": "off", + // "no-mixed-spaces-and-tabs": "off", + // "no-useless-concat": "off", // "require-jsdoc": "off", // "eqeqeq": "off", // "no-negated-condition": "off", diff --git a/public/src/admin/appearance/customise.js b/public/src/admin/appearance/customise.js index 026de7c204..edad9e8a74 100644 --- a/public/src/admin/appearance/customise.js +++ b/public/src/admin/appearance/customise.js @@ -18,7 +18,7 @@ define('admin/appearance/customise', ['admin/settings'], function (Settings) { customCSS.on('change', function (event) { app.flags = app.flags || {}; app.flags._unsaved = true; - $('#customCSS-holder').val(customCSS.getValue()); + $('#customCSS-holder').val(customCSS.getValue()); }); customHTML.setTheme('ace/theme/twilight'); @@ -27,7 +27,7 @@ define('admin/appearance/customise', ['admin/settings'], function (Settings) { customHTML.on('change', function (event) { app.flags = app.flags || {}; app.flags._unsaved = true; - $('#customHTML-holder').val(customHTML.getValue()); + $('#customHTML-holder').val(customHTML.getValue()); }); }); }; diff --git a/public/src/admin/extend/rewards.js b/public/src/admin/extend/rewards.js index e2858af2e8..374251166f 100644 --- a/public/src/admin/extend/rewards.js +++ b/public/src/admin/extend/rewards.js @@ -43,7 +43,7 @@ define('admin/extend/rewards', ['translator'], function (translator) { var btn = $(this); var disabled = btn.hasClass('btn-success'); var id = $(this).parents('[data-id]').attr('data-id'); - btn.toggleClass('btn-warning').toggleClass('btn-success').translateHtml('[[admin/extend/rewards:' + disabled ? 'disable' : 'enable' + ']]'); + btn.toggleClass('btn-warning').toggleClass('btn-success').translateHtml('[[admin/extend/rewards:' + (disabled ? 'disable' : 'enable') + ']]'); // send disable api call return false; }); diff --git a/public/src/admin/general/navigation.js b/public/src/admin/general/navigation.js index 50da0f952b..992c4fcb56 100644 --- a/public/src/admin/general/navigation.js +++ b/public/src/admin/general/navigation.js @@ -40,8 +40,8 @@ define('admin/general/navigation', ['translator', 'iconSelect', 'jqueryui'], fun $('#active-navigation').on('click', 'li', onSelect); $('#enabled') - .on('click', '.delete', remove) - .on('click', '.toggle', toggle); + .on('click', '.delete', remove) + .on('click', '.toggle', toggle); $('#save').on('click', save); }; diff --git a/public/src/admin/manage/flags.js b/public/src/admin/manage/flags.js index 2e4dca281d..26e9bd3f73 100644 --- a/public/src/admin/manage/flags.js +++ b/public/src/admin/manage/flags.js @@ -37,7 +37,7 @@ define('admin/manage/flags', [ socket.emit('posts.dismissFlag', pid, function (err) { done(err, btn); }); - }); + }); } function handleDismissAll() { diff --git a/public/src/admin/manage/ip-blacklist.js b/public/src/admin/manage/ip-blacklist.js index 5dd3e32fb1..a9cf75d022 100644 --- a/public/src/admin/manage/ip-blacklist.js +++ b/public/src/admin/manage/ip-blacklist.js @@ -8,7 +8,7 @@ define('admin/manage/ip-blacklist', ['translator'], function (translator) { var blacklist = $('#blacklist-rules'); blacklist.on('keyup', function () { - $('#blacklist-rules-holder').val(blacklist.val()); + $('#blacklist-rules-holder').val(blacklist.val()); }); $('[data-action="apply"]').on('click', function () { diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index 322a13bd20..c6d04ade07 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -321,7 +321,7 @@ $(document).ready(function () { callback(templates.cache[template]); } else { $.ajax({ - url: config.relative_path + '/assets/templates/' + template + '.tpl' + '?' + config['cache-buster'], + url: config.relative_path + '/assets/templates/' + template + '.tpl?' + config['cache-buster'], type: 'GET', success: function (data) { callback(data.toString()); diff --git a/public/src/app.js b/public/src/app.js index 9983aef36f..8df3941ddb 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -558,7 +558,7 @@ app.cacheBuster = null; var scriptEl = document.createElement('script'); scriptEl.type = 'text/javascript'; - scriptEl.src = config.relative_path + '/assets/vendor/jquery/js/jquery-ui.js' + '?' + config['cache-buster']; + scriptEl.src = config.relative_path + '/assets/vendor/jquery/js/jquery-ui.js?' + config['cache-buster']; scriptEl.onload = callback; document.head.appendChild(scriptEl); }; diff --git a/public/src/client/chats.js b/public/src/client/chats.js index 262f58bbe4..c42a8e9330 100644 --- a/public/src/client/chats.js +++ b/public/src/client/chats.js @@ -322,7 +322,7 @@ define('forum/chats', [ rooms: { roomId: data.roomId, lastUser: data.message.fromUser, usernames: data.message.fromUser.username, unread: true }, }, function (html) { translator.translate(html, function (translated) { - recentEl.prepend(translated); + recentEl.prepend(translated); }); }); } diff --git a/public/src/client/chats/messages.js b/public/src/client/chats/messages.js index ee68e8c88e..c8300c485c 100644 --- a/public/src/client/chats/messages.js +++ b/public/src/client/chats/messages.js @@ -114,7 +114,7 @@ define('forum/chats/messages', ['components', 'sounds', 'translator'], function 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); + var body = components.get('chat/message', message.messageId); if (body.length) { body.replaceWith(html); components.get('chat/message', message.messageId).find('.timeago').timeago(); diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js index 38591ac996..3dc7bc136b 100644 --- a/public/src/modules/chat.js +++ b/public/src/modules/chat.js @@ -114,7 +114,7 @@ define('chat', [ } var rooms = data.rooms.filter(function (room) { - return room.teaser; + return room.teaser; }); templates.parse('partials/chats/dropdown', { diff --git a/public/src/modules/helpers.js b/public/src/modules/helpers.js index 3e06438fd0..ea8c29d339 100644 --- a/public/src/modules/helpers.js +++ b/public/src/modules/helpers.js @@ -269,7 +269,7 @@ exports = module.exports/* = SemVer*/; } else if (typeof define === 'function' && define.amd) { // Use the define() function if we're in AMD land - define('helpers', exports); + define('helpers', exports); } else if (typeof window === 'object') { window.helpers = exports; } diff --git a/public/src/modules/pictureCropper.js b/public/src/modules/pictureCropper.js index 119565cbe7..409a000e87 100644 --- a/public/src/modules/pictureCropper.js +++ b/public/src/modules/pictureCropper.js @@ -17,7 +17,7 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe uploadModal = $(uploadModal); uploadModal.modal('show'); - uploadModal.on('hidden.bs.modal', function () { + uploadModal.on('hidden.bs.modal', function () { uploadModal.remove(); }); @@ -74,15 +74,15 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe socketData.imageData = imageData; socket.emit(data.socketMethod, socketData, function (err, imageData) { - if (err) { - cropperModal.find('#upload-progress-box').hide(); - cropperModal.find('.upload-btn').removeClass('disabled'); - cropperModal.find('.crop-btn').removeClass('disabled'); - return app.alertError(err.message); - } - - callback(imageData.url); - cropperModal.modal('hide'); + if (err) { + cropperModal.find('#upload-progress-box').hide(); + cropperModal.find('.upload-btn').removeClass('disabled'); + cropperModal.find('.crop-btn').removeClass('disabled'); + return app.alertError(err.message); + } + + callback(imageData.url); + cropperModal.modal('hide'); }); }); diff --git a/public/src/modules/uploader.js b/public/src/modules/uploader.js index 1b56dbb4b8..aca2460ee5 100644 --- a/public/src/modules/uploader.js +++ b/public/src/modules/uploader.js @@ -26,7 +26,7 @@ define('uploader', ['translator'], function (translator) { uploadModal = $(uploadModal); uploadModal.modal('show'); - uploadModal.on('hidden.bs.modal', function () { + uploadModal.on('hidden.bs.modal', function () { uploadModal.remove(); }); diff --git a/public/src/widgets.js b/public/src/widgets.js index 5c950563f0..f5f667d2a7 100644 --- a/public/src/widgets.js +++ b/public/src/widgets.js @@ -29,7 +29,7 @@ } }); - $.get(config.relative_path + '/api/widgets/render' + '?' + config['cache-buster'], { + $.get(config.relative_path + '/api/widgets/render?' + config['cache-buster'], { locations: widgetLocations, template: template + '.tpl', url: url, diff --git a/src/categories/topics.js b/src/categories/topics.js index ea719651fb..a346307e9c 100644 --- a/src/categories/topics.js +++ b/src/categories/topics.js @@ -36,7 +36,7 @@ module.exports = function (Categories) { }; Categories.getTopicIds = function (cid, set, reverse, start, stop, callback) { - var pinnedTids; + var pinnedTids; var pinnedCount; var totalPinnedCount; diff --git a/src/controllers/accounts/settings.js b/src/controllers/accounts/settings.js index 974e20c0dc..0644dad9e8 100644 --- a/src/controllers/accounts/settings.js +++ b/src/controllers/accounts/settings.js @@ -115,9 +115,9 @@ settingsController.get = function (req, res, callback) { } userData.homePageRoutes.push({ - route: 'custom', - name: 'Custom', - selected: isCustom, + route: 'custom', + name: 'Custom', + selected: isCustom, }); userData.bootswatchSkinOptions.forEach(function (skin) { diff --git a/src/database/mongo/sorted.js b/src/database/mongo/sorted.js index c52d616624..defaed80fc 100644 --- a/src/database/mongo/sorted.js +++ b/src/database/mongo/sorted.js @@ -362,13 +362,13 @@ module.exports = function (db, module) { var sets = {}; data.forEach(function (set) { - sets[set._key] = sets[set._key] || []; - sets[set._key].push(set.value); + sets[set._key] = sets[set._key] || []; + sets[set._key].push(set.value); }); var returnData = new Array(keys.length); for (var i = 0; i < keys.length; i += 1) { - returnData[i] = sets[keys[i]] || []; + returnData[i] = sets[keys[i]] || []; } callback(null, returnData); }); diff --git a/src/meta/languages.js b/src/meta/languages.js index 30d8d599e9..67bd9fabd5 100644 --- a/src/meta/languages.js +++ b/src/meta/languages.js @@ -39,7 +39,7 @@ function getTranslationTree(callback) { // generate list of languages and namespaces function (plugins, next) { var languages = []; - var namespaces = []; + var namespaces = []; // pull languages and namespaces from paths function extrude(languageDir, paths) { diff --git a/src/posts/recent.js b/src/posts/recent.js index 8936ee3633..320febff19 100644 --- a/src/posts/recent.js +++ b/src/posts/recent.js @@ -50,5 +50,5 @@ module.exports = function (Posts) { next(null, uids); }, ], callback); - }; + }; }; diff --git a/src/search.js b/src/search.js index 8cf54c86be..ffe33c8ef5 100644 --- a/src/search.js +++ b/src/search.js @@ -422,10 +422,10 @@ function getChildrenCids(cids, uid, callback) { childrenCategories.forEach(function (childrens) { categories.flattenCategories(allCategories, childrens); - childrenCids = childrenCids.concat(allCategories.map(function (category) { - return category && category.cid; - })); - }); + childrenCids = childrenCids.concat(allCategories.map(function (category) { + return category && category.cid; + })); + }); callback(null, childrenCids); }); diff --git a/test/mocks/databasemock.js b/test/mocks/databasemock.js index 4c75cb59ff..412a255dc6 100644 --- a/test/mocks/databasemock.js +++ b/test/mocks/databasemock.js @@ -38,27 +38,27 @@ '\n===========================================================\n' + 'Please, add parameters for test database in config.json\n' + 'For example (redis):\n' + - '"test_database": {' + '\n' + - ' "host": "127.0.0.1",' + '\n' + - ' "port": "6379",' + '\n' + - ' "password": "",' + '\n' + - ' "database": "1"' + '\n' + + '"test_database": {\n' + + ' "host": "127.0.0.1",\n' + + ' "port": "6379",\n' + + ' "password": "",\n' + + ' "database": "1"\n' + '}\n' + ' or (mongo):\n' + - '"test_database": {' + '\n' + - ' "host": "127.0.0.1",' + '\n' + - ' "port": "27017",' + '\n' + - ' "password": "",' + '\n' + - ' "database": "1"' + '\n' + + '"test_database": {\n' + + ' "host": "127.0.0.1",\n' + + ' "port": "27017",\n' + + ' "password": "",\n' + + ' "database": "1\n' + + '}\n' + + ' or (mongo) in a replicaset\n' + + '"test_database": {\n' + + ' "host": "127.0.0.1,127.0.0.1,127.0.0.1",\n' + + ' "port": "27017,27018,27019",\n' + + ' "username": "",\n' + + ' "password": "",\n' + + ' "database": "nodebb_test"\n' + '}\n' + - ' or (mongo) in a replicaset' + '\n' + - '"test_database": {' + '\n' + - ' "host": "127.0.0.1,127.0.0.1,127.0.0.1",' + '\n' + - ' "port": "27017,27018,27019",' + '\n' + - ' "username": "",' + '\n' + - ' "password": "",' + '\n' + - ' "database": "nodebb_test"' + '\n' + - '}\n' + '===========================================================' ); winston.error(errorText); diff --git a/test/user.js b/test/user.js index 8eed9d67c7..778385f10b 100644 --- a/test/user.js +++ b/test/user.js @@ -383,9 +383,9 @@ describe('User', function () { io.emit('user.updateProfile', data, function (err, result) { assert.ifError(err); - assert.equal(result.username, 'updatedUserName'); - assert.equal(result.userslug, 'updatedusername'); - assert.equal(result.email, 'updatedEmail@me.com'); + assert.equal(result.username, 'updatedUserName'); + assert.equal(result.userslug, 'updatedusername'); + assert.equal(result.email, 'updatedEmail@me.com'); db.getObject('user:' + uid, function (err, userData) { assert.ifError(err);