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

Non-enum CLI options with multiple values separated by comma and space aren't whitespace trimmed

未關閉 適合新手
#64,618 0 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 1 天內回覆

@RyanCavanaugh 已經在處理了。

開始於 2026年10月6日。

  • #64619 來自 @auvred —— 未關閉

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
68/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
typescript
領域
cli, compilers

研究方向

從提供的 npx tsc --showConfig 命令所執行的 CLI 選項解析著手,將 non-enum 選項與 lib 處理進行比較。驗證回報的選項在依逗號分割後不再保留前導空格,同時解析後的設定在其他方面維持不變。

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

描述

Bug
🔎 Search Terms

CLI, compilerOptions, whitespace, comma

🕗 Version & Regression Information

Checked on the latest main

⏯ Playground Link

No response

💻 Code
> npx tsc --showConfig --customConditions "a, b" --types "a, b" --typeRoots "a, b" --moduleSuffixes "a, b" --excludeDirectories "a, b" --excludeFiles "a, b" --lib "es2015, dom" index.ts
🙁 Actual behavior
{
    "compilerOptions": {
        "customConditions": [
            "a",
            " b"
        ],
        "lib": [
            "es6",
            "dom"
        ],
        "moduleSuffixes": [
            "a",
            " b"
        ],
        "typeRoots": [
            "./a",
            "./ b"
        ],
        "types": [
            "a",
            " b"
        ]
    },
    "files": [
        "./index.ts"
    ]
}

See space before b in resolved config, and also note that lib values are trimmed correctly

🙂 Expected behavior
{
    "compilerOptions": {
        "customConditions": [
            "a",
            "b"
        ],
        "lib": [
            "es6",
            "dom"
        ],
        "moduleSuffixes": [
            "a",
            "b"
        ],
        "typeRoots": [
            "./a",
            "./b"
        ],
        "types": [
            "a",
            "b"
        ]
    },
    "files": [
        "./index.ts"
    ]
}

Non-enum options should be whitespace-trimmed as well

Additional information about the issue

Followup for https://github.com/microsoft/TypeScript/pull/64522#discussion_r4147589423

主要語言
Go
星號
111k
分支
15.5k
平均合併
1 天 19 小時
30 天內合併 PR
158

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

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

microsoft/TypeScript 的其他 Issue

查看 microsoft/TypeScript 的全部 Issue

相似的 Issue

更多 Go Issue

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

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