DEV: Respect radix rule in eslint-config-discourse 1.0.6

DEV: Respect radix rule in eslint-config-discourse 1.0.6

diff --git a/assets/javascripts/discourse/components/adbutler-ad.js.es6 b/assets/javascripts/discourse/components/adbutler-ad.js.es6
index da22f50..a54414a 100644
--- a/assets/javascripts/discourse/components/adbutler-ad.js.es6
+++ b/assets/javascripts/discourse/components/adbutler-ad.js.es6
@@ -142,6 +142,6 @@ export default AdComponent.extend({
     if (!postNumber) {
       return true;
     }
-    return this.isNthPost(parseInt(this.siteSettings.adbutler_nth_post));
+    return this.isNthPost(parseInt(this.siteSettings.adbutler_nth_post, 10));
   }
 });
diff --git a/assets/javascripts/discourse/components/amazon-product-links.js.es6 b/assets/javascripts/discourse/components/amazon-product-links.js.es6
index b6721ec..ce74bcf 100644
--- a/assets/javascripts/discourse/components/amazon-product-links.js.es6
+++ b/assets/javascripts/discourse/components/amazon-product-links.js.es6
@@ -15,10 +15,12 @@ if (
   data["topic-list-top"]["user_input"] =
     Discourse.SiteSettings.amazon_topic_list_top_src_code;
   data["topic-list-top"]["amazon_width"] = parseInt(
-    Discourse.SiteSettings.amazon_topic_list_top_ad_width_code
+    Discourse.SiteSettings.amazon_topic_list_top_ad_width_code,
+    10
   );
   data["topic-list-top"]["amazon_height"] = parseInt(
-    Discourse.SiteSettings.amazon_topic_list_top_ad_height_code
+    Discourse.SiteSettings.amazon_topic_list_top_ad_height_code,
+    10
   );
 }
 
@@ -29,10 +31,12 @@ if (
   data["topic-list-top"]["user_input_mobile"] =
     Discourse.SiteSettings.amazon_mobile_topic_list_top_src_code;
   data["topic-list-top"]["mobile_amazon_width"] = parseInt(
-    Discourse.SiteSettings.amazon_mobile_topic_list_top_ad_width_code
+    Discourse.SiteSettings.amazon_mobile_topic_list_top_ad_width_code,
+    10
   );
   data["topic-list-top"]["mobile_amazon_height"] = parseInt(
-    Discourse.SiteSettings.amazon_mobile_topic_list_top_ad_height_code
+    Discourse.SiteSettings.amazon_mobile_topic_list_top_ad_height_code,
+    10
   );
 }
 
@@ -43,10 +47,12 @@ if (
   data["topic-above-post-stream"]["user_input"] =
     Discourse.SiteSettings.amazon_topic_above_post_stream_src_code;
   data["topic-above-post-stream"]["amazon_width"] = parseInt(
-    Discourse.SiteSettings.amazon_topic_above_post_stream_ad_width_code
+    Discourse.SiteSettings.amazon_topic_above_post_stream_ad_width_code,
+    10
   );
   data["topic-above-post-stream"]["amazon_height"] = parseInt(
-    Discourse.SiteSettings.amazon_topic_above_post_stream_ad_height_code
+    Discourse.SiteSettings.amazon_topic_above_post_stream_ad_height_code,
+    10
   );
 }
 
@@ -57,10 +63,12 @@ if (
   data["topic-above-post-stream"]["user_input_mobile"] =
     Discourse.SiteSettings.amazon_mobile_topic_above_post_stream_src_code;
   data["topic-above-post-stream"]["mobile_amazon_width"] = parseInt(
-    Discourse.SiteSettings.amazon_mobile_topic_above_post_stream_ad_width_code
+    Discourse.SiteSettings.amazon_mobile_topic_above_post_stream_ad_width_code,
+    10
   );
   data["topic-above-post-stream"]["mobile_amazon_height"] = parseInt(
-    Discourse.SiteSettings.amazon_mobile_topic_above_post_stream_ad_height_code
+    Discourse.SiteSettings.amazon_mobile_topic_above_post_stream_ad_height_code,
+    10
   );
 }
 
@@ -71,10 +79,12 @@ if (
   data["topic-above-suggested"]["user_input"] =
     Discourse.SiteSettings.amazon_topic_above_suggested_src_code;
   data["topic-above-suggested"]["amazon_width"] = parseInt(
-    Discourse.SiteSettings.amazon_topic_above_suggested_ad_width_code
+    Discourse.SiteSettings.amazon_topic_above_suggested_ad_width_code,
+    10
   );
   data["topic-above-suggested"]["amazon_height"] = parseInt(
-    Discourse.SiteSettings.amazon_topic_above_suggested_ad_height_code
+    Discourse.SiteSettings.amazon_topic_above_suggested_ad_height_code,
+    10
   );
 }
 
