microsoft / microsoft/TypeScript

Type Guard Documentation Is Incorrectly Labeled as Deprecated

Ouverte
#61,881 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Docs Help Wanted
Langage dominant
Go
Étoiles
111k
Forks
14.3k
Merge moyen
2 j 4 h
PR mergées (30 j)
132

Description

🔎 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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par la page de documentation Advanced Types à l’adresse https://www.typescriptlang.org/docs/handbook/advanced-types.html et examinez sa bannière DEPRECATED ainsi que son lien « Go To New Page ». C’est terminé lorsque la bannière est supprimée jusqu’à ce qu’une documentation de remplacement existe, ou lorsque le lien pointe directement vers la documentation mise à jour de type-guards.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript
Domaine
documentation
Type d'issue
Documentation
Difficulté
1/5
Temps estimé
Moins d'une heure
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.