Husky + lint-staged
Quick start
Section titled “Quick start”tinkerise add huskyWhat it detects
Section titled “What it detects”The husky module checks for:
- An existing
.husky/directory - An installed
huskydependency - A
preparescript that references Husky (reported as detection context)
What it installs
Section titled “What it installs”huskylint-staged
Generated hook behavior
Section titled “Generated hook behavior”The install flow is adaptive:
- Requires a
.gitdirectory; otherwise installation fails with a warning (git initfirst) - Creates
.husky/pre-commitwithnpx lint-staged - Writes
lint-stagedconfig inpackage.jsonbased on what tooling exists:- Adds
eslint --fixrules when ESLint is installed - Adds
prettier --writerules when Prettier is installed
- Adds
File and config changes
Section titled “File and config changes”- Adds
preparescript:husky - Creates
.husky/pre-commitwithnpx lint-staged - Writes
lint-stagedconfig inpackage.json
Expected outcome after tinkerise add husky:
- Commits run staged-file checks automatically
- Pre-commit behavior matches your currently installed lint/format stack
Conflict handling
Section titled “Conflict handling”If Husky is already detected, interactive execution can show diffs and allow accept/skip decisions before finalizing writes.