DEV: Bump eslint-config-discourse (#14868)

DEV: Bump eslint-config-discourse (#14868)

Changes for Add object-shorthand rule, for properties only (#19) · discourse/eslint-config-discourse@4f7aba0 · GitHub

Also fixes all of the object-shorthand violations in our JS code.

diff --git a/app/assets/javascripts/admin/addon/components/admin-backups-logs.js b/app/assets/javascripts/admin/addon/components/admin-backups-logs.js
index f691f3f..0ae94e4 100644
--- a/app/assets/javascripts/admin/addon/components/admin-backups-logs.js
+++ b/app/assets/javascripts/admin/addon/components/admin-backups-logs.js
@@ -48,7 +48,7 @@ export default Component.extend({
     }
     // update the formatted logs & cache index
     this.setProperties({
-      formattedLogs: formattedLogs,
+      formattedLogs,
       index: logs.length,
     });
     // force rerender
diff --git a/app/assets/javascripts/admin/addon/components/admin-graph.js b/app/assets/javascripts/admin/addon/components/admin-graph.js
index 8df160a..1107abe 100644
--- a/app/assets/javascripts/admin/addon/components/admin-graph.js
+++ b/app/assets/javascripts/admin/addon/components/admin-graph.js
@@ -24,7 +24,7 @@ export default Component.extend({
 
     const config = {
       type: this.type,
-      data: data,
+      data,
       options: {
         responsive: true,
         plugins: {
diff --git a/app/assets/javascripts/admin/addon/components/secret-value-list.js b/app/assets/javascripts/admin/addon/components/secret-value-list.js
index cd63e3b..ab79dad 100644
--- a/app/assets/javascripts/admin/addon/components/secret-value-list.js
+++ b/app/assets/javascripts/admin/addon/components/secret-value-list.js
@@ -63,7 +63,7 @@ export default Component.extend({
   },
 
   _addValue(value, secret) {
-    this.collection.addObject({ key: value, secret: secret });
+    this.collection.addObject({ key: value, secret });
     this._saveValues();
   },
 
diff --git a/app/assets/javascripts/admin/addon/controllers/admin-logs-staff-action-logs.js b/app/assets/javascripts/admin/addon/controllers/admin-logs-staff-action-logs.js
index 2758a10..670d48c 100644
--- a/app/assets/javascripts/admin/addon/controllers/admin-logs-staff-action-logs.js
+++ b/app/assets/javascripts/admin/addon/controllers/admin-logs-staff-action-logs.js
@@ -121,7 +121,7 @@ export default Controller.extend({
     },
 
     filterBySubject(subject) {
-      this.changeFilters({ subject: subject });
+      this.changeFilters({ subject });
     },
 
     exportStaffActionLogs() {
diff --git a/app/assets/javascripts/admin/addon/controllers/admin-user-badges.js b/app/assets/javascripts/admin/addon/controllers/admin-user-badges.js
index 2c5212e..d784c31 100644
--- a/app/assets/javascripts/admin/addon/controllers/admin-user-badges.js
+++ b/app/assets/javascripts/admin/addon/controllers/admin-user-badges.js
@@ -49,7 +49,7 @@ export default Controller.extend(GrantBadgeController, {
       let result = {
         badge: badges[0].badge,
         granted_at: lastGranted,
-        badges: badges,
+        badges,
         count: badges.length,
         grouped: true,
       };
diff --git a/app/assets/javascripts/admin/addon/controllers/admin-user-index.js b/app/assets/javascripts/admin/addon/controllers/admin-user-index.js
index 22345e8..fdd21f7 100644
--- a/app/assets/javascripts/admin/addon/controllers/admin-user-index.js
+++ b/app/assets/javascripts/admin/addon/controllers/admin-user-index.js
@@ -592,7 +592,7 @@ export default Controller.extend(CanCheckEmails, {
                 (deletedPosts * 100) / user.get("post_count")
               );
               progressModal.setProperties({
-                deletedPercentage: deletedPercentage,
+                deletedPercentage,
               });
               performDelete(progressModal);
             }
diff --git a/app/assets/javascripts/admin/addon/models/permalink.js b/app/assets/javascripts/admin/addon/models/permalink.js
index a2e8445..f9ed524 100644
--- a/app/assets/javascripts/admin/addon/models/permalink.js
+++ b/app/assets/javascripts/admin/addon/models/permalink.js
@@ -35,11 +35,11 @@ const Permalink = EmberObject.extend({
 
 Permalink.reopenClass({
   findAll: function (filter) {
-    return ajax("/admin/permalinks.json", { data: { filter: filter } }).then(
-      function (permalinks) {
-        return permalinks.map((p) => Permalink.create(p));
-      }
-    );
+    return ajax("/admin/permalinks.json", { data: { filter } }).then(function (
+      permalinks
+    ) {
+      return permalinks.map((p) => Permalink.create(p));
+    });
   },
 });
 
diff --git a/app/assets/javascripts/admin/addon/models/report.js b/app/assets/javascripts/admin/addon/models/report.js
index 57d9bb6..fb1eef0 100644
--- a/app/assets/javascripts/admin/addon/models/report.js
+++ b/app/assets/javascripts/admin/addon/models/report.js
@@ -672,7 +672,7 @@ Report.reopenClass({
         Report.fillMissingDates(json.report);
       }
 
-      const model = Report.create({ type: type });
+      const model = Report.create({ type });
       model.setProperties(json.report);
 
       if (json.report.related_report) {
diff --git a/app/assets/javascripts/admin/addon/models/screened-ip-address.js b/app/assets/javascripts/admin/addon/models/screened-ip-address.js
index a7d29aa..7389509 100644
--- a/app/assets/javascripts/admin/addon/models/screened-ip-address.js
+++ b/app/assets/javascripts/admin/addon/models/screened-ip-address.js
@@ -42,7 +42,7 @@ const ScreenedIpAddress = EmberObject.extend({
 ScreenedIpAddress.reopenClass({
   findAll(filter) {
     return ajax("/admin/logs/screened_ip_addresses.json", {
-      data: { filter: filter },
+      data: { filter },
     }).then((screened_ips) =>
       screened_ips.map((b) => ScreenedIpAddress.create(b))
     );
diff --git a/app/assets/javascripts/admin/addon/models/web-hook.js b/app/assets/javascripts/admin/addon/models/web-hook.js
index 8dd568a..1b74d50 100644
--- a/app/assets/javascripts/admin/addon/models/web-hook.js
+++ b/app/assets/javascripts/admin/addon/models/web-hook.js
@@ -44,7 +44,7 @@ export default RestModel.extend({
   },
 
   groupFinder(term) {
-    return Group.findAll({ term: term, ignore_automatic: false });
+    return Group.findAll({ term, ignore_automatic: false });
   },
 
   @discourseComputed("wildcard_web_hook", "web_hook_event_types.[]")
diff --git a/app/assets/javascripts/admin/addon/routes/admin-badges.js b/app/assets/javascripts/admin/addon/routes/admin-badges.js
index ac4b9e9..c966b7a 100644
--- a/app/assets/javascripts/admin/addon/routes/admin-badges.js
+++ b/app/assets/javascripts/admin/addon/routes/admin-badges.js
@@ -32,7 +32,7 @@ export default DiscourseRoute.extend({
     });
 
     controller.setProperties({
-      badgeGroupings: badgeGroupings,
+      badgeGroupings,
       badgeTypes: json.badge_types,
       protectedSystemFields: json.admin_badges.protected_system_fields,
       badgeTriggers,
diff --git a/app/assets/javascripts/admin/addon/routes/admin-customize-themes-show.js b/app/assets/javascripts/admin/addon/routes/admin-customize-themes-show.js
index 5bcf95d..58760b4 100644
--- a/app/assets/javascripts/admin/addon/routes/admin-customize-themes-show.js
+++ b/app/assets/javascripts/admin/addon/routes/admin-customize-themes-show.js
@@ -39,8 +39,8 @@ export default Route.extend({
     });
 
     controller.setProperties({
-      model: model,
-      parentController: parentController,
+      model,
+      parentController,
       allThemes: parentController.get("model"),
       colorSchemeId: model.get("color_scheme_id"),
       colorSchemes: parentController.get("model.extras.color_schemes"),
diff --git a/app/assets/javascripts/admin/addon/routes/admin-site-text-edit.js b/app/assets/javascripts/admin/addon/routes/admin-site-text-edit.js
index 40c74fc..9a9677b 100644
--- a/app/assets/javascripts/admin/addon/routes/admin-site-text-edit.js
+++ b/app/assets/javascripts/admin/addon/routes/admin-site-text-edit.js
@@ -24,7 +24,7 @@ export default Route.extend({
     controller.setProperties({
       siteText,
       saved: false,
-      localeFullName: localeFullName,
+      localeFullName,
     });
   },
 });

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

GitHub sha: 23b7b42acd1efda21cf8c80a45057be5a705ac57

This commit appears in #14868 which was approved by lis2. It was merged by martin.