REFACTOR: old patterns and deprecations (#12)

REFACTOR: old patterns and deprecations (#12)

diff --git a/.eslintrc b/.eslintrc
index e5dde25..a656e80 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,85 +1,80 @@
 {
   "env": {
+    "browser": true,
+    "builtin": true,
+    "es6": true,
     "jasmine": true,
-    "node": true,
     "mocha": true,
-    "browser": true,
-    "builtin": true
+    "node": 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,
+    "_": true,
     "andThen": true,
+    "asyncRender": true,
+    "Blob": true,
+    "bootbox": true,
     "click": true,
+    "waitUntil": true,
+    "getSettledState": true,
+    "count": true,
     "currentPath": true,
     "currentRouteName": true,
     "currentURL": true,
-    "fillIn": true,
-    "keyEvent": true,
-    "triggerEvent": true,
-    "count": true,
+    "define": true,
+    "Discourse": true,
+    "Ember": true,
     "exists": true,
-    "visible": true,
-    "invisible": true,
-    "asyncRender": true,
-    "selectDropdown": true,
-    "asyncTestDiscourse": true,
-    "fixture": true,
+    "File": true,
+    "fillIn": true,
     "find": true,
-    "sinon": true,
+    "Handlebars": true,
+    "hasModule": true,
+    "I18n": true,
+    "invisible": true,
+    "jQuery": true,
+    "keyboardHelper": true,
+    "keyEvent": true,
+    "moduleFor": true,
+    "moduleForComponent": true,
     "moment": true,
-    "start": true,
-    "_": true,
-    "alert": true,
-    "containsInstance": true,
-    "deepEqual": true,
-    "notEqual": true,
-    "define": true,
+    "Pretender": true,
+    "QUnit": true,
     "require": true,
     "requirejs": true,
-    "hasModule": true,
-    "Blob": true,
-    "File": 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,
@@ -87,6 +82,8 @@
     "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,
diff --git a/assets/javascripts/discourse-user-notes/connectors/flagged-post-controls/show-user-notes-on-flags.js.es6 b/assets/javascripts/discourse-user-notes/connectors/flagged-post-controls/show-user-notes-on-flags.js.es6
index 980c6cc..20afc9c 100644
--- a/assets/javascripts/discourse-user-notes/connectors/flagged-post-controls/show-user-notes-on-flags.js.es6
+++ b/assets/javascripts/discourse-user-notes/connectors/flagged-post-controls/show-user-notes-on-flags.js.es6
@@ -7,7 +7,7 @@ export default {
   },
 
   setupComponent(args, component) {
-    let model = args.flaggedPost.get("user");
+    const model = args.flaggedPost.user;
     component.set(
       "userNotesCount",
       model.get("custom_fields.user_notes_count") || 0
@@ -18,7 +18,7 @@ export default {
     showUserNotes() {
       const store = getOwner(this).lookup("store:main");
       const user = this.get("args.flaggedPost.user");
-      showUserNotes(store, user.get("id"), 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 ebcdbaf..d64ba0e 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
@@ -11,14 +11,15 @@ export default {
   setupComponent(args, component) {
     const { user } = args;
     const count =
-      user.get("user_notes_count") ||
-      user.get("custom_fields.user_notes_count") ||
-      0;
-    component.set("userNotesCount", count);
-    component.set("emojiEnabled", component.siteSettings.enable_emoji);
-    component.set("emojiUrl", emojiUrlFor("pencil"));
-    component.set("user", user);
-    component.set("userNotesTitle", I18n.t("user_notes.show", { count }));
+      user.user_notes_count || user.get("custom_fields.user_notes_count") || 0;
+
+    component.setProperties({
+      userNotesCount: count,
+      emojiEnabled: component.siteSettings.enable_emoji,
+      emojiUrl: emojiUrlFor("pencil"),
+      user,
+      userNotesTitle: I18n.t("user_notes.show", { count })
+    });
   },
 
   actions: {
@@ -26,7 +27,7 @@ export default {
       this.parentView.parentView._close();
       const store = getOwner(this).lookup("store:main");
       const user = this.get("args.user");
-      showUserNotes(store, user.get("id"), count => {
+      showUserNotes(store, user.id, count => {
         if (this.isDestroying || this.isDestroyed) {
           return;
         }
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 f094aac..8d3be6e 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
@@ -11,9 +11,7 @@ export default {
     const { model } = args;
     component.set(
       "userNotesCount",
-      model.get("user_notes_count") ||
-        model.get("custom_fields.user_notes_count") ||
-        0
+      model.user_notes_count || model.get("custom_fields.user_notes_count") || 0
     );
   },
 
@@ -21,9 +19,7 @@ export default {
     showUserNotes() {
       const store = getOwner(this).lookup("store:main");
       const user = this.get("args.model");
-      showUserNotes(store, user.get("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 f9e2358..8a27e50 100644
--- a/assets/javascripts/discourse-user-notes/lib/user-notes.js.es6
+++ b/assets/javascripts/discourse-user-notes/lib/user-notes.js.es6
@@ -12,9 +12,13 @@ export function showUserNotes(store, userId, callback, opts) {
         addModalBodyView: true
       });
       controller.reset();
-      controller.set("userId", userId);
-      controller.set("callback", callback);
-      controller.set("postId", opts.postId);
+
+      controller.setProperties({
+        userId: userId,
+        callback: callback,
+        postId: opts.postId
+      });
+
       return controller;
     });
   });
diff --git a/assets/javascripts/discourse-user-notes/templates/connectors/admin-user-controls-after/add-user-notes-button.hbs b/assets/javascripts/discourse-user-notes/templates/connectors/admin-user-controls-after/add-user-notes-button.hbs
index a0e3cb4..6a269cc 100644

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

GitHub sha: 1ef308e4