Set Up lint-staged and Husky Pre-commit Hooks
Pre-commit hooks that run linting and formatting on staged files are one of the highest-ROI automation investments for any team. Claude can generate the full setup in one shot.
Write a lint-staged and Husky v9 configuration for a TypeScript
Next.js project. On commit: run ESLint --fix on .ts and .tsx files,
run Prettier on everything, and run tsc --noEmit. Fail the commit
if any check doesn't pass.
Claude produces the package.json config, the Husky hook file, and the install commands:
# Install
npm install --save-dev husky lint-staged
npx husky init
// package.json
{
"lint-staged": {
"*.{ts,tsx}": ["eslint --fix", "prettier --write"],
"*.{js,json,css,md}": ["prettier --write"]
}
}
# .husky/pre-commit
npx lint-staged
npx tsc --noEmit
Claude also handles edge cases you'd otherwise discover the hard way: running tsc on the whole project rather than just staged files (since TypeScript needs the full type graph), and making sure ESLint runs before Prettier to avoid conflicting auto-fixes.
Hooks that run automatically are the only code quality checks that actually get applied consistently.
Log in to leave a comment.
Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.
Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.
Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.