Two new CLI options have been added for a caching system similar to ESLint's one.
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
iscontent
) content of the file - (if
--cache-strategy
ismetadata
) file metadata, such as timestamps
prettier --write --cache src
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