All files / packages/design-tokens/src/validators run-validators.js

100% Statements 7/7
100% Branches 2/2
100% Functions 3/3
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39              4x                                   4x 27x   4x 3x               4x  
#!/usr/bin/env node
/**
 * Validator Runner - Run all validators
 * Usage: yarn validate [--verbose|-v] [--interactive|-i]
 */
import { createRunner, printBasicSummary, v, runMain } from './validator-runner-utils.js';
 
const VALIDATORS = [
  v(
    'DTCG Compliance',
    'dtcg-compliance.js',
    'Validate that token source files use DTCG-compliant property names ($deprecated, $value, etc.)',
  ),
  v(
    'Cross-Platform Color Validation',
    'cross-platform-colors/index.js',
    'Validate color consistency across CSS, Android, and iOS',
  ),
  v(
    'Theme Parity Validation',
    'theme-parity.js',
    'Validate that Cosmos and SLDS themes contain the same token keys',
  ),
];
 
export const getValidators = (verboseFlag = '') =>
  VALIDATORS.map((val) => ({ ...val, args: val.args(verboseFlag) }));
 
export const main = (options = {}) =>
  createRunner({
    title: 'Running Validators',
    description: 'Validate token quality.',
    getValidators,
    printSummary: printBasicSummary,
    ...options,
  });
 
runMain(main, import.meta.url);