{"id":19401,"library":"check-prettier","title":"prettier-check","description":"A CLI tool to verify that all source files match Prettier code style, designed for CI integration. Current stable version is 1.0.3. The tool reads a 'checkFiles' pattern from package.json and checks formatting, exiting with non-zero if violations are found. It differs from alternatives by requiring Prettier installed separately and using a config key in package.json. Use it in pre-commit hooks or CI pipelines to enforce consistent code formatting. The package is authored by the same developer as other frontend tools and is under active maintenance.","status":"active","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/chenshuai2144/prettier-check","tags":["javascript","prettier","ci","check"],"install":[{"cmd":"npm install check-prettier","lang":"bash","label":"npm"},{"cmd":"yarn add check-prettier","lang":"bash","label":"yarn"},{"cmd":"pnpm add check-prettier","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency - prettier must be installed separately for formatting checks","package":"prettier","optional":false}],"imports":[{"note":"The package is a CLI tool and does not export any symbols for programmatic use. Always invoke via npx or npm script.","wrong":"require('check-prettier') or import checkPrettier from 'check-prettier'","symbol":"default","correct":"npx check-prettier"}],"quickstart":{"code":"npm install --save-dev prettier check-prettier\n# In package.json, add:\n# \"checkFiles\": [\"src/**/*.js\"]\n# \"scripts\": { \"lint-prettier\": \"check-prettier\" }\n# Then run:\nnpx check-prettier","lang":"javascript","description":"Installs dependencies, configures file patterns in package.json, and runs the CLI to check formatting."},"warnings":[{"fix":"Ensure 'prettier' is in your devDependencies.","message":"The package does not work without 'prettier' installed as a separate dependency.","severity":"gotcha","affected_versions":"all"},{"fix":"Add a 'checkFiles' array to package.json with glob patterns.","message":"File patterns must be defined in the 'checkFiles' key of package.json, otherwise no files are checked.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install --save-dev prettier' to install it.","cause":"Prettier is not installed or not in node_modules.","error":"Error: Cannot find module 'prettier'"},{"fix":"Update the patterns in package.json to match your source files.","cause":"The 'checkFiles' patterns do not match any files in the project.","error":"No files matching pattern"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}