# lint-staged/lint-staged

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/lint-staged-lint-staged).**

14,460 stars · 460 forks · JavaScript · mit

## Links

- GitHub: https://github.com/lint-staged/lint-staged
- Homepage: https://www.npmjs.com/package/lint-staged
- awesome-repositories: https://awesome-repositories.com/repository/lint-staged-lint-staged.md

## Topics

`developer-experience` `eslint` `git` `linter` `stage-files` `stylelint` `workflow`

## Description

Lint-staged is a command-line utility designed to automate code quality checks and formatting tasks within a Git repository. It functions as a pre-commit hook runner that executes defined operations exclusively on files currently staged for commit, ensuring that only code meeting project standards is permanently saved.

The tool distinguishes itself by providing granular control over the development workflow through file filtering and task orchestration. It uses glob-pattern matching to isolate specific file types and executes sequences of shell commands in a strict order. To maintain repository integrity, it manages task concurrency and preserves the working directory state, automatically rolling back changes if any step in the execution sequence fails.

This utility supports a range of repository automation tasks, including automated code formatting and validation, by integrating directly into the commit process. It is configured through standard project files and is intended for use as part of a local development environment.

## Tags

### Development Tools & Productivity

- [Git Hook Managers](https://awesome-repositories.com/f/development-tools-productivity/git-hook-managers.md) — Executes code quality checks and formatting commands exclusively on files staged for commit in a Git repository.
- [Git Workflow Automation](https://awesome-repositories.com/f/development-tools-productivity/version-control-repository-tools/version-control-managers/git-workflow-automation.md) — Manages task execution sequences and file filtering to ensure consistent code standards before every commit.
- [Code Formatting Tools](https://awesome-repositories.com/f/development-tools-productivity/code-quality-analysis/static-analysis-engines/static-analysis-tools/code-formatting-tools.md) — Maintains consistent code style across a repository by automatically applying formatting rules to files before they are permanently saved.
- [Pre-commit Hooks](https://awesome-repositories.com/f/development-tools-productivity/pre-commit-hooks.md) — Streamlines the development process by executing essential validation tasks automatically during the commit phase to prevent broken code.
- [Task Automation Tools](https://awesome-repositories.com/f/development-tools-productivity/task-automation-tools.md) — Runs complex sequences of shell commands on specific subsets of files to maintain project integrity and enforce development policies.
- [Staged File Indexers](https://awesome-repositories.com/f/development-tools-productivity/file-indexing-utilities/staged-file-indexers.md) — Identifies the subset of files currently staged for commit by querying the version control system index before executing any tasks.
- [File Pattern Matching](https://awesome-repositories.com/f/development-tools-productivity/file-pattern-matching.md) — Filters the list of staged files against user-defined path patterns to isolate specific file types for targeted processing.
- [Sequential Execution Engines](https://awesome-repositories.com/f/development-tools-productivity/sequential-execution-engines.md) — Executes a defined pipeline of commands in a strict order where each step must complete successfully before the next begins.

### DevOps & Infrastructure

- [Commit Checkers](https://awesome-repositories.com/f/devops-infrastructure/version-control-automation/commit-based-versioning-engines/commit-checkers.md) — Ensures that only code meeting project standards is committed by automatically running linters and formatters on staged files.

### Networking & Communication

- [Version Control Stashing](https://awesome-repositories.com/f/networking-communication/terminal-state-preservation/version-control-stashing.md) — Creates a temporary backup of the working directory using version control primitives to ensure a clean environment during task execution.
