DEV: apply coding standards (#54)

DEV: apply coding standards (#54)

diff --git a/.eslintrc b/.eslintrc
index 86ed71b..7898fbf 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,93 +1,3 @@
 {
-  "env": {
-    "jasmine": true,
-    "node": true,
-    "mocha": true,
-    "browser": true,
-    "builtin": true
-  },
-  "parserOptions": {
-    "ecmaVersion": 7,
-    "sourceType": "module"
-  },
-  "globals": {
-    "Ember": true,
-    "jQuery": true,
-    "$": true,
-    "QUnit": true,
-    "RSVP": true,
-    "Discourse": true,
-    "Handlebars": true,
-    "I18n": true,
-    "bootbox": true,
-    "moduleFor": true,
-    "moduleForComponent": true,
-    "Pretender": true,
-    "sandbox": true,
-    "controllerFor": true,
-    "test": true,
-    "visit": true,
-    "andThen": true,
-    "click": true,
-    "currentPath": true,
-    "currentRouteName": true,
-    "currentURL": true,
-    "fillIn": true,
-    "keyEvent": true,
-    "triggerEvent": true,
-    "count": true,
-    "exists": true,
-    "visible": true,
-    "invisible": true,
-    "asyncRender": true,
-    "asyncTestDiscourse": true,
-    "fixture": true,
-    "find": true,
-    "sinon": true,
-    "moment": true,
-    "_": true,
-    "alert": true,
-    "define": true,
-    "require": true,
-    "requirejs": true,
-    "hasModule": true,
-    "Blob": true,
-    "File": true
-  },
-  "rules": {
-    "block-scoped-var": 2,
-    "dot-notation": 0,
-    "eqeqeq": [2, "allow-null"],
-    "guard-for-in": 2,
-    "no-bitwise": 2,
-    "no-caller": 2,
-    "no-cond-assign": 0,
-    "no-debugger": 2,
-    "no-empty": 0,
-    "no-eval": 2,
-    "no-extend-native": 2,
-    "no-extra-parens": 0,
-    "no-inner-declarations": 2,
-    "no-irregular-whitespace": 2,
-    "no-iterator": 2,
-    "no-loop-func": 2,
-    "no-multi-str": 2,
-    "no-new": 2,
-    "no-plusplus": 0,
-    "no-proto": 2,
-    "no-script-url": 2,
-    "no-sequences": 2,
-    "no-shadow": 2,
-    "no-undef": 2,
-    "no-unused-vars": 2,
-    "no-with": 2,
-    "no-this-before-super": 2,
-    "semi": 2,
-    "strict": 0,
-    "valid-typeof": 2,
-    "wrap-iife": [2, "inside"],
-    "no-mixed-spaces-and-tabs": 2,
-    "no-trailing-spaces": 2
-  },
-  "parser": "babel-eslint"
+  "extends": "eslint-config-discourse"
 }
diff --git a/.gitignore b/.gitignore
index 9daa824..74959fd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
 .DS_Store
 node_modules
+yarn-error.log
+.rubocop-https---raw-githubusercontent-com-discourse-*
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1 @@
+{}
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/feature-voting-route-map.js.es6 b/assets/javascripts/discourse/feature-voting-route-map.js.es6
index 2a1156c..8100dab 100644
--- a/assets/javascripts/discourse/feature-voting-route-map.js.es6
+++ b/assets/javascripts/discourse/feature-voting-route-map.js.es6
@@ -5,9 +5,9 @@ export default {
     this.route(
       "userActivity",
       { path: "activity", resetNamespace: true },
-      function() {
+      function () {
         this.route("votes");
       }
     );
-  }
+  },
 };
diff --git a/assets/javascripts/discourse/initializers/discourse-voting.js.es6 b/assets/javascripts/discourse/initializers/discourse-voting.js.es6
index b2b3319..3f55f3e 100644
--- a/assets/javascripts/discourse/initializers/discourse-voting.js.es6
+++ b/assets/javascripts/discourse/initializers/discourse-voting.js.es6
@@ -1,3 +1,4 @@
+import I18n from "I18n";
 import { withPluginApi } from "discourse/lib/plugin-api";
 import NavItem from "discourse/models/nav-item";
 
@@ -5,7 +6,7 @@ export default {
   name: "discourse-voting",
 
   initialize() {
-    withPluginApi("0.8.32", api => {
+    withPluginApi("0.8.32", (api) => {
       const siteSettings = api.container.lookup("site-settings:main");
       if (siteSettings.voting_enabled) {
         // TODO: Remove if check once Discourse 2.6 is stable
@@ -18,14 +19,14 @@ export default {
           pageSearchController.sortOrders.pushObject({
             name: I18n.t("search.most_votes"),
             id: 5,
-            term: "order:votes"
+            term: "order:votes",
           });
         }
 
         api.addNavigationBarItem({
           name: "votes",
           before: "top",
-          customFilter: category => {
+          customFilter: (category) => {
             return category && category.can_vote;
           },
           customHref: (category, args) => {
@@ -39,12 +40,12 @@ export default {
               Object.keys(queryParams).length === 1 &&
               queryParams["order"] === "votes"
             );
-          }
+          },
         });
         api.addNavigationBarItem({
           name: "my_votes",
           before: "top",
-          customFilter: category => {
+          customFilter: (category) => {
             return category && category.can_vote && api.getCurrentUser();
           },
           customHref: (category, args) => {
@@ -58,9 +59,9 @@ export default {
               Object.keys(queryParams).length === 1 &&
               queryParams["state"] === "my_votes"
             );
-          }
+          },
         });
       }
     });
-  }
+  },
 };
diff --git a/assets/javascripts/discourse/pre-initializers/extend-category-for-voting.js.es6 b/assets/javascripts/discourse/pre-initializers/extend-category-for-voting.js.es6
index 3dbd237..868be77 100644
--- a/assets/javascripts/discourse/pre-initializers/extend-category-for-voting.js.es6
+++ b/assets/javascripts/discourse/pre-initializers/extend-category-for-voting.js.es6
@@ -1,14 +1,15 @@
+import I18n from "I18n";
 import { withPluginApi } from "discourse/lib/plugin-api";
 
 function initialize(api) {
-  api.addPostClassesCallback(post => {
+  api.addPostClassesCallback((post) => {
     if (post.post_number === 1 && post.can_vote) {
       return ["voting-post"];
     }
   });
   api.includePostAttributes("can_vote");
   api.addTagsHtmlCallback(
-    topic => {
+    (topic) => {
       if (!topic.can_vote) {
         return;
       }
@@ -42,7 +43,7 @@ export default {
   before: "inject-discourse-objects",
 
   initialize() {
-    withPluginApi("0.8.4", api => initialize(api));
-    withPluginApi("0.8.30", api => api.addCategorySortCriteria("votes"));
-  }
+    withPluginApi("0.8.4", (api) => initialize(api));
+    withPluginApi("0.8.30", (api) => api.addCategorySortCriteria("votes"));
+  },
 };
diff --git a/assets/javascripts/discourse/routes/user-activity-votes.js.es6 b/assets/javascripts/discourse/routes/user-activity-votes.js.es6
index 44b0ed8..b1c8d0d 100644
--- a/assets/javascripts/discourse/routes/user-activity-votes.js.es6
+++ b/assets/javascripts/discourse/routes/user-activity-votes.js.es6
@@ -4,9 +4,9 @@ import UserAction from "discourse/models/user-action";
 export default UserTopicListRoute.extend({
   userActionType: UserAction.TYPES.topics,
 
-  model: function() {
+  model: function () {
     return this.store.findFiltered("topicList", {
-      filter: "topics/voted-by/" + this.modelFor("user").get("username_lower")
+      filter: "topics/voted-by/" + this.modelFor("user").get("username_lower"),
     });
-  }
+  },
 });
diff --git a/assets/javascripts/discourse/widgets/remove-vote.js.es6 b/assets/javascripts/discourse/widgets/remove-vote.js.es6
index f3c7fb7..5ea1e73 100644
--- a/assets/javascripts/discourse/widgets/remove-vote.js.es6
+++ b/assets/javascripts/discourse/widgets/remove-vote.js.es6
@@ -1,3 +1,4 @@
+import I18n from "I18n";
 import { createWidget } from "discourse/widgets/widget";
 import { iconNode } from "discourse-common/lib/icon-library";
 
@@ -14,5 +15,5 @@ export default createWidget("remove-vote", {
 
   click() {
     this.sendWidgetAction("removeVote");
-  }
+  },
 });

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

GitHub sha: 0a1464a8

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