microsoft / microsoft/pxt

Implement "satisfies" operator in Static TypeScript

Open
#10,600 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
641
Avg merge
12h 4m
Merged PRs (30d)
57

Description

Feature request template

Is your feature request related to a problem? Please describe.
It would be very nice to be able to use the satisfies operator within PXT projects, as it would finally provide an alternative to as without casting to the specific type.

Describe the solution you'd like
The satisfies operator being implemented into the Static TypeScript compiler, and working similar to the as operator that currently is available for use in PXT.

Describe alternatives you've considered
The only alternative is to use the as keyword, which will cast the value to a different type, potentially causing issues.

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.

Research direction

Start by locating the Static TypeScript compiler and its existing as operator handling. Compare the requested satisfies behavior with that implementation and identify how compiler coverage is organized. Done means satisfies works in PXT projects without the type-casting behavior described in the request.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.