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 天 11 小时
30 天内合并 PR
151

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

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

microsoft/TypeScript 的其他 Issue

查看 microsoft/TypeScript 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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