microsoft / microsoft/TypeScript

Boolean CLI options in standard "--someFlag=someValue" form fail with "error TS5023: Unknown compiler option..."

未关闭
#52,655 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Awaiting More Feedback Suggestion
主要语言
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.

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先重现针对 --incremental=false 和 --noEmit=false 报告的 TS5023 错误,然后跟踪编译器的命令行选项解析过程。将这些形式与现有布尔选项的行为进行比较,并验证 --flag=value 是否会以预期值被接受,包括 issue 中的示例。

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
cli, compilers
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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