{"id":26099,"library":"prettier-husky-lint-staged-installer","title":"prettier-husky-lint-staged-installer","description":"CLI tool that automatically sets up Prettier, Husky, and lint-staged in any project. Running `npx prettier-husky-lint-staged-installer` (v1.4.1) installs Husky v9, creates a `.husky/pre-commit` hook running `npx lint-staged`, and adds a `lint-staged` config in `package.json` to format all staged files with Prettier. Unlike manual setup guides, this tool provides a one-command automated installation with zero configuration. It supports npm, pnpm, and bun. Actively maintained with regular dependency updates and OIDC trust.","status":"active","version":"1.4.1","language":"javascript","source_language":"en","source_url":"https://github.com/laststance/prettier-husky-lint-staged-installer","tags":["javascript"],"install":[{"cmd":"npm install prettier-husky-lint-staged-installer","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-husky-lint-staged-installer","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-husky-lint-staged-installer","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required to create and manage Git hooks","package":"husky","optional":false},{"reason":"Runs Prettier on staged files during pre-commit","package":"lint-staged","optional":false},{"reason":"Formats code; the core formatter","package":"prettier","optional":false}],"imports":[{"note":"The tool is designed to be run via npx to avoid global installs.","wrong":"npm install -g prettier-husky-lint-staged-installer && prettier-husky-lint-staged-installer","symbol":"npx","correct":"npx prettier-husky-lint-staged-installer"},{"note":"pnpm dlx is the equivalent of npx for pnpm.","wrong":"pnpm add -g prettier-husky-lint-staged-installer","symbol":"pnpm dlx","correct":"pnpm dlx prettier-husky-lint-staged-installer"},{"note":"bunx is the Bun equivalent of npx.","wrong":"bun add -g prettier-husky-lint-staged-installer","symbol":"bunx","correct":"bunx prettier-husky-lint-staged-installer"}],"quickstart":{"code":"cd your-project\nnpx prettier-husky-lint-staged-installer","lang":"javascript","description":"Installs and configures Prettier, Husky, and lint-staged with default settings."},"warnings":[{"fix":"Run `npm uninstall husky` and then run `npx prettier-husky-lint-staged-installer` to get the correct Husky v9 setup.","message":"v1.3.0 and later require Husky v9, which changed the init command from `husky install` to `husky init`. If you manually set up Husky previously, uninstall it first.","severity":"breaking","affected_versions":">=1.3.0"},{"fix":"Backup your package.json before running the installer, or manually merge after installation.","message":"The script overwrites existing `lint-staged` config in package.json. If you have an existing lint-staged configuration, it will be replaced.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure `lint-staged` and `prettier` are in `devDependencies` before committing.","message":"The installer runs `npx lint-staged` inside the pre-commit hook. If `lint-staged` or `prettier` are not installed as devDependencies, the hook will fail silently or error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Delete the old `.husky/precommit` file or run the installer again to overwrite with the new format.","message":"v1.2.0 and earlier used Husky v8 style hooks with `.husky/precommit`. Upgrading to v1.3.0+ will change the hook file to `.husky/pre-commit` to match Husky v9.","severity":"deprecated","affected_versions":">=1.0.0 <1.3.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure the `.husky/` directory exists and is writable. Run `mkdir -p .husky && npx prettier-husky-lint-staged-installer`.","cause":"The installer failed to create the pre-commit hook file, possibly due to insufficient permissions or missing `.husky` directory.","error":"ENOENT: no such file or directory, open '.husky/pre-commit'"},{"fix":"Check that `lint-staged` is installed as a devDependency. Run `npm install --save-dev lint-staged` then test with `git commit`.","cause":"The pre-commit hook is misconfigured, possibly running an invalid `npx lint-staged` command that waits for input.","error":"Git commit hangs indefinitely"},{"fix":"Update npm: `npm install -g npm@latest`. Then run the command again exactly: `npx prettier-husky-lint-staged-installer`.","cause":"npm may be outdated or the package name is misspelled.","error":"npx: command not found: prettier-husky-lint-staged-installer"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}