Socket
Book a DemoInstallSign in
Socket

@outfitter/husky-config

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@outfitter/husky-config

> Shared Git hooks configuration for consistent development workflows across > Outfitter projects

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

@outfitter/husky-config

Shared Git hooks configuration for consistent development workflows across Outfitter projects

Installation

npm install --save-dev @outfitter/husky-config
# or
pnpm add -D @outfitter/husky-config

Setup

Automatic Setup

Run the setup script after installation:

npx @outfitter/husky-config setup

Manual Setup

  • Initialize husky in your project:
npx husky init
  • Copy the hooks from this package:
cp -r node_modules/@outfitter/husky-config/hooks/* .husky/

What's Included

Pre-commit Hook

Runs lint-staged to format and lint staged files before committing:

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged

Commit-msg Hook

Validates commit messages using commitlint to ensure they follow conventional commit format:

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit "$1"

Configuration

lint-staged

Create a lint-staged.config.mjs file in your project root:

export default {
  '*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'],
  '*.{json,md,yml,yaml}': 'prettier --write',
};

commitlint

Create a commitlint.config.mjs file in your project root:

export default {
  extends: ['@commitlint/config-conventional'],
};

Workflow

  • Stage your changes: git add .
  • Commit: git commit -m "feat: add new feature"
  • Pre-commit: Automatically formats and lints staged files
  • Commit-msg: Validates the commit message format

Valid Commit Types

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation only changes
  • style: Code style changes (formatting, semicolons, etc)
  • refactor: Code refactoring
  • perf: Performance improvements
  • test: Adding or updating tests
  • chore: Maintenance tasks
  • ci: CI/CD changes
  • build: Build system changes

Troubleshooting

Hooks not running

Ensure hooks have execute permissions:

chmod +x .husky/*

Bypassing hooks (emergency only)

git commit --no-verify -m "emergency: bypass hooks"

Note: This should only be used in emergencies. Always ensure your code meets quality standards.

Development

This package is part of the @outfitter/monorepo monorepo.

See the Development Guide for instructions on building, testing, and contributing to this package.

License

MIT

FAQs

Package last updated on 18 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts