hackforla / hackforla/VRMS

Add pre-commit hook to reject lock files from non-project package managers

オープン
#2,139 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
complexity: small Dependency - Icebox feature: Package Update role: devops size: 1pt
主要言語
JavaScript
スター
61
フォーク
101
PR マージ指標
30日以内にマージされた PR はありません

説明

### Overview
PRs occasionally include lock files from package managers the project doesn't use (e.g. `package-lock.json` when the project uses Yarn). This causes confusion and bloats diffs. A pre-commit hook should reject these artifacts automatically.

### Action Items
- [ ] Add a pre-commit hook (e.g. via Husky) that checks for `package-lock.json` and `pnpm-lock.yaml` in staged files
- [ ] If detected, reject the commit with a message explaining the project uses Yarn and to run `yarn install` instead
- [ ] Add the hook setup to the project's dev dependencies if Husky is not already configured
- [ ] Consider adding `package-lock.json` and `pnpm-lock.yaml` to `.gitignore` as a secondary safeguard

### Resources/Instructions
- [Husky - Git hooks](https://typicode.github.io/husky/)
- [lint-staged](https://github.com/lint-staged/lint-staged) for running checks on staged files
- Motivated by PR #2134 where `package-lock.json` was accidentally introduced during the ESM migration

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start by inspecting the repository's package configuration, existing Git hooks, and .gitignore; review PR #2134 for the lock-file context. Check the Husky and lint-staged instructions linked in the issue, then verify that staged package-lock.json or pnpm-lock.yaml files are rejected with the Yarn guidance and that the relevant hook setup works.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
git, javascript
領域
tooling
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
64/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。