Re: [community-group] Token name - reserved words (#61)

I've been working on building tooling for tokens at Microsoft for a couple of years now, and one of my biggest gripes with Style Dictionary today is how they used `value` instead of `$value`. If you're writing a tool for token authoring, what do you do if someone tries to name one `value`? Put up a message in red that says "Sorry, you're not allowed to use that word?" Keeping `type` as a reserved word feels even worse since "type" is a common word that designers use when referring to text styles.

I'm very much in favor of prefixed keywords like `$value` and `$type`. I'm not sure I follow why it's harder to use those from JavaScript code—`$` is an allowed character in JavaScript identifiers.

```js
const tokens = { red: { $value: "#ff0000ff" } }
console.log(tokens.red.$value)
```

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


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

Received on Tuesday, 30 November 2021 19:00:39 UTC