From 5a45087fc8a9d501d20de9fab4adc293e48f9967 Mon Sep 17 00:00:00 2001
From: Peter Jaszkowiak
Date: Sat, 18 Feb 2017 13:31:19 -0700
Subject: [PATCH] ESlint no-unreachable, no-redeclare
---
.eslintrc | 4 ++--
src/meta/blacklist.js | 12 ++++++------
src/routes/index.js | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/.eslintrc b/.eslintrc
index 65071de80a..9f457493c4 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -81,8 +81,8 @@
"o-eq-null": "off",
"no-cond-assign": "off",
"no-eq-null": "off",
- "no-redeclare": "off",
- "no-unreachable": "off",
+ // "no-redeclare": "off",
+ // "no-unreachable": "off",
// "no-nested-ternary": "off",
// "operator-linebreak": "off",
// "guard-for-in": "off",
diff --git a/src/meta/blacklist.js b/src/meta/blacklist.js
index 49213ac92c..2c17c488b1 100644
--- a/src/meta/blacklist.js
+++ b/src/meta/blacklist.js
@@ -99,18 +99,18 @@ Blacklist.validate = function (rules, callback) {
if (ip.isV4Format(rule)) {
ipv4.push(rule);
return true;
- } else if (ip.isV6Format(rule)) {
+ }
+ if (ip.isV6Format(rule)) {
ipv6.push(rule);
return true;
- } else if (isCidrSubnet.test(rule)) {
+ }
+ if (isCidrSubnet.test(rule)) {
cidr.push(rule);
return true;
- } else {
- invalid.push(rule);
- return false;
}
- return true;
+ invalid.push(rule);
+ return false;
});
callback(null, {
diff --git a/src/routes/index.js b/src/routes/index.js
index 40688539a4..1091a50fe9 100644
--- a/src/routes/index.js
+++ b/src/routes/index.js
@@ -132,7 +132,7 @@ module.exports = function (app, middleware, hotswapIds) {
userRoutes(router, middleware, controllers);
groupRoutes(router, middleware, controllers);
- for (var x = 0; x < routers.length; x += 1) {
+ for (x = 0; x < routers.length; x += 1) {
app.use(relativePath, routers[x]);
}