Skip to content

fix(ci): update husky pre-commit to remove deprecated v9 header lines #12

@CodeMonkeyCybersecurity

Description

Problem

Every git commit shows:

husky - DEPRECATED
Please remove the following two lines from .husky/pre-commit:
  #!/usr/bin/env sh
  . "\$(dirname -- "\$0")/_/husky.sh"
They WILL FAIL in v10.0.0

The .husky/pre-commit file uses husky v9 header syntax. Husky v10 (upcoming) will break this.

Fix

Remove these two lines from .husky/pre-commit:

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

Husky v9+ with modern config only needs the hook commands, not the shell sourcing.

Current pre-commit content

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

echo "Running pre-commit checks..."
npx lint-staged
echo "Running unit tests..."
npm run test:unit
echo "Pre-commit checks passed!"

After fix

echo "Running pre-commit checks..."
npx lint-staged
echo "Running unit tests..."
npm run test:unit
echo "Pre-commit checks passed!"

Priority: P2 (will break in husky v10 but not blocking now)
Refs: Noticed during fix/1-auth-issue-database-runtime-crashes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions