Add pre-commit hook to reject lock files from non-project package managers
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 64/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- git, javascript
- 领域
- tooling
调研方向
首先检查仓库的包配置、现有的 Git hooks 和 .gitignore;查看 PR #2134,了解锁文件的背景。检查 issue 中链接的 Husky 和 lint-staged 说明,然后验证已暂存的 package-lock.json 或 pnpm-lock.yaml 文件会根据 Yarn 指南被拒绝,并验证相关的 hook 设置能够正常工作。
由索引模型根据 Issue 内容生成。
描述
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.jsonandpnpm-lock.yamlin staged files - If detected, reject the commit with a message explaining the project uses Yarn and to run
yarn installinstead - Add the hook setup to the project's dev dependencies if Husky is not already configured
- Consider adding
package-lock.jsonandpnpm-lock.yamlto.gitignoreas a secondary safeguard
Resources/Instructions
- Husky - Git hooks
- lint-staged for running checks on staged files
- Motivated by PR #2134 where
package-lock.jsonwas accidentally introduced during the ESM migration
- 主要语言
- JavaScript
- 星标
- 61
- 派生
- 101
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
hackforla/VRMS 的其他 Issue
-
complexity: small housekeeping p-feature: Login role: Front End size: 0.25pt
难度 1/5 1 小时以内 新手友好度 95/100
-
complexity: small feature: Infrastructure p-feature: User Permissions role: Front End size: 0.25pt
难度 1/5 1 小时以内 新手友好度 68/100
-
Bug complexity: medium good first issue p-feature: Login role: Front End size: 1pt
难度 2/5 1-3 小时 新手友好度 68/100
-
complexity: medium feature: Login role: devops size: 1pt
难度 2/5 半天 新手友好度 72/100
-
complexity: small p-feature: Onboarding role: Front End size: 0.25pt
难度 2/5 1-3 小时 新手友好度 68/100
相似的 Issue
-
Bug
难度 2/5 1-3 小时 新手友好度 70/100
Automattic/safe-publish#594 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
dream-num/dsh-univer-office#104 ·
-
comp/dashboard invalid P3
难度 2/5 1-3 小时 新手友好度 70/100
NousResearch/hermes-agent#121143 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
avniproject/avni-webapp#1811 ·
-
area/auroraboot area/webui bug
难度 2/5 1-3 小时 新手友好度 75/100