@@ -85,10 +95,12 @@ if (
   data["topic-above-suggested"]["user_input_mobile"] =
     Discourse.SiteSettings.amazon_mobile_topic_above_suggested_src_code;
   data["topic-above-suggested"]["mobile_amazon_width"] = parseInt(
-    Discourse.SiteSettings.amazon_mobile_topic_above_suggested_ad_width_code
+    Discourse.SiteSettings.amazon_mobile_topic_above_suggested_ad_width_code,
+    10
   );
   data["topic-above-suggested"]["mobile_amazon_height"] = parseInt(
-    Discourse.SiteSettings.amazon_mobile_topic_above_suggested_ad_height_code
+    Discourse.SiteSettings.amazon_mobile_topic_above_suggested_ad_height_code,
+    10
   );
 }
 
@@ -99,10 +111,12 @@ if (
   data["post-bottom"]["user_input"] =
     Discourse.SiteSettings.amazon_post_bottom_src_code;
   data["post-bottom"]["amazon_width"] = parseInt(
-    Discourse.SiteSettings.amazon_post_bottom_ad_width_code
+    Discourse.SiteSettings.amazon_post_bottom_ad_width_code,
+    10
   );
   data["post-bottom"]["amazon_height"] = parseInt(
-    Discourse.SiteSettings.amazon_post_bottom_ad_height_code
+    Discourse.SiteSettings.amazon_post_bottom_ad_height_code,
+    10
   );
 }
 
@@ -113,10 +127,12 @@ if (
   data["post-bottom"]["user_input_mobile"] =
     Discourse.SiteSettings.amazon_mobile_post_bottom_src_code;
   data["post-bottom"]["mobile_amazon_width"] = parseInt(
-    Discourse.SiteSettings.amazon_mobile_post_bottom_ad_width_code
+    Discourse.SiteSettings.amazon_mobile_post_bottom_ad_width_code,
+    10
   );
   data["post-bottom"]["mobile_amazon_height"] = parseInt(
-    Discourse.SiteSettings.amazon_mobile_post_bottom_ad_height_code
+    Discourse.SiteSettings.amazon_mobile_post_bottom_ad_height_code,
+    10
   );
 }
 
@@ -180,6 +196,6 @@ export default AdComponent.extend({
       return true;
     }
 
-    return this.isNthPost(parseInt(this.siteSettings.amazon_nth_post_code));
+    return this.isNthPost(parseInt(this.siteSettings.amazon_nth_post_code, 10));
   }
 });
diff --git a/assets/javascripts/discourse/components/codefund-ad.js.es6 b/assets/javascripts/discourse/components/codefund-ad.js.es6
index 8a1f07c..18a338a 100644
--- a/assets/javascripts/discourse/components/codefund-ad.js.es6
+++ b/assets/javascripts/discourse/components/codefund-ad.js.es6
@@ -136,6 +136,6 @@ export default AdComponent.extend({
       return true;
     }
 
-    return this.isNthPost(parseInt(this.siteSettings.codefund_nth_post));
+    return this.isNthPost(parseInt(this.siteSettings.codefund_nth_post, 10));
   }
 });
diff --git a/assets/javascripts/discourse/components/google-adsense.js.es6 b/assets/javascripts/discourse/components/google-adsense.js.es6
index 4ef2b3a..e9041fb 100644
--- a/assets/javascripts/discourse/components/google-adsense.js.es6
+++ b/assets/javascripts/discourse/components/google-adsense.js.es6
@@ -14,7 +14,7 @@ function parseAdWidth(value) {
   if (value === "responsive") {
     return "auto";
   }
-  const w = parseInt(value.substring(0, 3).trim());
+  const w = parseInt(value.substring(0, 3).trim(), 10);
   if (isNaN(w)) {
     return "auto";
   } else {
@@ -26,7 +26,7 @@ function parseAdHeight(value) {
   if (value === "responsive") {
     return "auto";
   }
-  const h = parseInt(value.substring(4, 7).trim());
+  const h = parseInt(value.substring(4, 7).trim(), 10);
   if (isNaN(h)) {
     return "auto";
   } else {
@@ -225,6 +225,8 @@ export default AdComponent.extend({
       return true;
     }
 
-    return this.isNthPost(parseInt(this.siteSettings.adsense_nth_post_code));
+    return this.isNthPost(
+      parseInt(this.siteSettings.adsense_nth_post_code, 10)
+    );
   }
 });
diff --git a/assets/javascripts/discourse/components/google-dfp-ad.js.es6 b/assets/javascripts/discourse/components/google-dfp-ad.js.es6
index 4f5df35..3df8126 100755
--- a/assets/javascripts/discourse/components/google-dfp-ad.js.es6
+++ b/assets/javascripts/discourse/components/google-dfp-ad.js.es6
@@ -127,8 +127,8 @@ function getWidthAndHeight(placement, settings, isMobile) {
   }
 
   const sizeObj = {
-    width: parseInt(splitWidthInt(size)),
-    height: parseInt(splitHeightInt(size))
+    width: parseInt(splitWidthInt(size), 10),

[... diff too long, it was truncated ...]

GitHub sha: b59f8419

1 Like