A command-line tool that runs Prettier only on files changed in Git or Mercurial. It can run as a pre-commit hook and honors your Prettier config and ignore files.
Overview
pretty-quick formats the files you have actually changed instead of an entire tree. It works with Git and Mercurial, comparing against staged changes, a named branch, or patterns you filter with minimatch.
For Git you can use staged pre-commit mode so only staged files are formatted and re-staged afterward, with options to bail on partial staging or skip re-staging. Flags also support check-only runs for CI, verbose file lists, branch comparisons, and custom ignore paths.
The tool respects `.prettierrc`, `.prettierignore`, and `.editorconfig` discovered up the tree, and reads Prettier overrides to decide which extensions to format unless you disable config resolution. You can wire it into pre-commit hooks via tools such as simple-git-hooks.
Key features
- Formats changed Git or Mercurial files
- Staged pre-commit mode for Git
- Branch-based diff selection
- Minimatch pattern filtering
- CI check without writing files
- Prettier config and ignore discovery
- Optional pre-commit hook integration
- Verbose and bail flags
Use cases
- Pre-commit Prettier on staged files
- Format only branch changes
- CI verify formatting on diffs
- Quick local formatting before commit