DEV: apply coding standards (#66)

DEV: apply coding standards (#66)

diff --git a/.eslintrc b/.eslintrc
index b24111e..7898fbf 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,99 +1,3 @@
 {
-  "env": {
-    "browser": true,
-    "builtin": true,
-    "es6": true,
-    "jasmine": true,
-    "mocha": true,
-    "node": true
-  },
-  "parserOptions": {
-    "ecmaVersion": 7,
-    "sourceType": "module",
-    "ecmaFeatures": {
-      "legacyDecorators": true
-    }
-  },
-  "globals": {
-    "$": true,
-    "_": true,
-    "andThen": true,
-    "asyncRender": true,
-    "Blob": true,
-    "bootbox": true,
-    "click": true,
-    "waitUntil": true,
-    "getSettledState": true,
-    "count": true,
-    "currentPath": true,
-    "currentRouteName": true,
-    "currentURL": true,
-    "define": true,
-    "Discourse": true,
-    "Ember": true,
-    "exists": true,
-    "File": true,
-    "fillIn": true,
-    "find": true,
-    "Handlebars": true,
-    "hasModule": true,
-    "I18n": true,
-    "invisible": true,
-    "jQuery": true,
-    "keyboardHelper": true,
-    "keyEvent": true,
-    "moduleFor": true,
-    "moduleForComponent": true,
-    "moment": true,
-    "Pretender": true,
-    "QUnit": true,
-    "require": true,
-    "requirejs": true,
-    "RSVP": true,
-    "sandbox": true,
-    "sinon": true,
-    "test": true,
-    "triggerEvent": true,
-    "visible": true,
-    "visit": true,
-    "pauseTest": true
-  },
-  "rules": {
-    "block-scoped-var": 2,
-    "dot-notation": 0,
-    "eqeqeq": [2, "allow-null"],
-    "guard-for-in": 2,
-    "no-alert": 2,
-    "no-bitwise": 2,
-    "no-caller": 2,
-    "no-cond-assign": 0,
-    "no-console": 2,
-    "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-mixed-spaces-and-tabs": 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-this-before-super": 2,
-    "no-trailing-spaces": 2,
-    "no-undef": 2,
-    "no-unused-vars": 2,
-    "no-with": 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 69bebcd..868469a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,6 @@ auto_generated
 *.swp
 *.swo
 node_modules/
-.idea/
\ No newline at end of file
+.idea/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/components/explorer-container.js.es6 b/assets/javascripts/discourse/components/explorer-container.js.es6
index ff93dfb..e2f9181 100644
--- a/assets/javascripts/discourse/components/explorer-container.js.es6
+++ b/assets/javascripts/discourse/components/explorer-container.js.es6
@@ -34,7 +34,7 @@ export default Ember.Component.extend({
 
     this.set("grippie", $grippie);
 
-    const mousemove = e => {
+    const mousemove = (e) => {
       const diffY = this.startY - e.screenY;
       const diffX = this.startX - e.screenX;
 
@@ -47,7 +47,7 @@ export default Ember.Component.extend({
       this.appEvents.trigger("ace:resize");
     };
 
-    const throttledMousemove = (event => {
+    const throttledMousemove = ((event) => {
       event.preventDefault();
       Ember.run.throttle(this, mousemove, event, 20);
     }).bind(this);
@@ -59,16 +59,16 @@ export default Ember.Component.extend({
         startY: null,
         startX: null,
         startHeight: null,
-        startWidth: null
+        startWidth: null,
       });
     }).bind(this);
 
-    $grippie.on("mousedown", e => {
+    $grippie.on("mousedown", (e) => {
       this.setProperties({
         startY: e.screenY,
         startX: e.screenX,
         startHeight: $target.height(),
-        startWidth: $target.width()
+        startWidth: $target.width(),
       });
 
       $document.on("mousemove", throttledMousemove);
@@ -90,5 +90,5 @@ export default Ember.Component.extend({
       this.grippie && this.grippie.off("mousedown");
       this.set("grippie", null);
     }
-  }
+  },
 });
diff --git a/assets/javascripts/discourse/components/explorer-schema-enuminfo.js.es6 b/assets/javascripts/discourse/components/explorer-schema-enuminfo.js.es6
index b35b780..d5a652a 100644
--- a/assets/javascripts/discourse/components/explorer-schema-enuminfo.js.es6
+++ b/assets/javascripts/discourse/components/explorer-schema-enuminfo.js.es6
@@ -13,5 +13,5 @@ export default Ember.Component.extend({
       result.push({ value: key, name: hash[key] });
     }
     return result;
-  }
+  },
 });
diff --git a/assets/javascripts/discourse/components/explorer-schema-onetable.js.es6 b/assets/javascripts/discourse/components/explorer-schema-onetable.js.es6
index ace12e1..9ddb7f4 100644
--- a/assets/javascripts/discourse/components/explorer-schema-onetable.js.es6
+++ b/assets/javascripts/discourse/components/explorer-schema-onetable.js.es6
@@ -10,7 +10,7 @@ export default Ember.Component.extend({
   _bindClicks() {
     $(this.element)
       .find(".schema-table-name")
-      .click(e => {
+      .click((e) => {
         this.set("table.open", !this.table.open);
         e.preventDefault();
       });
@@ -18,8 +18,6 @@ export default Ember.Component.extend({
 
   @on("willDestroyElement")
   _cleanup() {
-    $(this.element)
-      .find(".schema-table-name")
-      .off("click");
-  }
+    $(this.element).find(".schema-table-name").off("click");
+  },
 });
diff --git a/assets/javascripts/discourse/components/explorer-schema.js.es6 b/assets/javascripts/discourse/components/explorer-schema.js.es6
index ab69109..8ad3d02 100644
--- a/assets/javascripts/discourse/components/explorer-schema.js.es6
+++ b/assets/javascripts/discourse/components/explorer-schema.js.es6
@@ -1,6 +1,6 @@
 import {
   default as computed,
-  observes
+  observes,
 } from "discourse-common/utils/decorators";
 import debounce from "discourse/lib/debounce";
 
@@ -8,7 +8,7 @@ export default Ember.Component.extend({
   actions: {
     collapseSchema() {
       this.set("hideSchema", true);
-    }
+    },
   },
 
   @computed("schema")
@@ -18,7 +18,7 @@ export default Ember.Component.extend({
         continue;
       }
 
-      schema[key].forEach(col => {
+      schema[key].forEach((col) => {
         const notes_components = [];
         if (col.primary) {
           notes_components.push("primary key");
@@ -71,7 +71,7 @@ export default Ember.Component.extend({
         tables.push({
           name: key,
           columns: schema[key],
-          open: false
+          open: false,
         });
         continue;
       }
@@ -81,19 +81,19 @@ export default Ember.Component.extend({
         tables.unshift({
           name: key,
           columns: schema[key],
-          open: haveFilter
+          open: haveFilter,
         });
       } else if (filter.test(key)) {
         // whole table matches
         tables.push({
           name: key,
           columns: schema[key],
-          open: haveFilter
+          open: haveFilter,
         });
       } else {
         // filter the columns
         let filterCols = [];
-        schema[key].forEach(col => {
+        schema[key].forEach((col) => {
           if (filter.source === col.column_name) {
             filterCols.unshift(col);
           } else if (filter.test(col.column_name)) {
@@ -104,7 +104,7 @@ export default Ember.Component.extend({
           tables.push({
             name: key,
             columns: filterCols,
-            open: haveFilter
+            open: haveFilter,
           });
         }
       }

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

GitHub sha: e0a3ad12

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