DEV: apply coding standards (#90)

DEV: apply coding standards (#90)

diff --git a/.eslintrc b/.eslintrc
index fd27c64..7898fbf 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,106 +1,3 @@
 {
-  "env": {
-    "jasmine": true,
-    "node": true,
-    "mocha": true,
-    "browser": true,
-    "builtin": true
-  },
-  "parserOptions": {
-    "ecmaVersion": 7,
-    "sourceType": "module"
-  },
-  "globals":
-    {"Ember":true,
-    "jQuery":true,
-    "$":true,
-    "RSVP":true,
-    "Discourse":true,
-    "Em":true,
-    "PreloadStore":true,
-    "Handlebars":true,
-    "I18n":true,
-    "bootbox":true,
-    "module":true,
-    "moduleFor":true,
-    "moduleForComponent":true,
-    "Pretender":true,
-    "sandbox":true,
-    "controllerFor":true,
-    "test":true,
-    "ok":true,
-    "not":true,
-    "expect":true,
-    "equal":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,
-    "selectDropdown":true,
-    "asyncTestDiscourse":true,
-    "fixture":true,
-    "find":true,
-    "sinon":true,
-    "moment":true,
-    "start":true,
-    "_":true,
-    "alert":true,
-    "containsInstance":true,
-    "deepEqual":true,
-    "notEqual":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-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"
-    ]
-  },
-  "parser": "babel-eslint"
+  "extends": "eslint-config-discourse"
 }
diff --git a/.gitignore b/.gitignore
index e69de29..2d83702 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,3 @@
+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/connectors/bread-crumbs-right/solved-status-filter.js.es6 b/assets/javascripts/discourse/connectors/bread-crumbs-right/solved-status-filter.js.es6
index b539bb9..64542e5 100644
--- a/assets/javascripts/discourse/connectors/bread-crumbs-right/solved-status-filter.js.es6
+++ b/assets/javascripts/discourse/connectors/bread-crumbs-right/solved-status-filter.js.es6
@@ -1,3 +1,4 @@
+import I18n from "I18n";
 import DiscourseUrl from "discourse/lib/url";
 
 export default {
@@ -16,10 +17,10 @@ export default {
   },
 
   setupComponent(args, component) {
-    const statuses = ["all", "solved", "unsolved"].map(status => {
+    const statuses = ["all", "solved", "unsolved"].map((status) => {
       return {
         name: I18n.t(`solved.topic_status_filter.${status}`),
-        value: status
+        value: status,
       };
     });
     component.set("statuses", statuses);
@@ -42,7 +43,7 @@ export default {
         ? queryStrings.substr(1).split("&")
         : [];
 
-      params = params.filter(param => !param.startsWith("solved="));
+      params = params.filter((param) => !param.startsWith("solved="));
 
       if (newStatus && newStatus !== "all") {
         newStatus = newStatus === "solved" ? "yes" : "no";
@@ -53,6 +54,6 @@ export default {
       DiscourseUrl.routeTo(
         `${location.pathname}${queryStrings}${location.hash}`
       );
-    }
-  }
+    },
+  },
 };
diff --git a/assets/javascripts/discourse/connectors/category-custom-settings/solved-settings.js.es6 b/assets/javascripts/discourse/connectors/category-custom-settings/solved-settings.js.es6
index 41697d3..e4caf25 100644
--- a/assets/javascripts/discourse/connectors/category-custom-settings/solved-settings.js.es6
+++ b/assets/javascripts/discourse/connectors/category-custom-settings/solved-settings.js.es6
@@ -5,6 +5,6 @@ export default {
         "category.custom_fields.enable_accepted_answers",
         value ? "true" : "false"
       );
-    }
-  }
+    },
+  },
 };
diff --git a/assets/javascripts/discourse/initializers/extend-for-solved-button.js.es6 b/assets/javascripts/discourse/initializers/extend-for-solved-button.js.es6
index a3de8ca..670fb57 100644
--- a/assets/javascripts/discourse/initializers/extend-for-solved-button.js.es6
+++ b/assets/javascripts/discourse/initializers/extend-for-solved-button.js.es6
@@ -1,3 +1,4 @@
+import I18n from "I18n";
 import Topic from "discourse/models/topic";
 import User from "discourse/models/user";
 import TopicStatus from "discourse/raw-views/topic-status";
@@ -13,12 +14,12 @@ import SearchAdvancedOptions from "discourse/components/search-advanced-options"
 
 function clearAccepted(topic) {
   const posts = topic.get("postStream.posts");
-  posts.forEach(post => {
+  posts.forEach((post) => {
     if (post.get("post_number") > 1) {
       post.setProperties({
         accepted_answer: false,
         can_accept_answer: true,
-        can_unaccept_answer: false
+        can_unaccept_answer: false,
       });
     }
   });
@@ -33,13 +34,13 @@ function unacceptPost(post) {
   post.setProperties({
     can_accept_answer: true,
     can_unaccept_answer: false,
-    accepted_answer: false
+    accepted_answer: false,
   });
   topic.set("accepted_answer", undefined);
 
   ajax("/solution/unaccept", {
     type: "POST",
-    data: { id: post.id }
+    data: { id: post.id },
   }).catch(popupAjaxError);
 }
 
@@ -51,18 +52,18 @@ function acceptPost(post) {
   post.setProperties({
     can_unaccept_answer: true,
     can_accept_answer: false,
-    accepted_answer: true
+    accepted_answer: true,
   });
 
   topic.set("accepted_answer", {
     username: post.username,
     post_number: post.post_number,
-    excerpt: post.cooked
+    excerpt: post.cooked,
   });
 
   ajax("/solution/accept", {
     type: "POST",
-    data: { id: post.id }
+    data: { id: post.id },
   }).catch(popupAjaxError);
 }
 
@@ -72,7 +73,7 @@ function initializeWithApi(api) {
   TopicStatusIcons.addObject([
     "has_accepted_answer",
     "far-check-square",
-    "solved"
+    "solved",
   ]);
 
   api.includePostAttributes(
@@ -85,7 +86,7 @@ function initializeWithApi(api) {
     api.addDiscoveryQueryParam("solved", { replace: true, refreshModel: true });
   }
 
-  api.addPostMenuButton("solved", attrs => {
+  api.addPostMenuButton("solved", (attrs) => {
     const canAccept = attrs.can_accept_answer;
     const canUnaccept = attrs.can_unaccept_answer;
     const accepted = attrs.accepted_answer;
@@ -100,7 +101,7 @@ function initializeWithApi(api) {
         className: "unaccepted",
         title: "solved.accept_answer",
         label: "solved.solution",
-        position
+        position,
       };
     } else if (canUnaccept && accepted) {
       const title = canUnaccept
@@ -112,7 +113,7 @@ function initializeWithApi(api) {
         title,
         className: "accepted fade-out",
         position,
-        label: "solved.solution"
+        label: "solved.solution",
       };
     } else if (!canAccept && accepted) {
       return {

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

GitHub sha: 613267c3

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