lint-staged/lint-staged ? reverse-engineered prompt

Reverse engineered prompt

Build me a small command line tool for JavaScript projects that runs formatters and linters only on the files I have staged for commit. I want it to plug into a git pre commit hook so when I run git commit it checks the staged files, runs the right tasks like prettier or eslint on matching file types, then stages any changes it made before finishing the commit.

It should be easy to set up from a config file, work with different file patterns, and let me run multiple tasks on the same files. If a task changes files, make sure those changes are safely backed up so nothing gets lost. I also want useful help text for the command, a few flags for things like running on all tracked files, quiet mode, and debug output, plus clear error messages when a task fails. If you need to, look up current docs online for the best way to handle git hooks and modern Node project setup.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab