Improve error reporting for assertions/coercions wrapping `['get', 'property_name']`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
By far the most common uses of type assertions and coercions will be to wrap feature property accesses, e.g. `["number", ["get", "property_name"]]` or `["to_color", ["get", "property_name"]]`. In that case, instead of just saying "Expected Number but String instead", we should say something more specific, like, "Expected feature property "property_name" to be a number, but found a string instead."
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
No files or tests are named in the issue. Start by locating the TypeScript expression handling for assertions, coercions, and feature-property access, then find its existing error tests; done means wrapped get expressions report the property name and expected and found types specifically.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100