Skip to content

ci: fix pre-commit hook for non-TS commits; ignore @types/node majors - #75

Merged
alphacrack merged 1 commit into
mainfrom
ci/dependabot-ignore-types-node
Aug 5, 2026
Merged

ci: fix pre-commit hook for non-TS commits; ignore @types/node majors#75
alphacrack merged 1 commit into
mainfrom
ci/dependabot-ignore-types-node

Conversation

@alphacrack

Copy link
Copy Markdown
Owner

Two small CI-hygiene fixes.

1. pre-commit hook bug (found while committing this PR)

husky 9 runs hooks under sh -e (.husky/_/h: sh -e "$s"). The hook's STAGED_FILES=$(… | grep -E '…') line exits 1 when a commit touches no .ts/.js/.json/.md files, and under set -e that aborts the whole hook — so any commit of only .yml, .sh, etc. was blocked. This regressed silently in the husky 8→9 migration (#36); v8 didn't run hooks with -e. Fixed with || true so a no-match grep yields an empty list and the existing "no staged files" path runs.

2. Dependabot: ignore @types/node majors

@types/node should track the lowest supported Node major (engines >=20). A major bump type-checks APIs that don't exist on Node 20, giving false compatibility confidence. This recurred as PR #67 and PR #74 (both closed); the ignore rule stops the churn. Bump @types/node deliberately when the engines floor moves.

Closes #74 (by making it moot).

🤖 Generated with Claude Code

Two CI-hygiene fixes:

- .husky/pre-commit: husky 9 runs hooks under `sh -e`, so the STAGED_FILES
  `grep` aborted the hook (exit 1) whenever a commit touched no
  .ts/.js/.json/.md files - blocking .yml/.sh-only commits. Guard with
  `|| true`.
- .github/dependabot.yml: ignore `@types/node` semver-major bumps. It should
  track the lowest supported Node major (engines >=20); majors type-check
  APIs unavailable on Node 20. Recurred as PRs #67 and #74, both closed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the ci CI/CD workflows and GitHub Actions label Aug 5, 2026
@alphacrack
alphacrack merged commit 71b14a7 into main Aug 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD workflows and GitHub Actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant