Misc
Setup Pre-Commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo.
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo.
Check for package-lock.json (npm), pnpm-lock.yaml (pnpm), yarn.lock (yarn), bun.lockb (bun).
Install as devDependencies: husky lint-staged prettier
npx husky init
.husky/pre-commitnpx lint-staged
npm run typecheck
npm run test
.lintstagedrc{
"*": "prettier --ignore-unknown --write"
}
.prettierrc (if missing){
"useTabs": false,
"tabWidth": 2,
"printWidth": 80,
"singleQuote": false,
"trailingComma": "es5",
"semi": true,
"arrowParens": "always"
}
.husky/pre-commit exists and is executable.lintstagedrc existsprepare script in package.json is "husky"prettier config existsStage all changed/created files and commit with message: Add pre-commit hooks (husky + lint-staged + prettier)