DEV: apply coding standards (#43)

DEV: apply coding standards (#43)

diff --git a/.eslintrc b/.eslintrc
index 66c4b8d..7898fbf 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,105 +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,
-    "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,
-    "selectKit":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 99900a4..2326635 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,6 @@ auto_generated/
 node_modules/
 
 .rubocop-https---raw-githubusercontent-com-discourse-discourse-master--rubocop-yml
+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/admin/chat-route-map.js.es6 b/assets/javascripts/admin/chat-route-map.js.es6
index ff6a520..201c5b6 100644
--- a/assets/javascripts/admin/chat-route-map.js.es6
+++ b/assets/javascripts/admin/chat-route-map.js.es6
@@ -2,8 +2,8 @@ export default {
   resource: "admin.adminPlugins",
   path: "/plugins",
   map() {
-    this.route("chat", function() {
+    this.route("chat", function () {
       this.route("provider", { path: "/:provider" });
     });
-  }
+  },
 };
diff --git a/assets/javascripts/admin/components/channel-data.js.es6 b/assets/javascripts/admin/components/channel-data.js.es6
index ece9cf5..d59d9fb 100644
--- a/assets/javascripts/admin/components/channel-data.js.es6
+++ b/assets/javascripts/admin/components/channel-data.js.es6
@@ -1,3 +1,3 @@
 export default Ember.Component.extend({
-  classNames: ["channel-info"]
+  classNames: ["channel-info"],
 });
diff --git a/assets/javascripts/admin/components/channel-details.js.es6 b/assets/javascripts/admin/components/channel-details.js.es6
index 3e43a66..724ea06 100644
--- a/assets/javascripts/admin/components/channel-details.js.es6
+++ b/assets/javascripts/admin/components/channel-details.js.es6
@@ -1,4 +1,5 @@
 import { popupAjaxError } from "discourse/lib/ajax-error";
+import I18n from "I18n";
 
 export default Ember.Component.extend({
   classNames: ["channel-details"],
@@ -9,7 +10,7 @@ export default Ember.Component.extend({
         I18n.t("chat_integration.channel_delete_confirm"),
         I18n.t("no_value"),
         I18n.t("yes_value"),
-        result => {
+        (result) => {
           if (result) {
             channel
               .destroyRecord()
@@ -22,6 +23,6 @@ export default Ember.Component.extend({
 
     editRule(rule) {
       this.editRuleWithChannel(rule, this.get("channel"));
-    }
-  }
+    },
+  },
 });
diff --git a/assets/javascripts/admin/components/rule-row.js.es6 b/assets/javascripts/admin/components/rule-row.js.es6
index 6fede6d..06e72ea 100644
--- a/assets/javascripts/admin/components/rule-row.js.es6
+++ b/assets/javascripts/admin/components/rule-row.js.es6
@@ -25,6 +25,6 @@ export default Ember.Component.extend({
         .destroyRecord()
         .then(() => this.refresh())
         .catch(popupAjaxError);
-    }
-  }
+    },
+  },
 });
diff --git a/assets/javascripts/admin/controllers/admin-plugins-chat-provider.js.es6 b/assets/javascripts/admin/controllers/admin-plugins-chat-provider.js.es6
index b6c23c8..a2176db 100644
--- a/assets/javascripts/admin/controllers/admin-plugins-chat-provider.js.es6
+++ b/assets/javascripts/admin/controllers/admin-plugins-chat-provider.js.es6
@@ -8,7 +8,7 @@ export default Ember.Controller.extend({
   anyErrors(channels) {
     let anyErrors = false;
 
-    channels.forEach(channel => {
+    channels.forEach((channel) => {
       if (channel.error_key) {
         anyErrors = true;
       }
@@ -24,14 +24,14 @@ export default Ember.Controller.extend({
       const model = {
         channel: this.store.createRecord("channel", {
           provider: this.get("model.provider.id"),
-          data: {}
+          data: {},
         }),
-        provider: this.get("model.provider")
+        provider: this.get("model.provider"),
       };
 
       showModal("admin-plugins-chat-edit-channel", {
         model,
-        admin: true
+        admin: true,
       });
     },
 
@@ -40,12 +40,12 @@ export default Ember.Controller.extend({
 
       const model = {
         channel,
-        provider: this.get("model.provider")
+        provider: this.get("model.provider"),
       };
 
       showModal("admin-plugins-chat-edit-channel", {
         model,
-        admin: true
+        admin: true,
       });
     },
 
@@ -53,7 +53,7 @@ export default Ember.Controller.extend({
       this.set("modalShowing", true);
       showModal("admin-plugins-chat-test", {
         model: { channel },
-        admin: true
+        admin: true,
       });
     },
 
@@ -63,11 +63,11 @@ export default Ember.Controller.extend({
       const model = {
         rule: this.store.createRecord("rule", {
           channel_id: channel.id,
-          channel
+          channel,
         }),
         channel,
         provider: this.get("model.provider"),
-        groups: this.get("model.groups")
+        groups: this.get("model.groups"),
       };
 
       showModal("admin-plugins-chat-edit-rule", { model, admin: true });
@@ -80,7 +80,7 @@ export default Ember.Controller.extend({
         rule,
         channel,
         provider: this.get("model.provider"),
-        groups: this.get("model.groups")
+        groups: this.get("model.groups"),
       };
 
       showModal("admin-plugins-chat-edit-rule", { model, admin: true });
@@ -91,8 +91,8 @@ export default Ember.Controller.extend({
 
       showModal("admin-plugins-chat-channel-error", {
         model: channel,
-        admin: true
+        admin: true,
       });
-    }
-  }
+    },
+  },
 });

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

GitHub sha: 9327e705

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