$ recombobulate _
home / tips / set-up-lint-staged-and-husky-pre-commit-hooks
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.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Switch to the Stable Update Channel with autoUpdatesChannel

The autoUpdatesChannel setting pins Claude Code to a stable release track that skips versions with major regressions.

bagwaa @bagwaa · 1 hour ago
0
Set Claude's Response Language with the language Setting

The language setting makes Claude respond in your preferred language by default, across every session and project.

bagwaa @bagwaa · 1 hour ago
0
Customize or Remove Claude's Git Attribution with the attribution Setting

The attribution setting lets you customize or completely remove Claude's Co-Authored-By trailer from git commits and pull requests.

bagwaa @bagwaa · 1 hour ago