-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
Environments:
- Prettier Version: 2.7.1
- Running Prettier via:
npxcommands - Runtime: Node v16.14.0, npm v8.3.1
- Operating System: macOS
- Prettier plugins (if any): none
Steps to reproduce:
Minimal Reproduction: https://github.com/rwaskiewicz/prettier-caching
Steps to Reproduce can be found in the README at the root of the repository
Expected behavior:
Running the following commands in sequence:
npx prettier . --list-different --cache
npx prettier . --write --cache
should format a project's code.
Actual behavior:
Calling npx prettier . --list-different --cache writes a cache. Calling npx prettier . --write --cache afterwards uses that cache and does not format/write the changes to disk.
Additional Information
This caught me off guard more than anything. The workaround (or perhaps the desired behavior) would be to not run the first command with --cache like so:
npx prettier . --list-different
npx prettier . --write --cache
Alternatively, I can see the perspective of --list-different --cache not being allowed to use together.