Skip to content

fix(hooks): remove deprecated husky shim and add package-manager fall…#5

Merged
vikashkrdeveloper merged 1 commit intomasterfrom
fix/husky-v10-precommit-compat
Mar 25, 2026
Merged

fix(hooks): remove deprecated husky shim and add package-manager fall…#5
vikashkrdeveloper merged 1 commit intomasterfrom
fix/husky-v10-precommit-compat

Conversation

@vikashkrdeveloper
Copy link
Copy Markdown
Owner

Description

This PR fixes pre-commit hook reliability issues by removing deprecated Husky shim usage and adding package-manager fallback support.

The hook now works even when Yarn is not globally available, preventing commit failures such as command not found during pre-commit.

Why This Change

  • Husky shim style used in hooks is deprecated and will fail in future Husky versions.
  • Pre-commit previously depended on Yarn being present in PATH.
  • Developers using npm or pnpm could not commit successfully.

What Changed

  • Removed deprecated Husky shim invocation from pre-commit hook.
  • Added package-manager fallback logic in pre-commit:
    • Yarn first
    • pnpm second
    • npm/npx fallback
  • Replaced Yarn-only lint-staged audit command with a portable script approach.

Impact

  • No runtime/backend behavior changes.
  • Improves developer experience and onboarding.
  • Reduces commit-time failures across different local setups.

Validation

  • Pre-commit hook executes successfully without deprecated shim usage.
  • Hook runs lint-staged without requiring global Yarn.
  • Fallback path works when different package managers are used.

@vikashkrdeveloper vikashkrdeveloper merged commit 368db7c into master Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant