/vendor/design-token-lint/CLAUDE.md
CLAUDE.md at /vendor/design-token-lint/CLAUDE.md
Path: vendor/
CLAUDE.md — packages/design-token-lint
Package
@zudolab/design-token-lint — lint Tailwind CSS class names against design system tokens. Enforces semantic spacing and color tokens instead of raw numeric utilities.
Commands
Run from this directory, or use the workspace shortcuts from the root.
pnpm build # Compile TypeScript to dist/
pnpm test # Run tests (vitest run)
pnpm test:watch # Watch mode
pnpm lint # prettier --check .
pnpm lint:fix # prettier --write .
Source Layout
src/
cli.ts # CLI entry point (#!/usr/bin/env node)
config.ts # Config loading and pattern compilation
extractor.ts # Class name extraction from source files
rules.ts # Rule matching against compiled config
linter.ts # Main linter combining extraction + rules
index.ts # Public API exports
*.test.ts # Tests (colocated)
API Shapes (Important)
LintResultis flat:{ filePath, line, className, reason }— NOT{ filePath, violations: [...] }lintFile()andlintContent()returnLintResult[](array, not single object)Violationhas only{ className, reason }— nolineorcolumncheckClass()returnsViolation | null— notundefinedExtractedClasshas{ className, line }— nocolumn
Keep the public documentation (src/) in sync when changing these shapes.
Publishing
Triggered by pushing a v*.*.* tag to main. The . workflow runs tests + build + pnpm publish --access public. Requires NPM_TOKEN secret.
The repository.directory field in package.json points npm at this subdirectory within the monorepo.
Dogfooding
.design-token-lint.json in this directory configures the linter on its own source code. Run pnpm dlx @zudolab/design-token-lint (after publish) or node dist/ to lint.