prettier-pretty-check
raw JSON → 0.2.0 verified Sat Apr 25 auth: no javascript
A drop-in replacement for Prettier's CLI that enhances the --check output with clickable file links, color-coded error categories, and clear rule descriptions. Version 0.2.0 is the current stable release. Unlike Prettier's default terse warnings, this tool emits diagnostics in standard file:line:col format compatible with VS Code, GitHub Actions problem matchers, and most editors. It supports all Prettier options and plugins, passing through non-check commands unchanged. Requires Node.js 18+ and Prettier to be installed separately.
Common errors
error Error: Cannot find module 'prettier' ↓
cause Prettier is not installed in the project.
fix
Install prettier: npm install --save-dev prettier
error Error: Unknown argument: --foo ↓
cause Using an argument that prettier does not support; passed through to prettier and rejected.
fix
Check prettier's documentation for valid options.
error Error: The 'path' argument must be of type string. Received undefined ↓
cause Running prettier-pretty-check without any file pattern.
fix
Specify a glob pattern like npx prettier-pretty-check --check "src/**/*.js"
Warnings
gotcha prettier-pretty-check does not bundle prettier; you must install prettier separately. ↓
fix Run npm install --save-dev prettier alongside prettier-pretty-check.
gotcha When --write is used, arguments are passed through to prettier unchanged; no enhanced output is produced. ↓
fix Use --write as with normal prettier; enhanced output only appears with --check.
deprecated Version 0.2.0 still works but may lack features for newer prettier versions. ↓
fix Watch the repository for updates; for now the tool works with prettier v2 and v3.
Install
npm install prettier-pretty-check yarn add prettier-pretty-check pnpm add prettier-pretty-check Imports
- prettier-pretty-check wrong
npm run prettier-pretty-check --check src/correctnpx prettier-pretty-check --check src/
Quickstart
npm install --save-dev prettier prettier-pretty-check
# or bun add --dev prettier prettier-pretty-check
# Add to package.json:
# {
# "scripts": {
# "format:check": "prettier-pretty-check --check \"src/**/*.{js,ts}\""
# }
# }
# Run:
npx prettier-pretty-check --check "src/**/*.js"