microsoft / microsoft/TypeScript

Compiler "target" option capitalization in docs inconsistent with code and json schema

未关闭
#6,490 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Docs
主要语言
Go
星标
111k
派生
14.3k
平均合并
2 天 4 小时
30 天内合并 PR
132

描述

https://github.com/Microsoft/TypeScript/wiki/Compiler-Options
says --target can take the value ES5 (uppercase).

Visual Studio Code warns about using the uppercase one in your tsconfig.json, presumably because it's following the schema.

The JSON schema for tsconfig.json also has it in lowercase, but the docs (https://github.com/Microsoft/TypeScript/wiki/tsconfig.json#details) refer you to the first page (which uses uppercase) for the values.


My guess at fixing the problem:

From the source it appears the value ought to be lowercase:
https://github.com/Microsoft/TypeScript/blob/master/src/compiler/commandLineParser.ts#L221

I think the fix is to use lowercase in the docs (the first page).

贡献指南

打开贡献指南

从这里开始

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

调研方向

打开 Compiler Options wiki 页面,并将其中的 --target 值与 tsconfig.json 文档、JSON schema 以及所引用的 src/compiler/commandLineParser.ts 条目进行比较。更新文档,使大小写与 schema 和代码一致,然后检查链接的文档不再提供相互冲突的指导。

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

评估

技术栈
typescript
领域
documentation
Issue 类型
文档
难度
1/5
预计耗时
1 小时以内
活跃度
停滞
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 发到你的邮箱

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