DEV: apply coding standards (#17)

DEV: apply coding standards (#17)

diff --git a/.eslintrc b/.eslintrc
index f90cb87..7898fbf 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,96 +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,
-    "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,
-    "exists": true,
-    "File": true,
-    "fillIn": true,
-    "find": true,
-    "Handlebars": true,
-    "hasModule": true,
-    "I18n": true,
-    "invisible": 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 1c69198..36d63ff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,6 @@ auto_generated
 .DS_Store
 *.swp
 node_modules/
+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-user-notes/connectors/after-reviewable-post-user/show-user-notes-on-flags.js.es6 b/assets/javascripts/discourse-user-notes/connectors/after-reviewable-post-user/show-user-notes-on-flags.js.es6
index 1fbd18c..e8bde4b 100644
--- a/assets/javascripts/discourse-user-notes/connectors/after-reviewable-post-user/show-user-notes-on-flags.js.es6
+++ b/assets/javascripts/discourse-user-notes/connectors/after-reviewable-post-user/show-user-notes-on-flags.js.es6
@@ -1,3 +1,4 @@
+import I18n from "I18n";
 import { showUserNotes } from "discourse/plugins/discourse-user-notes/discourse-user-notes/lib/user-notes";
 import { getOwner } from "discourse-common/lib/get-owner";
 import { emojiUrlFor } from "discourse/lib/text";
@@ -14,7 +15,7 @@ export default {
       userNotesCount,
       emojiEnabled: component.siteSettings.enable_emoji,
       emojiUrl: emojiUrlFor("pencil"),
-      userNotesTitle: I18n.t("user_notes.show", { count: userNotesCount })
+      userNotesTitle: I18n.t("user_notes.show", { count: userNotesCount }),
     });
   },
 
@@ -22,7 +23,9 @@ export default {
     showUserNotes() {
       const store = getOwner(this).lookup("store:main");
       const user = this.get("args.user");
-      showUserNotes(store, user.id, count => this.set("userNotesCount", count));
-    }
-  }
+      showUserNotes(store, user.id, (count) =>
+        this.set("userNotesCount", count)
+      );
+    },
+  },
 };
diff --git a/assets/javascripts/discourse-user-notes/connectors/user-card-post-names/show-user-notes-on-card.js.es6 b/assets/javascripts/discourse-user-notes/connectors/user-card-post-names/show-user-notes-on-card.js.es6
index d64ba0e..1599e7b 100644
--- a/assets/javascripts/discourse-user-notes/connectors/user-card-post-names/show-user-notes-on-card.js.es6
+++ b/assets/javascripts/discourse-user-notes/connectors/user-card-post-names/show-user-notes-on-card.js.es6
@@ -1,3 +1,4 @@
+import I18n from "I18n";
 import { showUserNotes } from "discourse/plugins/discourse-user-notes/discourse-user-notes/lib/user-notes";
 import { getOwner } from "discourse-common/lib/get-owner";
 import { emojiUrlFor } from "discourse/lib/text";
@@ -18,7 +19,7 @@ export default {
       emojiEnabled: component.siteSettings.enable_emoji,
       emojiUrl: emojiUrlFor("pencil"),
       user,
-      userNotesTitle: I18n.t("user_notes.show", { count })
+      userNotesTitle: I18n.t("user_notes.show", { count }),
     });
   },
 
@@ -27,13 +28,13 @@ export default {
       this.parentView.parentView._close();
       const store = getOwner(this).lookup("store:main");
       const user = this.get("args.user");
-      showUserNotes(store, user.id, count => {
+      showUserNotes(store, user.id, (count) => {
         if (this.isDestroying || this.isDestroyed) {
           return;
         }
 
         this.set("userNotesCount", count);
       });
-    }
-  }
+    },
+  },
 };
diff --git a/assets/javascripts/discourse-user-notes/connectors/user-profile-controls/show-notes-on-profile.js.es6 b/assets/javascripts/discourse-user-notes/connectors/user-profile-controls/show-notes-on-profile.js.es6
index 8d3be6e..b9c837d 100644
--- a/assets/javascripts/discourse-user-notes/connectors/user-profile-controls/show-notes-on-profile.js.es6
+++ b/assets/javascripts/discourse-user-notes/connectors/user-profile-controls/show-notes-on-profile.js.es6
@@ -19,7 +19,9 @@ export default {
     showUserNotes() {
       const store = getOwner(this).lookup("store:main");
       const user = this.get("args.model");
-      showUserNotes(store, user.id, count => this.set("userNotesCount", count));
-    }
-  }
+      showUserNotes(store, user.id, (count) =>
+        this.set("userNotesCount", count)
+      );
+    },
+  },
 };
diff --git a/assets/javascripts/discourse-user-notes/lib/user-notes.js.es6 b/assets/javascripts/discourse-user-notes/lib/user-notes.js.es6
index 8a27e50..62f1448 100644
--- a/assets/javascripts/discourse-user-notes/lib/user-notes.js.es6
+++ b/assets/javascripts/discourse-user-notes/lib/user-notes.js.es6
@@ -5,18 +5,18 @@ export function showUserNotes(store, userId, callback, opts) {
   opts = opts || {};
 
   return loadScript("defer/html-sanitizer-bundle").then(() => {
-    return store.find("user-note", { user_id: userId }).then(model => {
+    return store.find("user-note", { user_id: userId }).then((model) => {
       const controller = showModal("user-notes", {
         model,
         title: "user_notes.title",
-        addModalBodyView: true
+        addModalBodyView: true,
       });
       controller.reset();
 
       controller.setProperties({
         userId: userId,
         callback: callback,
-        postId: opts.postId
+        postId: opts.postId,
       });
 
       return controller;
diff --git a/assets/javascripts/discourse/adapters/user-note.js.es6 b/assets/javascripts/discourse/adapters/user-note.js.es6
index 133ee1d..d426353 100644
--- a/assets/javascripts/discourse/adapters/user-note.js.es6
+++ b/assets/javascripts/discourse/adapters/user-note.js.es6

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

GitHub sha: 7f803698

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