Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Revisit the use of removeNPMAbsolutePaths

未關閉
#509 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
25/100
Issue 類型
重構
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
typescript
領域
ci-cd, devops

研究方向

首先定位 removeNPMAbsolutePaths,並檢查它如何處理 node_modules 中的 package.json 檔案。使用目前的 package-lock.json 重現 npm ci,並比較產生的 diff,包括結尾換行字元的變更。完成的標準是確定 CI 中是否仍需要進行清理,並避免此處所述的衝突變更。

由索引模型根據 Issue 內容生成。

描述

It appears that npm ci creates a huge diff. None of the package.json files in node_modules have a final newline. Is this something that should be done separate from this PR?

Originally posted by @RA80533 in https://github.com/github/codeql-action/issues/487#issuecomment-838000019

  • The current package-lock.json file was generated as a v2 lock file by npm 7.x. Major releases of npm prior to 7.x inserted an extra property in package.json files residing in the node_modules folder for which removeNPMAbsolutePaths was used. In other words, removeNPMAbsolutePaths no longer has anything to clean up. EDIT: This might not be true for the CI. This specific detail needs to be investigated.
  • removeNPMAbsolutePaths has the unfortunate side effect of stripping the final newline from any file it touches. npm attempts to insert a final newline if it finds that it's missing. The two work against each other to a disastrous effect. VS Code's version control integration has to be reloaded if either of them tries to undo the other because of the enormous amount of changes they make.
主要語言
TypeScript
星號
1.7k
分支
495
平均合併
1 天 2 小時
30 天內合併 PR
47

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

github/codeql-action 的其他 Issue

查看 github/codeql-action 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。