DEV: unpin Prettier version, apply to YAML files

DEV: unpin Prettier version, apply to YAML files

We had Prettier pinned because of 1.15 introduces JS syntax error regression · Issue #5529 · prettier/prettier · GitHub. Since that bug is fixed, unpinning.

Prettier now supports YAML, so this applies Prettier to all .yml except for translations, which should not be edited directly anyway.

diff --git a/.prettierignore b/.prettierignore
index ab6bcfe..6213772 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,3 +1,5 @@
 app/assets/stylesheets/vendor/
 plugins/**/assets/stylesheets/vendor/
 package.json
+config/locales/**/*.yml
+!config/locales/**/*.en.yml
diff --git a/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 b/app/assets/javascripts/admin/controllers/admin-user-index.js.es6
index 21599cc..a67591e 100644
--- a/app/assets/javascripts/admin/controllers/admin-user-index.js.es6
+++ b/app/assets/javascripts/admin/controllers/admin-user-index.js.es6
@@ -301,9 +301,11 @@ export default Ember.Controller.extend(CanCheckEmails, {
       const bufferedIds = this.get("customGroupIdsBuffer");
       const availableGroups = this.get("availableGroups");
 
-      bufferedIds.filter(id => !currentIds.includes(id)).forEach(id => {
-        this.groupAdded(availableGroups.findBy("id", id));
-      });
+      bufferedIds
+        .filter(id => !currentIds.includes(id))
+        .forEach(id => {
+          this.groupAdded(availableGroups.findBy("id", id));
+        });
 
       currentIds
         .filter(id => !bufferedIds.includes(id))
diff --git a/app/assets/javascripts/discourse/components/composer-messages.js.es6 b/app/assets/javascripts/discourse/components/composer-messages.js.es6
index b24657b..1a329fb 100644
--- a/app/assets/javascripts/discourse/components/composer-messages.js.es6
+++ b/app/assets/javascripts/discourse/components/composer-messages.js.es6
@@ -205,11 +205,10 @@ export default Ember.Component.extend({
 
       this.set("checkedMessages", true);
       const queuedForTyping = this.get("queuedForTyping");
-      messages.forEach(
-        msg =>
-          msg.wait_for_typing
-            ? queuedForTyping.addObject(msg)
-            : this.send("popup", msg)
+      messages.forEach(msg =>
+        msg.wait_for_typing
+          ? queuedForTyping.addObject(msg)
+          : this.send("popup", msg)
       );
     };
 
diff --git a/app/assets/javascripts/discourse/components/composer-toggles.js.es6 b/app/assets/javascripts/discourse/components/composer-toggles.js.es6
index f1fe514..f618e1c 100644
--- a/app/assets/javascripts/discourse/components/composer-toggles.js.es6
+++ b/app/assets/javascripts/discourse/components/composer-toggles.js.es6
@@ -15,8 +15,8 @@ export default Ember.Component.extend({
     return composeState === "draft"
       ? "composer.open"
       : composeState === "fullscreen"
-        ? "composer.exit_fullscreen"
-        : "composer.enter_fullscreen";
+      ? "composer.exit_fullscreen"
+      : "composer.enter_fullscreen";
   },
 
   @computed("composeState")
@@ -31,7 +31,7 @@ export default Ember.Component.extend({
     return composeState === "draft"
       ? "chevron-up"
       : composeState === "fullscreen"
-        ? "discourse-compress"
-        : "discourse-expand";
+      ? "discourse-compress"
+      : "discourse-expand";
   }
 });
diff --git a/app/assets/javascripts/discourse/components/group-selector.js.es6 b/app/assets/javascripts/discourse/components/group-selector.js.es6
index df42b39..8746b01 100644
--- a/app/assets/javascripts/discourse/components/group-selector.js.es6
+++ b/app/assets/javascripts/discourse/components/group-selector.js.es6
@@ -27,8 +27,8 @@ export default Ember.Component.extend({
       items: _.isArray(groupNames)
         ? groupNames
         : Ember.isEmpty(groupNames)
-          ? []
-          : [groupNames],
+        ? []
+        : [groupNames],
       single: this.get("single"),
       updateData: opts && opts.updateData ? opts.updateData : false,
       onChangeItems: items => {
diff --git a/app/assets/javascripts/discourse/controllers/preferences/account.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/account.js.es6
index d98fe12..1bd1beb 100644
--- a/app/assets/javascripts/discourse/controllers/preferences/account.js.es6
+++ b/app/assets/javascripts/discourse/controllers/preferences/account.js.es6
@@ -106,13 +106,8 @@ export default Ember.Controller.extend(
 
     @computed("showAllAuthTokens", "model.user_auth_tokens")
     authTokens(showAllAuthTokens, tokens) {
-      tokens.sort(
-        (a, b) =>
-          a.is_active
-            ? -1
-            : b.is_active
-              ? 1
-              : b.seen_at.localeCompare(a.seen_at)
+      tokens.sort((a, b) =>
+        a.is_active ? -1 : b.is_active ? 1 : b.seen_at.localeCompare(a.seen_at)
       );
 
       return showAllAuthTokens
diff --git a/app/assets/javascripts/discourse/lib/formatter.js.es6 b/app/assets/javascripts/discourse/lib/formatter.js.es6
index ebcf8f8..2d5961a 100644
--- a/app/assets/javascripts/discourse/lib/formatter.js.es6
+++ b/app/assets/javascripts/discourse/lib/formatter.js.es6
@@ -1,15 +1,15 @@
 /* global BreakString:true */
 
 /*
-* memoize.js
-* by @philogb and @addyosmani
-* with further optimizations by @mathias
-* and @DmitryBaranovsk
-* perf tests: http://bit.ly/q3zpG3
-* Released under an MIT license.
-*
-* modified with cap by Sam
-*/
+ * memoize.js
+ * by @philogb and @addyosmani
+ * with further optimizations by @mathias
+ * and @DmitryBaranovsk
+ * perf tests: http://bit.ly/q3zpG3
+ * Released under an MIT license.
+ *
+ * modified with cap by Sam
+ */
 function cappedMemoize(fn, max) {
   fn.maxMemoize = max;
   fn.memoizeLength = 0;
diff --git a/app/assets/javascripts/discourse/lib/page-visible.js.es6 b/app/assets/javascripts/discourse/lib/page-visible.js.es6
index 1c6c746..3025433 100644
--- a/app/assets/javascripts/discourse/lib/page-visible.js.es6
+++ b/app/assets/javascripts/discourse/lib/page-visible.js.es6
@@ -3,8 +3,8 @@ var hiddenProperty =
   document.hidden !== undefined
     ? "hidden"
     : document.webkitHidden !== undefined
-      ? "webkitHidden"
-      : undefined;
+    ? "webkitHidden"
+    : undefined;
 
 export default function() {
   if (hiddenProperty !== undefined) {
diff --git a/app/assets/javascripts/ember-addons/fmt.js.es6 b/app/assets/javascripts/ember-addons/fmt.js.es6
index 5d3938a..556ffde 100644
--- a/app/assets/javascripts/ember-addons/fmt.js.es6
+++ b/app/assets/javascripts/ember-addons/fmt.js.es6
@@ -21,9 +21,9 @@ export default function(str, formats) {
     return typeof s === "string"
       ? s
       : s === null
-        ? "(null)"
-        : s === undefined
-          ? ""
-          : "" + s;
+      ? "(null)"
+      : s === undefined
+      ? ""
+      : "" + s;
   });
 }
diff --git a/config/cloud/cloud66/deploy_hooks.yml b/config/cloud/cloud66/deploy_hooks.yml
index 6d97157..72930d1 100644
--- a/config/cloud/cloud66/deploy_hooks.yml
+++ b/config/cloud/cloud66/deploy_hooks.yml
@@ -1,224 +1,224 @@
 production:
-    first_thing:
+  first_thing:
     # 1. Permissions on postgres box
-      - source: /config/cloud/cloud66/scripts/permissions.sh
-        destination: /tmp/scripts/permissions.sh
-        target: postgresql
-        apply_during: build_only
-        execute: true
-        sudo: true
-    after_postgresql:
+    - source: /config/cloud/cloud66/scripts/permissions.sh
+      destination: /tmp/scripts/permissions.sh
+      target: postgresql
+      apply_during: build_only
+      execute: true
+      sudo: true
+  after_postgresql:
     # 2. Copy SQL image to PSQL server
-      - source: /pg_dumps/production-image.sql
-        destination: /tmp/images/production-image.sql
-        target: postgresql
-        apply_during: build_only
-        owner: postgres
-    after_checkout:
+    - source: /pg_dumps/production-image.sql
+      destination: /tmp/images/production-image.sql
+      target: postgresql
+      apply_during: build_only
+      owner: postgres
+  after_checkout:
     # 3. Copy Procfile
-      - source: /config/cloud/cloud66/files/Procfile
-        destination: <%= ENV['RAILS_STACK_PATH'] %>/Procfile
-        target: rails
-        run_on: all_servers
+    - source: /config/cloud/cloud66/files/Procfile
+      destination: <%= ENV['RAILS_STACK_PATH'] %>/Procfile
+      target: rails
+      run_on: all_servers

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

GitHub sha: 3501533a

2 Likes

:heart: for linting YAML automatically :clap:

3 Likes