microsoft / microsoft/TypeScript

Add `asserts` example in Handbook

Open
#53,195 0 comments 6 reactions 1 assignee View on GitHub

@DanielRosenwasser is already working on this.

Since Mar 10, 2023.

Docs Rescheduled
Dominant language
Go
Stars
111k
Forks
14.4k
Avg merge
1d 19h
Merged PRs (30d)
117

Description

Suggestion

🔍 Search Terms

List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily and help provide feedback.

asserts, narrowing, property

✅ Viability Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

Add asserts examples in the handbook to be properly indexed in the Search box. If there is not any specific reason for the absence of this feature in the examples I could make a PR

📃 Motivating Example

Currently asserts exists only in release notes of 3.7 and cannot find examples in handbook.

💻 Use Cases

Have asserts indexed in search box and exist in handbook, so we know that this functionality exists, without finding randomly through google searches.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.