Add CLI cache settings to config file #13581
paulshryock
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
|
I have no idea why this isn't a thing to this day. To me it is such an obvious feature that Prettier should have. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Edit 10/16/2025: I have created an issue for this idea: #18089
The CLI cache settings are really nice.
I'd love to be able to configure these from a Prettier configuration file instead of from the CLI.
--cache--cache-location--cache-strategyLike this:
This way the caching strategy can be set dynamically for CI vs local, and my
package.jsoncan be a lot cleaner:From this:
{ "scripts": { "format": "prettier --cache --cache-location=.cache/prettier/.prettier-cache", "format:ci": "npm run format -- --cache-strategy=content", "format:local": "npm run format -- --cache-strategy=metadata", } }To this:
{ "scripts": { "format": "prettier" } }I wanted to get some thoughts and opinions from the maintainers and community first. I would be happy to write up an issue, and possibly a PR, if there is a positive consensus about this.
Beta Was this translation helpful? Give feedback.
All reactions