archivo del paquete→ .shtukbase/packages/design-tokens/checks/valid.ts
checks/valid.ts
14 líneas, 691 B.
El archivo tal como está en el paquete: el código y sus comentarios no se traducen.
- // DTK-R01. The tokens file is valid DTCG: a JSON tree of groups and tokens; every token has $value and a known
- // $type (its own, its group's or the referenced token's); the value fits the type; every reference {a.b} leads to
- // a token of the right type; no reference cycles; names have no { } or dots. The dark file, if set, overrides only
- // existing tokens.
- import { report } from '../../design-base/lib/files.ts';
- import { validate } from '../actions/tokenslib.ts';
- export const RULE = { id: 'dtk-r01', title: 'Tokens are valid by the DTCG format' };
- export function check(root = process.cwd()): string[] {
- return validate(root).problems;
- }
- if (import.meta.main) report(check());