Re: [community-group] $type should be a required property (#139)

In the case of parsing or linting, I think it is much simpler for each token to carry a `$type`. 

Using `$type` for every token also adds security that an alias matches the expected type for the token.

For example, I would want an error if I tried to do this:

```
{ 
  "black": {
    "$value": "#000000",
    "$type": "color"
  },
  "height": {
    "$value": "{black}",
    "$type": "dimension".   <----- I want this to fail. It would succeed if "$type" can be omitted.
  }
}
```

With "$type" present, I can get an error when I author this mistake. Without "$type", this error may not surface until I try to build CSS from the tokens. 

I think we're also seeing a trend in developer tooling toward stronger type safety (e.g. Python type annotations, Typescript, etc). For all those reasons, I would like to see "$type" be required.

-- 
GitHub Notification of comment by KyleWpppd
Please view or discuss this issue at https://github.com/design-tokens/community-group/issues/139#issuecomment-1182665646 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 13 July 2022 01:40:44 UTC