microsoft / microsoft/TypeScript

Type Guard Documentation Is Incorrectly Labeled as Deprecated

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

还没有人认领这个 Issue。

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

描述

🔎 Search Terms

The only source of online information for the proper use of typescript type guards (value is someType, asserts value is someType) is this page, which has a big DEPRECATED banner at the top. Please REMOVE THIS BANNER until this documentation has a replacement, then make the "Go To New Page" button link to the updated documentation, not some top level page where user needs to once again search for this new page that actually does not exist. THIS IS VALUABLE INFORMATION and it needs to be easier to find and trust, this is one of the most important features of typescript!

Image

🕗 Version & Regression Information

This is not code, it's documentation and I can't figure out how else to submit this bug but none of the "code questions" fit here. This documentation page has been like this for at least 2 years. Please fix 🙏

⏯ Playground Link

https://www.typescriptlang.org/docs/handbook/advanced-types.html

💻 Code
https://www.typescriptlang.org/docs/handbook/advanced-types.html
🙁 Actual behavior

Valid and important typescript documentation has deprecation banner and link to new page that does not link to new page and there is no new page, so it's difficult to understand how to use type-guards to get that awesome control flow analysis-based type narrowing. Instead, it looks like typscript is removing the feature (please don't!)

🙂 Expected behavior

Valid and important typescript documentation does not have deprecation banner. OR it has deprecation banner but the link to new page actually goes to the new and updated page. Users can find out how to use type-guards and actually trust the information and can use it with confidence.

Additional information about the issue

Please tell me how to properly submit this bug if this is not the correct location or approach, I don't know what else to do

贡献指南

打开贡献指南

从这里开始

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

调研方向

https://www.typescriptlang.org/docs/handbook/advanced-types.html 的 Advanced Types 文档页面开始,检查其中的 DEPRECATED 横幅和“Go To New Page”链接。完成的标准是:在替代文档存在之前移除该横幅,或者让该链接直接指向更新后的 type-guards 文档。

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

评估

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

把新 issue 发到你的邮箱

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