Skip to content

design-system/deprecation

Summary

Flags tokens marked with $deprecated. If a deprecation message references another token using alias syntax, running the linter with --fix will substitute the suggested token.

Configuration

Enable this rule in designlint.config.*. See configuration for details on configuring tokens and rules.

json
{
  "tokens": {
    "$version": "1.0.0",
    "color": {
      "old": {
        "$type": "color",
        "$value": {
          "colorSpace": "srgb",
          "components": [0, 0, 0]
        },
        "$deprecated": { "$replacement": "#/color/new" }
      },
      "new": {
        "$type": "color",
        "$value": {
          "colorSpace": "srgb",
          "components": [1, 1, 1]
        }
      },
      "alias": { "$type": "color", "$ref": "#/color/new" }
    }
  },
  "rules": { "design-system/deprecation": "error" }
}

Options

No additional options.

This rule is auto-fixable.

Examples

Invalid

css
.button { color: colors.old; }
ts
const color = "colors.old";

Valid

css
.button { color: colors.new; }
ts
const color = "colors.new";

When Not To Use

If you do not track deprecated tokens, disable this rule.

See also

Released under the MIT License.