diff --git a/changelog_unreleased/cli/12800.md b/changelog_unreleased/cli/12800.md index 13f4aaba6df9..37e1587d7982 100644 --- a/changelog_unreleased/cli/12800.md +++ b/changelog_unreleased/cli/12800.md @@ -1,4 +1,4 @@ -#### Add new `--cache` (#12800 by @sosukesuzuki) +#### Add `--cache` CLI option (#12800 by @sosukesuzuki) Two new CLI options have been added for a caching system similar to [ESLint's one](https://eslint.org/docs/user-guide/command-line-interface#caching). Please see the [documentation](https://prettier.io/docs/en/cli.html#--cache) for details. @@ -9,3 +9,11 @@ When you want to format only changed files, you can run Prettier with `--cache` ```bash prettier --write --cache src ``` + +##### `--cache-strategy` + +Strategy for the cache to use for detecting changed files. Can be either `metadata` or `content`. If no strategy is specified, metadata will be used. + +```bash +prettier --write --cache --cache-strategy content src +``` diff --git a/docs/cli.md b/docs/cli.md index 612b9dc7f920..f76838aee9d4 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -212,3 +212,11 @@ When you want to format only changed files, you can run Prettier with `--cache` ```bash prettier --write --cache src ``` + +## `--cache-strategy` + +Strategy for the cache to use for detecting changed files. Can be either `metadata` or `content`. If no strategy is specified, metadata will be used. + +```bash +prettier --write --cache --cache-strategy content src +```