microsoft / microsoft/TypeScript
Boolean CLI options in standard "--someFlag=someValue" form fail with "error TS5023: Unknown compiler option..."
还没有人认领这个 Issue。
- 主要语言
- Go
- 星标
- 111k
- 派生
- 14.4k
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 117
描述
Bug Report
tl;dr: User's expect to assign CLI flag options with an equal sign. E.g.--flag=value. That this fails in tsc with an unobvious error is confusing. It misleads users into thinking there isn't a way of disabling options from the command line. For example:
Even if you wanted to forgo the speed benefits of "incremental"... you can't turn it off temporarily because there is no --noIncremental (or analogous) flag.
The form above is wide-spread, especially within the JS community ...
🔎 Search Terms
error TS5023: Unknown compiler option
🕗 Version & Regression Information
Boolean CLI options were first introduced in #11798 , but have never supported the standard --flag=value format
- This is a crash
- This changed between versions ______ and _______
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
- I was unable to test this on prior versions because _______
🙁 Actual behavior
Providing boolean CLI options like --incremental=false, --noEmit=false, and so on all result in a TS5023: Unknown compiler option error.
🙂 Expected behavior
Using the standard double-dash notation of "--flagName=flagValue" (.e.g --incremental=false) should work as expected.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先重现针对 --incremental=false 和 --noEmit=false 报告的 TS5023 错误,然后跟踪编译器的命令行选项解析过程。将这些形式与现有布尔选项的行为进行比较,并验证 --flag=value 是否会以预期值被接受,包括 issue 中的示例。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript
- 领域
- cli, compilers
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100