Feature request: remove rules from match expression
Open
Nobody has claimed this yet.
cross-platform :tv:
needs discussion :speech_balloon:
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
Motivation
From my perspective some rules at match expression are unneeded what make the validation slower as needed and the handling complex.
Unneeded rules
Empty Array:
Error: Expected at least one branch label
["match", [id], [], 1,2]
This is clear, only default will use
Same Value:
["match", [id], [1], 1, [1] 2, 3]
This is clear, 2 is never used because 1 comes first
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by locating the match-expression validation and its tests, then verify how empty branch lists and duplicate branch values are handled; done means the requested cases no longer produce unnecessary validation errors or retain unreachable branches.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100