Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 858 Bytes

12800.md

File metadata and controls

25 lines (17 loc) · 858 Bytes

[HIGHLIGHT]Add --cache and --cache-strategy CLI option (#12800 by @sosukesuzuki)

Two new CLI options have been added for a caching system similar to ESLint's one.

--cache

If this option is enabled, the following values are used as cache keys and the file is formatted only if one of them is changed.

  • Prettier version
  • Options
  • Node.js version
  • (if --cache-strategy is content) content of the file
  • (if --cache-strategy is metadata) file metadata, such as timestamps
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, content will be used.

prettier --write --cache --cache-strategy metadata src