@dsmith-dev/guard
v0.5.0
Published
dsmith guard: design-system drift checks for pull requests and ESLint setup
Maintainers
Readme
@dsmith-dev/guard
dsmith guard: design-system drift checks for pull requests and ESLint setup.
dsmith guard initwrites.dsmith/guard.json(token and DS snapshot), wires@dsmith-dev/eslint-plugininto a flateslint.config.*, and with--ci githubwrites.github/workflows/dsmith-guard.yml.dsmith guard --ci --base <ref>compares the PR against its merge-base and reports only new hardcoded styles, non-DS components and deprecated components;--commentupserts one PR comment.
Notes:
- Commit
.dsmith/guard.json. CI and ESLint read the same snapshot. guard initreports why it did not edit the ESLint config, with a snippet to paste:legacy(eslintrc is not supported),unsupported-shape,needs-ts-parser(TS files but no TS parser in the config),not-eslint(biome, oxlint),no-config.guard --ciworks in all of these.- ESLint rules check JS/TS only. CSS and SCSS are checked by
guard --ci. - The policy (allow lists,
failOn) is read from the merge-base'sguard.json, so a PR cannot loosen its own check. Renamed files are compared with their old path, and--rootcan be a subdirectory. - Exit code 1 means new drift above the policy, or a tool error (a bad
--base, a missing or brokenguard.json); errors print to stderr, the drift report to stdout. A failed PR comment (no token, or a 403 on a fork PR) only prints a warning. staleSnapshotlists token files changed sinceguard init; a token file not recorded in the snapshot shows as+<file>.
Docs: https://github.com/project-hh-org/dsmith#readme
