DEV: apply coding standards (#91)

DEV: apply coding standards (#91)

diff --git a/.gitignore b/.gitignore
index 2ec70f0..6d28d54 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,5 @@ auto_generated
 .DS_Store
 *.swp
 node_modules
+yarn-error.log
+.rubocop-https---raw-githubusercontent-com-discourse-*
diff --git a/.template-lintrc.js b/.template-lintrc.js
new file mode 100644
index 0000000..a558b8e
--- /dev/null
+++ b/.template-lintrc.js
@@ -0,0 +1,4 @@
+module.exports = {
+  plugins: ["ember-template-lint-plugin-discourse"],
+  extends: "discourse:recommended",
+};
diff --git a/assets/javascripts/discourse/adplugin-route-map.js.es6 b/assets/javascripts/discourse/adplugin-route-map.js.es6
index 5bdd864..6a45cfb 100644
--- a/assets/javascripts/discourse/adplugin-route-map.js.es6
+++ b/assets/javascripts/discourse/adplugin-route-map.js.es6
@@ -2,9 +2,9 @@ export default {
   resource: "admin.adminPlugins",
   path: "/plugins",
   map() {
-    this.route("houseAds", { path: "/pluginad/house_creatives" }, function() {
+    this.route("houseAds", { path: "/pluginad/house_creatives" }, function () {
       this.route("index", { path: "/" });
       this.route("show", { path: "/:ad_id" });
     });
-  }
+  },
 };
diff --git a/assets/javascripts/discourse/components/ad-component.js.es6 b/assets/javascripts/discourse/components/ad-component.js.es6
index 187f3e2..1bc40f9 100644
--- a/assets/javascripts/discourse/components/ad-component.js.es6
+++ b/assets/javascripts/discourse/components/ad-component.js.es6
@@ -54,9 +54,9 @@ export default Ember.Component.extend({
     let noAdsGroups = this.siteSettings.no_ads_for_groups
       .split("|")
       .filter(Boolean);
-    let currentGroups = groups.map(g => g.id.toString());
+    let currentGroups = groups.map((g) => g.id.toString());
 
-    return !currentGroups.any(g => noAdsGroups.includes(g));
+    return !currentGroups.any((g) => noAdsGroups.includes(g));
   },
 
   @discourseComputed(
@@ -95,5 +95,5 @@ export default Ember.Component.extend({
     } else {
       return false;
     }
-  }
+  },
 });
diff --git a/assets/javascripts/discourse/components/ad-slot.js.es6 b/assets/javascripts/discourse/components/ad-slot.js.es6
index 608d3e3..10cf850 100644
--- a/assets/javascripts/discourse/components/ad-slot.js.es6
+++ b/assets/javascripts/discourse/components/ad-slot.js.es6
@@ -5,12 +5,12 @@ const adConfig = Ember.Object.create({
   "google-adsense": {
     settingPrefix: "adsense", // settings follow naming convention
     enabledSetting: "adsense_publisher_code",
-    nthPost: "adsense_nth_post_code"
+    nthPost: "adsense_nth_post_code",
   },
   "google-dfp-ad": {
     settingPrefix: "dfp", // settings follow naming convention
     enabledSetting: "dfp_publisher_id",
-    nthPost: "dfp_nth_post_code"
+    nthPost: "dfp_nth_post_code",
   },
   "amazon-product-links": {
     settingPrefix: "amazon",
@@ -20,15 +20,15 @@ const adConfig = Ember.Object.create({
       "topic-list-top": "amazon_topic_list_top_src_code",
       "post-bottom": "amazon_post_bottom_src_code",
       "topic-above-post-stream": "amazon_topic_above_post_stream_src_code",
-      "topic-above-suggested": "amazon_topic_above_suggested_src_code"
+      "topic-above-suggested": "amazon_topic_above_suggested_src_code",
     },
     mobile: {
       "topic-list-top": "amazon_mobile_topic_list_top_src_code",
       "post-bottom": "amazon_mobile_post_bottom_src_code",
       "topic-above-post-stream":
         "amazon_mobile_topic_above_post_stream_src_code",
-      "topic-above-suggested": "amazon_mobile_topic_above_suggested_src_code"
-    }
+      "topic-above-suggested": "amazon_mobile_topic_above_suggested_src_code",
+    },
   },
   "carbonads-ad": {
     settingPrefix: "carbonads",
@@ -37,8 +37,8 @@ const adConfig = Ember.Object.create({
       "topic-list-top": "carbonads_topic_list_top_enabled",
       "post-bottom": false,
       "topic-above-post-stream": "carbonads_above_post_stream_enabled",
-      "topic-above-suggested": false
-    }
+      "topic-above-suggested": false,
+    },
   },
   "adbutler-ad": {
     settingPrefix: "adbutler",
@@ -47,21 +47,21 @@ const adConfig = Ember.Object.create({
       "topic-list-top": "adbutler_topic_list_top_zone_id",
       "post-bottom": "adbutler_post_bottom_zone_id",
       "topic-above-post-stream": "adbutler_topic_above_post_stream_zone_id",
-      "topic-above-suggested": "adbutler_topic_above_suggested_zone_id"
+      "topic-above-suggested": "adbutler_topic_above_suggested_zone_id",
     },
     mobile: {
       "topic-list-top": "adbutler_mobile_topic_list_top_zone_id",
       "post-bottom": "adbutler_mobile_post_bottom_zone_id",
       "topic-above-post-stream":
         "adbutler_mobile_topic_above_post_stream_zone_id",
-      "topic-above-suggested": "adbutler_mobile_topic_above_suggested_zone_id"
-    }
-  }
+      "topic-above-suggested": "adbutler_mobile_topic_above_suggested_zone_id",
+    },
+  },
 });
 
 const displayCounts = {
   houseAds: 0,
-  allAds: 0
+  allAds: 0,
 };
 
 export default AdComponent.extend({
@@ -90,7 +90,7 @@ export default AdComponent.extend({
       }
     }
 
-    Object.keys(adConfig).forEach(adNetwork => {
+    Object.keys(adConfig).forEach((adNetwork) => {
       const config = adConfig[adNetwork];
       let settingNames = null,
         name;
@@ -185,12 +185,12 @@ export default AdComponent.extend({
       }
     }
 
-    const networkNames = availableAdTypes.filter(x => x !== "house-ad");
+    const networkNames = availableAdTypes.filter((x) => x !== "house-ad");
 
     if (houseAdsSkipped) {
       displayCounts.allAds += networkNames.length;
     }
 
     return networkNames;
-  }
+  },
 });
diff --git a/assets/javascripts/discourse/components/adbutler-ad.js.es6 b/assets/javascripts/discourse/components/adbutler-ad.js.es6
index 5f59eeb..fd468ac 100644
--- a/assets/javascripts/discourse/components/adbutler-ad.js.es6
+++ b/assets/javascripts/discourse/components/adbutler-ad.js.es6
@@ -19,8 +19,8 @@ function loadAdbutler() {
   }
 
   _promise = loadScript("https://" + adserverHostname + "/app.js", {
-    scriptTag: true
-  }).then(function() {
+    scriptTag: true,
+  }).then(function () {
     _loaded = true;
   });
 
@@ -61,7 +61,7 @@ export default AdComponent.extend({
       divId: divId,
       publisherId: publisherId,
       zoneId: zoneId,
-      dimensions: dimensions
+      dimensions: dimensions,
     });
 
     this.set("publisherId", publisherId);
@@ -74,11 +74,11 @@ export default AdComponent.extend({
     }
 
     loadAdbutler().then(
-      function() {
+      function () {
         if (this.divs.length > 0) {
           let abkw = window.abkw || "";
           window.AdButler.ads.push({
-            handler: function(opt) {
+            handler: function (opt) {
               window.AdButler.register(
                 opt.place.publisherId,
                 opt.place.zoneId,
@@ -91,8 +91,8 @@ export default AdComponent.extend({
               place: this.divs.pop(),
               keywords: abkw,
               domain: adserverHostname,
-              click: "CLICK_MACRO_PLACEHOLDER"
-            }
+              click: "CLICK_MACRO_PLACEHOLDER",
+            },
           });
         }
       }.bind(this)
@@ -144,5 +144,5 @@ export default AdComponent.extend({
       return true;
     }
     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 4082f17..cb0ec9c 100644
--- a/assets/javascripts/discourse/components/amazon-product-links.js.es6
+++ b/assets/javascripts/discourse/components/amazon-product-links.js.es6
@@ -5,7 +5,7 @@ const data = {
   "topic-list-top": {},
   "topic-above-post-stream": {},
   "topic-above-suggested": {},
-  "post-bottom": {}
+  "post-bottom": {},
 };
 
 let mobileView = Discourse.Site.currentProp("mobileView");
@@ -190,5 +190,5 @@ export default AdComponent.extend({

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

GitHub sha: 30dad028

This commit appears in #91 which was merged by jjaffeux.