Skip to content

[Infra] .husky/pre-commit only runs lint-staged with no fallback message when npx is unavailable #1077

Description

@grantfox-oss

Join our community: https://t.me/+DOylgFv1jyJlNzM0

Why this matters

.husky/pre-commit is a single line, npx lint-staged, with no error handling. If a contributor's environment lacks network access for npx to resolve lint-staged (e.g. offline, or a corrupted node_modules), the hook fails with a cryptic npx error instead of a clear message telling the contributor to run npm install.

Acceptance criteria

  • Add a guard that checks lint-staged is installed locally before invoking it
  • On failure, print a clear message pointing to npm install
  • Keep the hook fast for the common case (no added latency when lint-staged is present)

Files to touch

  • .husky/pre-commit

Out of scope

  • Adding new pre-commit checks beyond lint-staged
  • Changing what lint-staged lints

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26devopsInfrastructure and CI/CDgood first issueGood for newcomersinfraCI/CD and infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions