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

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

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

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

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

@ -77,8 +77,9 @@ module.exports = function (db, module) {
var _fields = {
_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[fields[i]] = 1;
}

@ -26,7 +26,8 @@ pagination.create = function (currentPage, pageCount, queryObj) {
if (startPage > pageCount - 5) {
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);
}

@ -97,8 +97,11 @@ module.exports = function (app, middleware, hotswapIds) {
var relativePath = nconf.get('relative_path');
var ensureLoggedIn = require('connect-ensure-login');
var idx;
var x;
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;
routers[idx].hotswapId = hotswapIds[x];
}

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

Loading…
Cancel
Save