From fdf4f873bf8689ca8659bbf42461218423cca3b1 Mon Sep 17 00:00:00 2001
From: Peter Jaszkowiak
Date: Sat, 18 Feb 2017 14:36:16 -0700
Subject: [PATCH] ESlint eqeqeq and require-jsdoc, no-negated-condition
---
.eslintrc | 8 ++++----
public/src/admin/general/dashboard.js | 2 +-
public/src/admin/manage/categories.js | 4 ++--
public/src/utils.js | 2 +-
test/mocks/newXhr.js | 2 +-
5 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/.eslintrc b/.eslintrc
index 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.js
index 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 (s
function 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.js
index 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.js
index 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.js
index 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);
}
}