Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#2,139 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 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 内容生成。

描述

complexity: small Dependency - Icebox feature: Package Update role: devops size: 1pt
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
  • lint-staged for running checks on staged files
  • Motivated by PR #2134 where package-lock.json was accidentally introduced during the ESM migration
主要语言
JavaScript
星标
61
派生
101
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

hackforla/VRMS 的其他 Issue

查看 hackforla/VRMS 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。