Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

scripts/markdownlint deletes the tracked package-lock.json and modifies package.json

オープン 初心者向け
#24,446 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@mjonss がすでに取り組んでいます。

2026年10月15日 から。

  • #24464 @mjonss による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
bash, nodejs
領域
tooling

調査の方向性

バグは scripts/markdownlint 内で、ロックファイルの存在を確認して npm install --save-dev を実行するブロックにあります。まずそのブロックと、スペルが誤っている package-json.lock を検査している部分を読んでください。markdownlint がインストールされていない状態でスクリプトを実行したときに、git status で package-lock.json と package.json が変更されず、かつ lint が実行されれば完了です。issue では修正案として npm install --no-save が提案されています。

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

説明

area/docs-efficiency type/bug

Error Report

Please answer the following questions before submitting your issue. Thanks!

  1. What is the URL/path of the document related to this issue?

    scripts/markdownlint

  2. How would you like to improve it?

    When markdownlint is not installed globally and ./node_modules/.bin/markdownlint does not exist yet, running ./scripts/markdownlint <files> deletes the tracked package-lock.json file and modifies package.json:

    $ ./scripts/markdownlint some-file.md
    $ git status --short
     D package-lock.json
     M package.json
    

    The cause is in the following part of the script:

    had_lock=
    if test -f package-json.lock ; then
      had_lock=true
    fi
    npm install --save-dev '[email protected]'
    if [[ -z "$had_lock"  ]] ; then
      rm -f package-lock.json
    fi
    
    • The lock file check uses package-json.lock instead of package-lock.json, so had_lock is always empty and package-lock.json is always removed. package-lock.json has been tracked in the repository since #8881, so this removes a tracked file.
    • npm install --save-dev adds "markdownlint-cli": "^0.17.0" to devDependencies in package.json, and the script does not revert it.

    Because AGENTS.md and several skills in .agents/ instruct agents to run ./scripts/markdownlint <files> for validation, these unrelated changes can easily end up in doc PRs.

    Suggested fix: install markdownlint-cli without modifying the tracked files, for example, with npm install --no-save '[email protected]', and remove the had_lock logic. Alternatively, add markdownlint-cli to devDependencies in package.json and package-lock.json.

主要言語
Python
スター
616
フォーク
725
平均マージ
1日 6時間
マージ済み PR(30日)
534

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pingcap/docs のほかの issue

pingcap/docs の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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