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

V2 config: ignore {file:...} in JSONC comments

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

まだ誰も着手していません。

評価

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

調査の方向性

この issue は V2 設定パーサーのトークン置換ロジックにあります。{file:...} トークンを処理するコードを探してください。おそらく src/config/parser.ts などのファイルにあります。修正では、// で始まる行だけでなく、JSONC コメント (// および /* */) 内のトークンをスキップする必要があります。まず、提供された再現手順を実行して失敗を確認し、次にリンクされているプルリクエスト #50899 を調べて、意図された修正のコンテキストを把握してください。

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

説明

Description

In V2, a {file:...} token inside an inline // or /* ... */ comment in opencode.jsonc is treated as a real file reference. If that file does not exist, an otherwise valid config fails to load. The current substitution code skips only lines that begin with //.

Expected: comments are left alone; only active config values are substituted. Missing files in active values should still be errors.

Related #14478 concerned an active token shadowed by a commented duplicate in the older config path; here V2 dereferences tokens that occur only in comments.

Implementation: #50899 (targets v2).

Plugins

None

OpenCode version

V2 9c8a63e852722a9bced4a0de1179de58a85dfa20

Steps to reproduce
  1. Create opencode.jsonc with:

    {
      "username": "demo" // {file:./not-present.txt}
    }
    
  2. Load the configuration. It fails trying to read not-present.txt even though the token is in a comment. A block comment containing the token has the same problem.

Screenshot and/or share link

Not applicable. A Core config regression test reproduces the failure with NotFound for missing-inline.txt before the fix.

Operating System

Linux x86_64

Terminal

Not applicable (Core test)

主要言語
TypeScript
スター
209k
フォーク
27.5k
平均マージ
9時間 42分
マージ済み PR(30日)
389

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

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

はじめの一歩

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

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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