Skip to content

Commit

Permalink
Add docs for cache-strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed May 27, 2022
1 parent 18ed8ce commit 862b405
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 9 additions & 1 deletion 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.

Expand All @@ -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
```
8 changes: 8 additions & 0 deletions docs/cli.md
Expand Up @@ -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
```

0 comments on commit 862b405

Please sign in to comment.