lint-staged
lint-staged is a Node.js tool that runs linters and other code quality checks on Git staged files before commits. It ensures that only code meeting predefined standards is committed, preventing issues like syntax errors or style violations from entering the repository. It integrates with Git hooks to automate this process, typically used in combination with tools like ESLint, Prettier, or Husky.
Developers should use lint-staged to enforce code quality and consistency in collaborative projects, as it catches errors early in the development workflow. It's particularly useful in CI/CD pipelines to reduce build failures and in teams to maintain uniform coding standards, saving time on manual reviews and preventing bad commits from polluting the codebase.