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

> As it stands, the order of precedence is (from highest to lowest):
> 
> 1. The `$type` property on the token object, if present. Otherwise...
> 2. If the token is a reference, the type of the token it is referencing. Otherwise...
> 3. The inherited type from the nearest parent group that has a `$type` property. Otherwise...
> 4. Whichever of the basic JSON types the token's value is

This algorithm makes it much harder to describe the shape of the documents with TypeScript, JSON Schema or other tools for describing JSON. With a simpler model, for example making "$type" required with every "$value", we can create simple schemas for the document. With a simple JSON Schema we can get autocomplete and linting in Visual Studio Code almost for free.

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


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

Received on Tuesday, 30 August 2022 20:59:39 UTC