Developer Tool
14.6k 2026-05-01
lint-staged/lint-staged
Run formatters and linters against staged Git files to prevent bad code from being committed.
Core Features
Execute tasks on staged Git files only
Supports various tools like formatters, linters, and tests
Configurable with glob patterns for file filtering
Integrates seamlessly with Git pre-commit hooks
Automatically backs up original state using git stash
Quick Start
npm install --save-dev lint-stagedDetailed Introduction
lint-staged is a command-line utility designed to improve code quality by executing arbitrary shell tasks, such as linters and formatters, exclusively on files that are currently staged for a Git commit. This approach significantly speeds up code quality checks compared to running them on the entire project, ensuring that only clean, well-formatted code enters the repository. By integrating with Git's pre-commit hooks, it automates the enforcement of coding standards and prevents common errors, making the development workflow more efficient and reliable.