Registry / devops / prettier-husky-lint-staged-installer

prettier-husky-lint-staged-installer

JSON →
library1.4.1jsnpmunverified

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.

npm install prettier-husky-lint-staged-installer
INSTALL
IMPORT
SIG · PRETTIER-HUSKY-LIN
P
prettier-husky-lint-staged-installer
devopsjavascriptv1.4.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

npx
npx prettier-husky-lint-staged-installer
npm install -g prettier-husky-lint-staged-installer && prettier-husky-lint-staged-installer
The tool is designed to be run via npx to avoid global installs.
pnpm dlx
pnpm dlx prettier-husky-lint-staged-installer
pnpm add -g prettier-husky-lint-staged-installer
pnpm dlx is the equivalent of npx for pnpm.
bunx
bunx prettier-husky-lint-staged-installer
bun add -g prettier-husky-lint-staged-installer
bunx is the Bun equivalent of npx.

Installs and configures Prettier, Husky, and lint-staged with default settings.

cd your-project npx prettier-husky-lint-staged-installer
prettier-husky-lint-staged-installer --version
Debug
Known issues
breakingv1.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.
fix
Run `npm uninstall husky` and then run `npx prettier-husky-lint-staged-installer` to get the correct Husky v9 setup.
affects: >=1.3.0
gotchaThe script overwrites existing `lint-staged` config in package.json. If you have an existing lint-staged configuration, it will be replaced.
fix
Backup your package.json before running the installer, or manually merge after installation.
affects: >=1.0.0
gotchaThe 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.
fix
Ensure `lint-staged` and `prettier` are in `devDependencies` before committing.
affects: >=1.0.0
deprecatedv1.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.
fix
Delete the old `.husky/precommit` file or run the installer again to overwrite with the new format.
affects: >=1.0.0 <1.3.0
Errors
Common errors & fixes
ENOENT: no such file or directory, open '.husky/pre-commit'
The installer failed to create the pre-commit hook file, possibly due to insufficient permissions or missing `.husky` directory.
fix
Ensure the `.husky/` directory exists and is writable. Run `mkdir -p .husky && npx prettier-husky-lint-staged-installer`.
Git commit hangs indefinitely
The pre-commit hook is misconfigured, possibly running an invalid `npx lint-staged` command that waits for input.
fix
Check that `lint-staged` is installed as a devDependency. Run `npm install --save-dev lint-staged` then test with `git commit`.
npx: command not found: prettier-husky-lint-staged-installer
npm may be outdated or the package name is misspelled.
fix
Update npm: `npm install -g npm@latest`. Then run the command again exactly: `npx prettier-husky-lint-staged-installer`.
Upgrade
Version history
1.4.1latest on npm
Audit
Dependencies
huskyrequiredRequired to create and manage Git hooks
lint-stagedrequiredRuns Prettier on staged files during pre-commit
prettierrequiredFormats code; the core formatter
Agent activity
4 hits · last 30 days
node
4
Resources
prettier-husky-lint-staged-installer — npm install prettier-husky-lint-staged-installer · libregistry