A CLI tool to verify that all files match Prettier code style during CI or testing. Version 2.0.0 requires Node >=4 and a peer dependency on prettier. It forwards all arguments to prettier, making it easy to integrate into npm test scripts. Compared to alternatives like lint-staged, prettier-check focuses solely on checking formatting without auto-fixing, ideal for pre-commit hooks or CI gates.
npm install prettier-checkVerified import paths — ran on the pinned version, not inferred.
Shows how to integrate prettier-check into npm test scripts, passing Prettier options via CLI arguments.
Use prettier --write locally or in pre-commit hooks for auto-formatting.
For file listing, switch to prettier --list-different or use prettier-check@1.x.
Update to prettier-check@2.0.0 but note changed behavior.
Use double quotes: "prettier-check 'src/**/*.js'" or escape glob.
Ensure prettier is listed in devDependencies or installed globally.
Run npm install --save-dev prettier
Double-check glob pattern and ensure files exist. Use quotes in npm scripts: 'src/**/*.js'
Update Node to >=4 or use a transpiler like Babel.