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

Thanks all for your comments and feedback. The spec editors reviewed this and have decided to update the spec to make `$type` mandatory on either the token or one of its parent groups. To put it another way, when all else fails while resolving a token's type instead of falling back on one of the JSON types, it should now be considered an error:

> The resolved type of a design token is:
> 
> 1. The $type property on the token object, if present. Otherwise...
> 1. If the token is a reference, the resolved type of the token it is referencing. Otherwise...
> 1. The inherited type from the nearest parent group that has a $type property. Otherwise...
> 1. ~Whichever of the basic JSON types the token's value is~ _the token is invalid and should be ignored_

The intent is to preserve the (human) authoring convenience that inheriting `$type` from parent groups provides, while guarding against accidental omission of any kind of type info. In those situations, rather than assuming the author intended the token to be one of the basic JSON types, we're now assuming that was an accident.

I'll leave this issue open until we've created and merged a PR that updates the spec to reflect this change.

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


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

Received on Tuesday, 29 November 2022 21:35:45 UTC