Development Utility
14.6k 2026-04-18
lint-staged/lint-staged
Automates running code quality tasks like formatters and linters against staged Git files, ensuring clean and consistent code before every commit.
Core Features
Executes tasks exclusively on Git staged files.
Supports arbitrary shell commands (linters, formatters, tests).
Filters files using glob patterns for precise targeting.
Prevents poor code quality from entering the codebase.
Integrates seamlessly with Git pre-commit hooks.
Quick Start
npm install --save-dev lint-stagedDetailed Introduction
Lint-staged addresses the challenge of maintaining code quality by running essential development tasks, such as linting and formatting, only on files that are currently staged for a Git commit. This approach significantly speeds up the feedback loop compared to running checks across an entire project, which can be slow and produce irrelevant results. By integrating with Git pre-commit hooks, lint-staged ensures that every commit adheres to predefined code standards, preventing errors and enforcing consistent code style across the team without manual intervention.