Node.js based forum software built for the modern web
ESlint eqeqeq and require-jsdoc, no-negated-condition
Peter Jaszkowiakfdf4f873bf86
diff --git a/.eslintrc b/.eslintrcindex e9fc782420..7a8490fa3b 100644--- a/.eslintrc+++ b/.eslintrc@@ -25,6 +25,7 @@"no-tabs": "off","indent": ["error", "tab"],"no-eq-null": "off",+ "camelcase": "off",// ES6"prefer-rest-params": "off",@@ -64,10 +65,9 @@"no-unused-vars": "off","no-mixed-spaces-and-tabs": "off","no-useless-concat": "off",- "require-jsdoc": "off",- "eqeqeq": "off",- "camelcase": "off",- "no-negated-condition": "off",+ // "require-jsdoc": "off",+ // "eqeqeq": "off",+ // "no-negated-condition": "off",// "one-var-declaration-per-line": "off",// "no-lonely-if": "off",// "radix": "off",diff --git a/public/src/admin/general/dashboard.js b/public/src/admin/general/dashboard.jsindex d332b35a0f..ed46203970 100644--- a/public/src/admin/general/dashboard.js+++ b/public/src/admin/general/dashboard.js@@ -133,7 +133,7 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (sfunction lighten(col, amt) {var usePound = false;- if (col[0] == '#') {+ if (col[0] === '#') {col = col.slice(1);usePound = true;}diff --git a/public/src/admin/manage/categories.js b/public/src/admin/manage/categories.jsindex 9eb245eb60..772af419fe 100644--- a/public/src/admin/manage/categories.js+++ b/public/src/admin/manage/categories.js@@ -125,10 +125,10 @@ define('admin/manage/categories', ['vendor/jquery/serializeObject/jquery.ba-seri}function itemDragDidEnd(e) {- var isCategoryUpdate = (newCategoryId != -1);+ var isCategoryUpdate = (newCategoryId !== -1);// Update needed?- if ((e.newIndex != undefined && e.oldIndex != e.newIndex) || isCategoryUpdate) {+ if ((e.newIndex != null && e.oldIndex !== e.newIndex) || isCategoryUpdate) {var parentCategory = isCategoryUpdate ? sortables[newCategoryId] : sortables[e.from.dataset.cid];var modified = {};var i = 0;diff --git a/public/src/utils.js b/public/src/utils.jsindex de5c3dc59d..1506f296e2 100644--- a/public/src/utils.js+++ b/public/src/utils.js@@ -422,7 +422,7 @@return undefined;}var i = props.indexOf('.');- if (i == -1) {+ if (i === -1) {if (value !== undefined) {obj[props] = value;}diff --git a/test/mocks/newXhr.js b/test/mocks/newXhr.jsindex 0f7ccee061..5631b68cae 100644--- a/test/mocks/newXhr.js+++ b/test/mocks/newXhr.js@@ -37,7 +37,7 @@ var callbacks = {};var newXhr = function () {stdXhr.apply(this, arguments);for (var method in callbacks) {- if (typeof callbacks[method] == 'function') {+ if (typeof callbacks[method] === 'function') {callbacks[method].apply(this, arguments);}}