From fac9ce07fea57f1d852988fdbc217db9c8cf858a Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Mon, 23 Mar 2020 14:39:06 +0200 Subject: [PATCH] mention npx in install docs --- docs/install.md | 6 ++++++ scripts/release/steps/update-version.js | 3 +++ 2 files changed, 9 insertions(+) diff --git a/docs/install.md b/docs/install.md index 24c1e6bab..089ef610e 100644 --- a/docs/install.md +++ b/docs/install.md @@ -20,3 +20,9 @@ npm install --global prettier ``` > We recommend pinning an exact version of prettier in your `package.json` as we introduce stylistic changes in patch releases. + +If you use `npx` to run Prettier, the version should be pinned like this: + +```bash +npx prettier@2.0.1 . --write +``` diff --git a/scripts/release/steps/update-version.js b/scripts/release/steps/update-version.js index f244e3f61..6f0168168 100644 --- a/scripts/release/steps/update-version.js +++ b/scripts/release/steps/update-version.js @@ -15,6 +15,9 @@ async function bump({ version }) { processFile(".github/ISSUE_TEMPLATE/integration.md", (content) => content.replace(/^(- Prettier Version: ).*?$/m, `$1${version}`) ); + processFile("docs/install.md", (content) => + content.replace(/^(npx prettier@)\S+/m, `$1${version}`) + ); // Update unpkg link in docs processFile("docs/browser.md", (content) =>