Pin Prettier to 1.14.3

Pin Prettier to 1.14.3

From 7fd9e9e3200a6ca14648230e4a9e6d337e4c2531 Mon Sep 17 00:00:00 2001
From: Penar Musaraj <pmusaraj@gmail.com>
Date: Thu, 22 Nov 2018 15:51:04 -0500
Subject: [PATCH] Pin Prettier to 1.14.3


diff --git a/package.json b/package.json
index ae98ed4..f3103c1 100644
--- a/package.json
+++ b/package.json
@@ -31,7 +31,7 @@
     "chrome-remote-interface": "^0.25",
     "eslint": "^4.19",
     "pretender": "^1.6",
-    "prettier": "^1.13",
+    "prettier": "1.14.3",
     "puppeteer": "1.4",
     "qunit": "2.6",
     "route-recognizer": "^0.3.3",
diff --git a/yarn.lock b/yarn.lock
index 3a10744..a2b66c6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2065,10 +2065,10 @@ pretender@^1.6:
     fake-xml-http-request "^1.6.0"
     route-recognizer "^0.3.3"
 
-prettier@^1.13:
-  version "1.14.2"
-  resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.2.tgz#0ac1c6e1a90baa22a62925f41963c841983282f9"
-  integrity sha512-McHPg0n1pIke+A/4VcaS2en+pTNjy4xF+Uuq86u/5dyDO59/TtFZtQ708QIRkEZ3qwKz3GVkVa6mpxK/CpB8Rg==
+prettier@1.14.3:
+  version "1.14.3"
+  resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895"
+  integrity sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg==
 
 process-nextick-args@~1.0.6:
   version "1.0.7"

GitHub

Hmmm are there any problems with 1.15.2

Also 1.15 has HTML support which may… or may not be interesting, I wonder if we can teach it to deal with our html erb files.

Yes, 1.15.2 raises two syntax errors:

[error] app/assets/javascripts/discourse/components/related-messages.js.es6: SyntaxError: Invalid regular expression flag (14:61)
[error]   12 |       ? `<a href="${href}">${iconHTML("envelope", {
[error]   13 |           class: "private-message-glyph"
[error] > 14 |         })}</a><span>${I18n.t("related_messages.title")}</span>`
[error]      |                                                             ^
[error]   15 |       : I18n.t("related_messages.title");
[error]   16 |   }
[error]   17 | });
[error] app/assets/javascripts/discourse/components/suggested-topics.js.es6: SyntaxError: Invalid regular expression flag (15:64)
[error]   13 |       ? `<a href="${href}">${iconHTML("envelope", {
[error]   14 |           class: "private-message-glyph"
[error] > 15 |         })}</a><span>${I18n.t("suggested_topics.pm_title")}</span>`
[error]      |                                                                ^
[error]   16 |       : I18n.t("suggested_topics.title");
[error]   17 |   },
[error]   18 | 

I see, can we raise this with the prettify team on GitHub and link the ticket here, looks like there is a bug in the JS parser.

Sure, will do.

1 Like

See 1.15 introduces JS syntax error regression · Issue #5529 · prettier/prettier · GitHub

2 Likes