setup-pre-commit

Automate Husky and lint-staged pre-commit hooks for code quality checks.

1|Updated Aug 16, 2023
One-click install
npx skills add https://github.com/monlor/dotfiles --skill setup-pre-commit-monlor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-pre-commit
Source: https://github.com/monlor/dotfiles/tree/main/config/ai/agents/skills/setup-pre-commit
Command: npx skills add https://github.com/monlor/dotfiles --skill setup-pre-commit-monlor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires husky, lint-staged, prettier, and includes scripts (resource) components.

What problem does it solve?

This Skill automates the setup of Husky pre-commit hooks with lint-staged, type checking, and tests, ensuring code quality and consistency in your repository.

Core Features & Use Cases

  • Automated Setup: Streamlines the process of setting up Husky and lint-staged hooks.
  • Code Quality: Integrates Prettier for formatting, type checking, and testing to maintain code quality.
  • Use Case: When you want to add pre-commit hooks for code formatting, type checking, and testing to your repository to ensure code consistency.

Quick Start

Run the 'setup-pre-commit' skill to automate the setup of pre-commit hooks in your repository.

Frequently Asked Questions about setup-pre-commit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate pre-commit hooks for code quality in a Git repository?

Automating pre-commit hooks involves setting up Husky and lint-staged to enforce code formatting, type checking, and tests before commits. This Skill streamlines that setup process to ensure code consistency across your repository.

What's the best way to configure Husky and lint-staged for formatting and testing?

Configuring Husky and lint-staged is best handled by automating the integration of Prettier, type checking, and tests. This Skill streamlines the configuration process to automatically run these checks on staged files.

Do I need Prettier to use Husky and lint-staged for pre-commit checks?

Yes, Prettier is a required dependency to automate pre-commit hooks with this setup. It works alongside Husky and lint-staged to enforce code formatting and maintain code quality during the commit process.

Can I enforce type checking and testing in pre-commit hooks for any Git repository?

Yes, you can enforce type checking and testing in any Git repository. The setup requires package manager support alongside Husky and lint-staged to run these automated code quality checks before commits.

Why use lint-staged with Husky for pre-commit code quality checks?

Using lint-staged with Husky ensures code quality checks only run on staged files, making the pre-commit process faster. This approach enforces formatting, type checking, and tests efficiently without slowing down commits.