Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My use case: I want to run
prettier --check
on CI, but in order to speed up my CI tasks, I'd rather not check every file in my codebase on every commit. Ideally I'd like to be able to runprettier --check
, but just on the files changed in the current branch.This is really similar to what
pretty-quick --bail
does, but I don't actually want to format the files, I just want pretty-quick to tell me if they need formatting.This PR adds a
--check
CLI flag that runsprettier.check
instead ofprettier.format
and exits with a non-zero status code if any files fail the check.I also renamed
onWriteFile
toonProcessFile
andformatFiles.js
toprocessFiles.js
to reflect that they now handle either formatting or checking operations. This change is in a separate commit to keep the diff for the main code change a bit cleaner.