From 361dc14f0693548067b318e671f7eafb6d16f39d Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Thu, 17 Mar 2022 20:11:50 +0800 Subject: [PATCH 1/2] Update Vercel logo & link (#12456) --- website/data/users.yml | 7 +++---- .../static/images/users/vercel-logotype-dark.svg | 3 +++ website/static/images/users/zeit-200x100.png | Bin 687 -> 0 bytes 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 website/static/images/users/vercel-logotype-dark.svg delete mode 100644 website/static/images/users/zeit-200x100.png diff --git a/website/data/users.yml b/website/data/users.yml index 19856bc09..de6cbe3cd 100644 --- a/website/data/users.yml +++ b/website/data/users.yml @@ -43,10 +43,9 @@ greyImage: /images/users/used_by_storybook.svg infoLink: https://storybook.js.org/ pinned: true -- caption: ZEIT - image: /images/users/zeit-200x100.png - greyImage: /images/users/used_by_zeit.svg - infoLink: https://zeit.co +- caption: Vercel + image: /images/users/vercel-logotype-dark.svg + infoLink: https://vercel.com/ - caption: Spotify image: /images/users/used_by_spotify.svg infoLink: https://spotify.github.io diff --git a/website/static/images/users/vercel-logotype-dark.svg b/website/static/images/users/vercel-logotype-dark.svg new file mode 100644 index 000000000..bb5a15a24 --- /dev/null +++ b/website/static/images/users/vercel-logotype-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/website/static/images/users/zeit-200x100.png b/website/static/images/users/zeit-200x100.png deleted file mode 100644 index f19168e74e9e3fb3d86927306bf5fdae376ced2c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 687 zcmeAS@N?(olHy`uVBq!ia0vp^CxAGGg9S)t_HS=sU|=fqba4!+xb^myZH926%(0K^ zJEsdduM*p$p&=r4@lk*y3%jGsg{`qu_4MZI^68bC^7-8@-O75rX~zqNuI2?RJXD(% zxLgl5Et+O#->z2G(!JBWSikZ8^B@t!6w9!l--d+K>Z+@$9Y8^50mxs0Ypt$m@95`4T<)tXzjbcT=ikx5gVf5`=PykxqV@;EO;cG>nKPW4*#EmxNcT$cH` z{Bd`M%5JxjWl zXmnR`+metkJNuosRXAv9ezkkGp{cUJLyuGVm*oDwML)wfoih2zdoSpZmCWbd>Akn^ zxlLtnVbl4s!T-qFt%BOOSM=Vrvo0u&;M-!Lvj5XezoWmKl*8A}`SvSp)!I7AHfPzs z`f9zSs~2m8&%1Nr+1pG#1I6Z`OV+Y|;qD1$x3VwKulm`>DcO=;_^NcjusVpx?1ALp1-^H9$&vw5jFCGybIgy&%J%QW4E;J PN06MStDnm{r-UW|pvp53 From ae080df3e7c38e22ddb47699f71bd2bbca3d822e Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Thu, 17 Mar 2022 20:13:28 +0800 Subject: [PATCH 2/2] Enable `unicorn/template-indent` rule (#12469) --- .eslintrc.js | 1 + scripts/release/utils.js | 4 +- tests/config/install-prettier.js | 11 ++-- tests/config/utils/check-parsers.js | 12 ++-- tests/format/js/cursor/jsfmt.spec.js | 22 ++++--- .../__tests__/__snapshots__/format.js.snap | 11 ++-- tests/integration/__tests__/doc-trim.js | 15 +++-- tests/integration/__tests__/format.js | 15 ++--- .../__tests__/ignore-in-subdirectories.js | 3 +- .../__tests__/line-suffix-boundary.js | 13 ++-- tests/integration/__tests__/load-toml.js | 25 ++++---- tests/integration/__tests__/stdin-filepath.js | 61 ++++++++++--------- .../__tests__/with-parser-inference.js | 33 +++++----- 13 files changed, 122 insertions(+), 104 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 45ea57473..3cd5adc21 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -153,6 +153,7 @@ module.exports = { "unicorn/prefer-string-starts-ends-with": "error", "unicorn/prefer-switch": "error", "unicorn/prefer-type-error": "error", + "unicorn/template-indent": "error", }, overrides: [ { diff --git a/scripts/release/utils.js b/scripts/release/utils.js index 27910ab3a..3a47125db 100644 --- a/scripts/release/utils.js +++ b/scripts/release/utils.js @@ -103,9 +103,9 @@ function getBlogPostInfo(version) { function getChangelogContent({ version, previousVersion, body }) { return outdent` - [diff](https://github.com/prettier/prettier/compare/${previousVersion}...${version}) + [diff](https://github.com/prettier/prettier/compare/${previousVersion}...${version}) - ${body} + ${body} `; } diff --git a/tests/config/install-prettier.js b/tests/config/install-prettier.js index 2f62f50c9..eb6dbd45b 100644 --- a/tests/config/install-prettier.js +++ b/tests/config/install-prettier.js @@ -2,6 +2,7 @@ const path = require("path"); const fs = require("fs"); +const { outdent } = require("outdent"); const { default: chalk } = require("../../vendors/chalk.js"); const { default: tempy } = require("../../vendors/tempy.js"); const { execaSync } = require("../../vendors/execa.js"); @@ -74,12 +75,12 @@ module.exports = (packageDir) => { console.log( chalk.green( + outdent` + Prettier installed + at ${chalk.inverse(installed)} + from ${chalk.inverse(packageDir)} + with ${chalk.inverse(client)}. ` -Prettier installed - at ${chalk.inverse(installed)} - from ${chalk.inverse(packageDir)} - with ${chalk.inverse(client)}. - `.trim() ) ); diff --git a/tests/config/utils/check-parsers.js b/tests/config/utils/check-parsers.js index 8234ebe10..a0d88f02a 100644 --- a/tests/config/utils/check-parsers.js +++ b/tests/config/utils/check-parsers.js @@ -163,13 +163,13 @@ const checkParser = ({ dirname, files }, parsers = []) => { suggestCategories.length === 0 ? "" : outdent` - Suggest move your tests to: - ${suggestCategories - .map((category) => `- ${path.join(TESTS_ROOT, category)}`) - .join("\n")} + Suggest move your tests to: + ${suggestCategories + .map((category) => `- ${path.join(TESTS_ROOT, category)}`) + .join("\n")} - Or config to allow use this parser in "${__filename}". - `; + Or config to allow use this parser in "${__filename}". + `; throw new Error( `Parser "${parser}" should not used in "${dirname}".${ diff --git a/tests/format/js/cursor/jsfmt.spec.js b/tests/format/js/cursor/jsfmt.spec.js index 841828427..499d7e225 100644 --- a/tests/format/js/cursor/jsfmt.spec.js +++ b/tests/format/js/cursor/jsfmt.spec.js @@ -1,6 +1,7 @@ run_spec(__dirname, ["babel", "typescript", "flow"]); const prettier = require("prettier-local"); +const { outdent } = require("outdent"); test("translates cursor correctly in basic case", () => { expect( @@ -32,17 +33,22 @@ test("keeps cursor inside formatted node", () => { }); test("doesn't insert second placeholder for nonexistent TypeAnnotation", () => { - const code = ` -foo('bar', cb => { - console.log('stuff') -})`; + const code = + "\n" + + outdent` + foo('bar', cb => { + console.log('stuff') + }) + `; expect( prettier.formatWithCursor(code, { parser: "babel", cursorOffset: 24 }) ).toMatchObject({ - formatted: `foo("bar", (cb) => { - console.log("stuff"); -}); -`, + formatted: + outdent` + foo("bar", (cb) => { + console.log("stuff"); + }); + ` + "\n", cursorOffset: 25, }); }); diff --git a/tests/integration/__tests__/__snapshots__/format.js.snap b/tests/integration/__tests__/__snapshots__/format.js.snap index b4365a670..40cafac78 100644 --- a/tests/integration/__tests__/__snapshots__/format.js.snap +++ b/tests/integration/__tests__/__snapshots__/format.js.snap @@ -12,12 +12,11 @@ exports[`html parser should handle CRLF correctly 1`] = `"\\"