mapbox / mapbox/mapbox-gl-js

Improve validation error messages relating to even/odd number of arguments

Open
#6,437 4 comments 4 reactions 1 assignee View on GitHub

@domlet is already working on this.

Since Jul 9, 2021.

api :memo:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

When `case`, `match`, `interpolate`, and `step` don't get the right number of arguments, they produce validation errors that just say "expected odd [or even] number of arguments." We should clarify these to say something more helpful. This will probably require that we don't simply do a preflight check on the number of arguments, which means we'd have a little more wasted parsing work in the case of a validation error, but I think that's worth it.

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.