terrazzoapp / terrazzo

Use DTCG tokens JSON to generate code for web, mobile, native apps, and more
https://terrazzo.app
MIT License
147 stars 25 forks source link

Add core linter #238

Closed drwpow closed 5 months ago

drwpow commented 5 months ago

Changes

Part of #225

Adds a buncha new rules to @cobalt-ui/core out-of-the-box:

Rule Default Description
duplicate-values "warn" Enforce no tokens have duplicate values.
naming "off" Enforce all token names follow a specific style (e.g. kebab-case or camelCase)
required-children "off" Enforces matching groups have required children.
required-modes "off" Enforces matching tokens have required modes.
color/format "off" Enforce color tokens are declared in a certain format (e.g. oklch).
color/gamut "warn" Enforce color tokens are displayable within the specified gamut (srgb, p3, or rec2020).
typography/required-properties "off" Enforce typography tokens have specific properties (e.g. fontWeight).

Also adds a new Linting guide to take full advantage of these checks

How to Review

changeset-bot[bot] commented 5 months ago

🦋 Changeset detected

Latest commit: 27f071579db59e6b5533f42a4b1f7c1d0b12f0e8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages | Name | Type | | -------------------------- | ----- | | @cobalt-ui/utils | Patch | | @cobalt-ui/core | Minor | | @cobalt-ui/cli | Minor | | @cobalt-ui/plugin-css | Major | | @cobalt-ui/plugin-js | Major | | @cobalt-ui/plugin-sass | Major | | @cobalt-ui/plugin-tailwind | Major | | @cobalt-ui/lint-a11y | Major |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

cloudflare-pages[bot] commented 5 months ago

Deploying cobalt-ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 27f0715
Status: âœ…  Deploy successful!
Preview URL: https://06d9d9b1.cobalt-ui.pages.dev
Branch Preview URL: https://lint-core.cobalt-ui.pages.dev

View logs