Node.js based forum software built for the modern web
ESlint no-continue
Peter Jaszkowiak554075b31210
diff --git a/.eslintrc b/.eslintrcindex 96041347bc..0664b80eae 100644--- a/.eslintrc+++ b/.eslintrc@@ -109,7 +109,7 @@"newline-per-chained-call": "off","array-bracket-spacing": "off","object-property-newline": "off",- "no-continue": "off",+ // "no-continue": "off",// "no-extra-semi": "off",// "no-spaced-func": "off",// "no-useless-return": "off"diff --git a/public/src/client/category.js b/public/src/client/category.jsindex f394ee0a88..173b141a96 100644--- a/public/src/client/category.js+++ b/public/src/client/category.js@@ -228,14 +228,13 @@ define('forum/category', [if (numTopics > 0) {for (var x = 0; x < numTopics; x++) {var pinned = $(topics[x]).hasClass('pinned');- if (pinned) {- if(x === numTopics - 1) {- topic.insertAfter(topics[x]);- }- continue;+ if (!pinned) {+ topic.insertBefore(topics[x]);+ break;+ }+ if(x === numTopics - 1) {+ topic.insertAfter(topics[x]);}- topic.insertBefore(topics[x]);- break;}} else {container.append(topic);diff --git a/public/src/utils.js b/public/src/utils.jsindex 6a2e444438..485ab05fdd 100644--- a/public/src/utils.js+++ b/public/src/utils.js@@ -447,33 +447,28 @@},};- if (typeof String.prototype.startsWith != 'function') {+ if (typeof String.prototype.startsWith !== 'function') {String.prototype.startsWith = function (prefix) {if (this.length < prefix.length) {return false;}- for (var i = prefix.length - 1; (i >= 0) && (this[i] === prefix[i]); --i) {- continue;- }- return i < 0;+ return this.slice(0, prefix.length) === prefix;};}- if (typeof String.prototype.endsWith != 'function') {+ if (typeof String.prototype.endsWith !== 'function') {String.prototype.endsWith = function (suffix) {if (this.length < suffix.length) {return false;}- var len = this.length;- var suffixLen = suffix.length;- for (var i = 1; (i <= suffixLen && this[len - i] === suffix[suffixLen - i]); ++i) {- continue;+ if (suffix.length === 0) {+ return true;}- return i > suffixLen;+ return this.slice(-suffix.length) === suffix;};}- if (typeof String.prototype.rtrim != 'function') {+ if (typeof String.prototype.rtrim !== 'function') {String.prototype.rtrim = function () {return this.replace(/\s+$/g, '');};