DEV: apply coding standards to plugins (#10594)

DEV: apply coding standards to plugins (#10594)

diff --git a/plugins/discourse-details/assets/javascripts/initializers/apply-details.js.es6 b/plugins/discourse-details/assets/javascripts/initializers/apply-details.js.es6
index 24ee6e1..a086779 100644
--- a/plugins/discourse-details/assets/javascripts/initializers/apply-details.js.es6
+++ b/plugins/discourse-details/assets/javascripts/initializers/apply-details.js.es6
@@ -2,15 +2,15 @@ import I18n from "I18n";
 import { withPluginApi } from "discourse/lib/plugin-api";
 
 function initializeDetails(api) {
-  api.decorateCooked($elem => $("details", $elem), {
-    id: "discourse-details"
+  api.decorateCooked(($elem) => $("details", $elem), {
+    id: "discourse-details",
   });
 
   api.addToolbarPopupMenuOptionsCallback(() => {
     return {
       action: "insertDetails",
       icon: "caret-right",
-      label: "details.title"
+      label: "details.title",
     };
   });
 
@@ -23,8 +23,8 @@ function initializeDetails(api) {
           "details_text",
           { multiline: false }
         );
-      }
-    }
+      },
+    },
   });
 }
 
@@ -33,5 +33,5 @@ export default {
 
   initialize() {
     withPluginApi("0.8.7", initializeDetails);
-  }
+  },
 };
