be-pretty
raw JSON → 1.1.8 verified Fri May 01 auth: no javascript
CLI tool that automates adding Prettier to an existing project with full setup including Husky and pretty-quick for pre-commit hooks. v1.1.8 released as needed, no fixed cadence. Key differentiator: single command legacy codebase installation vs manual multi-step configuration. Requires Node.js and npm/yarn/pnpm/bun. Ships TypeScript declarations.
Common errors
error be-pretty: command not found ↓
cause Package not installed globally or not using npx
fix
Use npx be-pretty or install globally: npm i -g be-pretty
error Error: Cannot find module 'prettier' ↓
cause Missing dependency after be-pretty install
fix
Run npm install inside the project to ensure all deps are present
error be-pretty setDefault: No .prettierrc found in CWD ↓
cause Missing file when no -p flag provided
fix
Create a .prettierrc file or use -p flag with path
error be-pretty: Unsupported package manager ↓
cause Lockfile type not recognized
fix
Ensure lockfile (.yarn.lock, package-lock.json, pnpm-lock.yaml) is present
Warnings
gotcha be-pretty defaults to npm unless yarn.lock is present. May cause unexpected package manager switches. ↓
fix Ensure lockfile matches intended package manager or manually specify.
gotcha The --skipFormatting flag must be used before the command, e.g., npx be-pretty --skipFormatting, not after. ↓
fix Use npx be-pretty --skipFormatting run.
gotcha setDefault command with no -p flag uses .prettierrc in CWD; if absent, command fails silently. ↓
fix Ensure a .prettierrc file exists or provide -p flag.
deprecated Older versions may use lint-staged instead of pretty-quick. Current version uses pretty-quick. ↓
fix Update to latest version via npm i -g be-pretty@latest.
gotcha The package requires npx to be globally available; otherwise command fails. ↓
fix Install npx via npm i -g npx or use npm/yarn/pnpm directly.
Install
npm install be-pretty yarn add be-pretty pnpm add be-pretty Imports
- default wrong
require('be-pretty')correctnpx be-pretty - run wrong
be-prettycorrectnpx be-pretty run - setDefault wrong
be-pretty setDefault (no flag)correctnpx be-pretty setDefault -p ./path
Quickstart
npx be-pretty
# or with skip formatting
npx be-pretty --skipFormatting
# customize default .prettierrc
npx be-pretty setDefault -p /path/to/.prettierrc
# format all files in repo
npx be-pretty formatAll