ESlint operator-assignment, block-scoped-var

v1.18.x
Peter Jaszkowiak 8 years ago
parent a0a50677da
commit 11cb3a9554

@ -50,6 +50,7 @@
"no-shadow": "off", "no-shadow": "off",
"no-script-url": "off", "no-script-url": "off",
"no-use-before-define": "off", "no-use-before-define": "off",
"default-case": "off",
// "linebreak-style": "off", // "linebreak-style": "off",
// "one-var": "off", // "one-var": "off",
@ -72,9 +73,8 @@
"radix": "off", "radix": "off",
"no-else-return": "off", "no-else-return": "off",
"no-useless-escape": "off", "no-useless-escape": "off",
"block-scoped-var": "off", // "block-scoped-var": "off",
"operator-assignment": "off", // "operator-assignment": "off",
"default-case": "off",
// "yoda": "off", // "yoda": "off",
// "no-loop-func": "off", // "no-loop-func": "off",
// "no-void": "off", // "no-void": "off",

@ -311,7 +311,7 @@ define('forum/topic/posts', [
var imageRect = this.getBoundingClientRect(); var imageRect = this.getBoundingClientRect();
if (imageRect.top < threshold) { if (imageRect.top < threshold) {
scrollTop = scrollTop + (newHeight - oldHeight); scrollTop += newHeight - oldHeight;
$(window).scrollTop(scrollTop); $(window).scrollTop(scrollTop);
} }

@ -62,8 +62,8 @@
}; };
helpers.stripTags = function (str) { helpers.stripTags = function (str) {
if (typeof S !== 'undefined') { if (typeof window !== 'undefined' && window.S) {
return S(String(str)).stripTags().s; return window.S(String(str)).stripTags().s;
} else { } else {
var S = require('string'); var S = require('string');
return S(String(str)).stripTags().s; return S(String(str)).stripTags().s;

@ -95,7 +95,7 @@ exports.processArray = function (array, process, options, callback) {
if (err) { if (err) {
return next(err); return next(err);
} }
start = start + batch; start += batch;
if (options.interval) { if (options.interval) {
setTimeout(next, options.interval); setTimeout(next, options.interval);
} else { } else {

@ -20,7 +20,7 @@ function getCover(type, id) {
if (typeof id === 'string') { if (typeof id === 'string') {
id = (id.charCodeAt(0) + id.charCodeAt(1)) % covers.length; id = (id.charCodeAt(0) + id.charCodeAt(1)) % covers.length;
} else { } else {
id = id % covers.length; id %= covers.length;
} }
return covers[id]; return covers[id];

@ -77,8 +77,9 @@ module.exports = function (db, module) {
var _fields = { var _fields = {
_id: 0, _id: 0,
}; };
var i;
for (var i = 0; i < fields.length; i += 1) { for (i = 0; i < fields.length; i += 1) {
fields[i] = helpers.fieldToString(fields[i]); fields[i] = helpers.fieldToString(fields[i]);
_fields[fields[i]] = 1; _fields[fields[i]] = 1;
} }

@ -26,7 +26,8 @@ pagination.create = function (currentPage, pageCount, queryObj) {
if (startPage > pageCount - 5) { if (startPage > pageCount - 5) {
startPage -= 2 - (pageCount - currentPage); startPage -= 2 - (pageCount - currentPage);
} }
for (var i = 0; i < 5; i += 1) { var i;
for (i = 0; i < 5; i += 1) {
pagesToShow.push(startPage + i); pagesToShow.push(startPage + i);
} }

@ -97,8 +97,11 @@ module.exports = function (app, middleware, hotswapIds) {
var relativePath = nconf.get('relative_path'); var relativePath = nconf.get('relative_path');
var ensureLoggedIn = require('connect-ensure-login'); var ensureLoggedIn = require('connect-ensure-login');
var idx;
var x;
if (Array.isArray(hotswapIds) && hotswapIds.length) { if (Array.isArray(hotswapIds) && hotswapIds.length) {
for (var idx, x = 0; x < hotswapIds.length; x += 1) { for (x = 0; x < hotswapIds.length; x += 1) {
idx = routers.push(express.Router()) - 1; idx = routers.push(express.Router()) - 1;
routers[idx].hotswapId = hotswapIds[x]; routers[idx].hotswapId = hotswapIds[x];
} }

@ -94,7 +94,7 @@ SocketCategories.loadMore = function (socket, data, callback) {
var start = Math.max(0, parseInt(data.after, 10)); var start = Math.max(0, parseInt(data.after, 10));
if (data.direction === -1) { if (data.direction === -1) {
start = start - (reverse ? infScrollTopicsPerPage : -infScrollTopicsPerPage); start -= reverse ? infScrollTopicsPerPage : -infScrollTopicsPerPage;
} }
var stop = start + infScrollTopicsPerPage - 1; var stop = start + infScrollTopicsPerPage - 1;

Loading…
Cancel
Save