diff --git a/plugins/discourse-details/assets/javascripts/lib/discourse-markdown/details.js.es6 b/plugins/discourse-details/assets/javascripts/lib/discourse-markdown/details.js.es6
index 93b5b7b..7ad6077 100644
--- a/plugins/discourse-details/assets/javascripts/lib/discourse-markdown/details.js.es6
+++ b/plugins/discourse-details/assets/javascripts/lib/discourse-markdown/details.js.es6
@@ -1,6 +1,6 @@
 const rule = {
   tag: "details",
-  before: function(state, tagInfo) {
+  before: function (state, tagInfo) {
     const attrs = tagInfo.attrs;
     state.push("bbcode_open", "details", 1);
     state.push("bbcode_open", "summary", 1);
@@ -11,9 +11,9 @@ const rule = {
     state.push("bbcode_close", "summary", -1);
   },
 
-  after: function(state) {
+  after: function (state) {
     state.push("bbcode_close", "details", -1);
-  }
+  },
 };
 
 export function setup(helper) {
@@ -22,10 +22,10 @@ export function setup(helper) {
     "summary[title]",
     "details",
     "details[open]",
-    "details.elided"
+    "details.elided",
   ]);
 
-  helper.registerPlugin(md => {
+  helper.registerPlugin((md) => {
     md.block.bbcode.ruler.push("details", rule);
   });
 }
diff --git a/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6 b/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6
index dd4050e..e304337 100644
--- a/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6
+++ b/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6
@@ -40,27 +40,27 @@ export default Component.extend({
       timezones: [],
       formats: (this.siteSettings.discourse_local_dates_default_formats || "")
         .split("|")
-        .filter(f => f),
+        .filter((f) => f),
       timezone: moment.tz.guess(),
-      date: moment().format(this.dateFormat)
+      date: moment().format(this.dateFormat),
     });
   },
 
   didInsertElement() {
     this._super(...arguments);
 
-    this._setupPicker().then(picker => {
+    this._setupPicker().then((picker) => {
       this._picker = picker;
       this.send("focusFrom");
     });
   },
 
   @observes("markup")
-  _renderPreview: discourseDebounce(function() {
+  _renderPreview: discourseDebounce(function () {
     const markup = this.markup;
 
     if (markup) {
-      cookAsync(markup).then(result => {
+      cookAsync(markup).then((result) => {
         this.set("currentPreview", result);
         schedule("afterRender", () =>
           this.$(".preview .discourse-local-date").applyLocalDates()
@@ -121,7 +121,7 @@ export default Component.extend({
       time,
       dateTime,
       format,
-      range: isRange ? "start" : false
+      range: isRange ? "start" : false,
     });
   },
 
@@ -154,7 +154,7 @@ export default Component.extend({
       time,
       dateTime,
       format,
-      range: isRange ? "end" : false
+      range: isRange ? "end" : false,
     });
   },
 
@@ -164,7 +164,7 @@ export default Component.extend({
       recurring,
       timezones,
       timezone,
-      format
+      format,
     });
   },
 
@@ -177,7 +177,7 @@ export default Component.extend({
     return EmberObject.create({
       from: fromConfig,
       to: toConfig,
-      options
+      options,
     });
   },
 
@@ -198,18 +198,15 @@ export default Component.extend({
 
   @computed("currentUserTimezone")
   formatedCurrentUserTimezone(timezone) {
-    return timezone
-      .replace("_", " ")
-      .replace("Etc/", "")
-      .split("/");
+    return timezone.replace("_", " ").replace("Etc/", "").split("/");
   },
 
   @computed("formats")
   previewedFormats(formats) {
-    return formats.map(format => {
+    return formats.map((format) => {
       return {
         format: format,
-        preview: moment().format(format)
+        preview: moment().format(format),
       };
     });
   },
@@ -221,36 +218,36 @@ export default Component.extend({
     return [
       {
         name: I18n.t(`${key}.every_day`),
-        id: "1.days"
+        id: "1.days",
       },
       {
         name: I18n.t(`${key}.every_week`),
-        id: "1.weeks"
+        id: "1.weeks",
       },
       {
         name: I18n.t(`${key}.every_two_weeks`),
-        id: "2.weeks"
+        id: "2.weeks",
       },
       {
         name: I18n.t(`${key}.every_month`),
-        id: "1.months"
+        id: "1.months",
       },
       {
         name: I18n.t(`${key}.every_two_months`),
-        id: "2.months"
+        id: "2.months",
       },
       {
         name: I18n.t(`${key}.every_three_months`),
-        id: "3.months"
+        id: "3.months",
       },
       {
         name: I18n.t(`${key}.every_six_months`),
-        id: "6.months"
+        id: "6.months",
       },
       {
         name: I18n.t(`${key}.every_year`),
-        id: "1.years"
-      }
+        id: "1.years",
+      },
     ];
   },
 
@@ -360,7 +357,7 @@ export default Component.extend({
 
     cancel() {
       this._closeModal();
-    }
+    },
   },
 
   _setTimeIfValid(time, key) {
@@ -375,7 +372,7 @@ export default Component.extend({
   },
 
   _setupPicker() {
-    return new Promise(resolve => {
+    return new Promise((resolve) => {
       loadScript("/javascripts/pikaday.js").then(() => {
         const options = {
           field: this.$(`.fake-input`)[0],
@@ -391,9 +388,9 @@ export default Component.extend({
             nextMonth: I18n.t("dates.next_month"),
             months: moment.months(),
             weekdays: moment.weekdays(),
-            weekdaysShort: moment.weekdaysMin()
+            weekdaysShort: moment.weekdaysMin(),
           },
-          onSelect: date => {
+          onSelect: (date) => {
             const formattedDate = moment(date).format("YYYY-MM-DD");
 
             if (this.fromSelected) {
@@ -403,7 +400,7 @@ export default Component.extend({
             if (this.toSelected) {
               this.set("toDate", formattedDate);
             }
-          }
+          },
         };
 
         resolve(new Pikaday(options));
@@ -434,5 +431,5 @@ export default Component.extend({
   _closeModal() {
     const composer = Discourse.__container__.lookup("controller:composer");
     composer.send("closeModal");
-  }
+  },
 });
diff --git a/plugins/discourse-local-dates/assets/javascripts/discourse/controllers/discourse-local-dates-create-modal.js.es6 b/plugins/discourse-local-dates/assets/javascripts/discourse/controllers/discourse-local-dates-create-modal.js.es6
index 103ac02..a27b641 100644
--- a/plugins/discourse-local-dates/assets/javascripts/discourse/controllers/discourse-local-dates-create-modal.js.es6

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

GitHub sha: bf884101

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