prettier-quick
raw JSON → 0.0.5 verified Sat Apr 25 auth: no javascript deprecated
A CLI tool that runs Prettier only on changed files in Git repositories, speeding up formatting by avoiding re-processing unchanged files. Version 0.0.5 is the latest and final release; the package is unmaintained and has been superseded by prettier-quick 2.x (under a different maintainer) and the official 'prettier --check' mode. It requires prettier as a peer dependency and supports Git only, with no ability to format unchanged files. Compared to lint-staged or husky integration, it offers a simpler but limited approach.
Common errors
error Error: Cannot find module 'prettier' ↓
cause prettier is not installed as a peer dependency.
fix
Run 'npm install --save-dev prettier'
error fatal: not a git repository (or any of the parent directories): .git ↓
cause Command executed outside a Git repository.
fix
Initialize a Git repository (git init) or run from within a Git repo.
error No files matching the pattern were found ↓
cause No changed files match Prettier's default patterns.
fix
Ensure there are staged or modified files with supported extensions.
Warnings
deprecated prettier-quick 0.0.5 is unmaintained. Use prettier-quick 2.x or prettier --check. ↓
fix Upgrade to prettier-quick@2 or migrate to prettier --check.
gotcha Only works with Git. Other VCS like Mercurial are not supported. ↓
fix Use husky-hg or lint-staged with Mercurial instead.
gotcha The package does not support formatting all files; it only runs on changed files. ↓
fix Use prettier directly for full codebase formatting.
Install
npm install prettier-quick yarn add prettier-quick pnpm add prettier-quick Imports
- prettier-quick wrong
require('prettier-quick')correctnpx prettier-quick
Quickstart
npm install --save-dev prettier prettier-quick
npx prettier-quick --staged
# Or add to package.json scripts:
# "format": "prettier-quick"