stylelint-plugin-rhythmguard 1.5.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +33 -5
- package/package.json +3 -3
- package/src/cli/audit.js +718 -100
- package/src/cli/index.js +2 -1
- package/src/eslint/rules/tailwind-class-use-scale.js +25 -120
- package/src/utils/tailwind-class-analysis.js +221 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,22 @@ The format follows Keep a Changelog principles and semantic versioning.
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [1.6.1] - 2026-05-23
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Added `rhythmguard audit --ignore` for pruning root-relative paths before scanning large repositories.
|
|
14
|
+
- Scoped audit traversal to scan-relevant CSS and template files instead of collecting every file under the audit root first.
|
|
15
|
+
- Added default audit skips for common generated directories such as `.svelte-kit`, `.turbo`, and `.vercel`.
|
|
16
|
+
|
|
17
|
+
## [1.6.0] - 2026-05-19
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- `rhythmguard audit` now reports design-system drift across CSS declarations and Tailwind arbitrary spacing class strings.
|
|
22
|
+
- Added `--format markdown` / `--markdown` audit output for PR-ready design-system health reports.
|
|
23
|
+
- Audit JSON now includes format version, CSS findings, Tailwind class-string findings, scan counts, top affected files, and summary totals while preserving existing top-level count fields.
|
|
24
|
+
|
|
9
25
|
## [1.4.2] - 2026-02-21
|
|
10
26
|
|
|
11
27
|
### Changed
|
package/README.md
CHANGED
|
@@ -77,6 +77,35 @@ This gives you spacing governance in both CSS files and JSX/TSX templates.
|
|
|
77
77
|
|
|
78
78
|
I built Rhythmguard after 20 years of watching teams ignore spacing scales and ship arbitrary pixel values everywhere.
|
|
79
79
|
|
|
80
|
+
## Try It in Your Browser
|
|
81
|
+
|
|
82
|
+
**[petrilahdelma.github.io/stylelint-plugin-rhythmguard](https://petrilahdelma.github.io/stylelint-plugin-rhythmguard/)** — paste CSS, see violations and token opportunities live. No install, no config.
|
|
83
|
+
|
|
84
|
+
## Audit Before You Enforce
|
|
85
|
+
|
|
86
|
+
Use the audit CLI to create a design-system drift report before turning rules into hard CI gates:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npx rhythmguard audit ./src
|
|
90
|
+
npx rhythmguard audit ./src --format markdown
|
|
91
|
+
npx rhythmguard audit ./src --json
|
|
92
|
+
npx rhythmguard audit . --ignore "apps/legacy/**" --ignore "vendor/**"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The report covers authored CSS declarations and Tailwind arbitrary spacing values in common template/source files. Scan paths are scoped to the directory argument, and `--ignore` accepts repeatable, root-relative glob patterns for large generated or legacy subtrees. Markdown output is PR-ready for UX developers, UX designers, and design-system owners:
|
|
96
|
+
|
|
97
|
+
```md
|
|
98
|
+
# Rhythmguard Design-System Audit
|
|
99
|
+
|
|
100
|
+
| Metric | Value |
|
|
101
|
+
| --- | ---: |
|
|
102
|
+
| CSS files scanned | 47 |
|
|
103
|
+
| Template files scanned | 83 |
|
|
104
|
+
| Files with issues | 12 |
|
|
105
|
+
| Total findings | 52 |
|
|
106
|
+
| Scale cleanliness | 91% |
|
|
107
|
+
```
|
|
108
|
+
|
|
80
109
|
## Installation
|
|
81
110
|
|
|
82
111
|
```bash
|
|
@@ -180,6 +209,7 @@ Framework-specific setup for Vue, Lit, Astro, and SvelteKit: [`docs/FRAMEWORKS.m
|
|
|
180
209
|
## Comparison and Migration Recipes
|
|
181
210
|
|
|
182
211
|
- Side-by-side tool fit guide with migration snippets: [`docs/COMPARISON.md`](https://github.com/petrilahdelma/stylelint-plugin-rhythmguard/blob/main/docs/COMPARISON.md)
|
|
212
|
+
- Audit 2.0 validation and roadmap: [`docs/AUDIT_2_VALIDATION.md`](https://github.com/petrilahdelma/stylelint-plugin-rhythmguard/blob/main/docs/AUDIT_2_VALIDATION.md)
|
|
183
213
|
- Real-world before/after excerpts from public repos: [`docs/ADOPTION_DIFFS.md`](https://github.com/petrilahdelma/stylelint-plugin-rhythmguard/blob/main/docs/ADOPTION_DIFFS.md)
|
|
184
214
|
- Distribution submissions to Stylelint discovery surfaces: [`docs/DISTRIBUTION.md`](https://github.com/petrilahdelma/stylelint-plugin-rhythmguard/blob/main/docs/DISTRIBUTION.md)
|
|
185
215
|
|
|
@@ -502,13 +532,13 @@ The `tailwind` config preset automatically extracts spacing tokens from Tailwind
|
|
|
502
532
|
|
|
503
533
|
See [`docs/TAILWIND.md`](https://github.com/PetriLahdelma/stylelint-plugin-rhythmguard/blob/main/docs/TAILWIND.md) for full setup.
|
|
504
534
|
|
|
505
|
-
### What
|
|
535
|
+
### What the Stylelint layer does not cover
|
|
506
536
|
|
|
507
537
|
- Tailwind class strings in templates/JSX/TSX, for example:
|
|
508
538
|
- `class="p-4 gap-2"`
|
|
509
539
|
- `class="p-[13px] translate-y-[18px]"`
|
|
510
540
|
|
|
511
|
-
Those are not Stylelint declaration nodes, so they are outside Stylelint rule scope.
|
|
541
|
+
Those are not Stylelint declaration nodes, so they are outside Stylelint rule scope. Use the ESLint companion rule below for scale-aware class-string enforcement.
|
|
512
542
|
|
|
513
543
|
### Companion ESLint layer for class strings
|
|
514
544
|
|
|
@@ -562,7 +592,7 @@ Suggested setup:
|
|
|
562
592
|
Then pair with:
|
|
563
593
|
|
|
564
594
|
- `stylelint-plugin-rhythmguard/eslint` for arbitrary spacing class-string scale enforcement.
|
|
565
|
-
- `eslint-plugin-tailwindcss` for broader class-string linting and conventions.
|
|
595
|
+
- `eslint-plugin-tailwindcss` for broader class-string linting and conventions. If your policy is to ban every arbitrary value, enable its `tailwindcss/no-arbitrary-value` rule; use Rhythmguard when you want spacing-specific scale checks and nearest-value fixes.
|
|
566
596
|
- `prettier-plugin-tailwindcss` for deterministic class ordering.
|
|
567
597
|
|
|
568
598
|
Detailed setup reference: [`docs/TAILWIND.md`](https://github.com/PetriLahdelma/stylelint-plugin-rhythmguard/blob/main/docs/TAILWIND.md).
|
|
@@ -658,8 +688,6 @@ Detailed methodology and custom args are documented in [`docs/BENCHMARKING.md`](
|
|
|
658
688
|
## Article
|
|
659
689
|
|
|
660
690
|
- Dev.to: [Enforcing your spacing standards with Rhythmguard](https://dev.to/petrilahdelma/enforcing-your-spacing-standards-with-rhythmguard-a-custom-stylelint-plugin-1ojj)
|
|
661
|
-
- Original article update note (Feb 21, 2026): [`docs/DEVTO_ORIGINAL_UPDATE_NOTE_2026-02-21.md`](https://github.com/petrilahdelma/stylelint-plugin-rhythmguard/blob/main/docs/DEVTO_ORIGINAL_UPDATE_NOTE_2026-02-21.md)
|
|
662
|
-
- Continuation draft (ready to publish): [`docs/DEVTO_CONTINUATION_2026-02-21.md`](https://github.com/petrilahdelma/stylelint-plugin-rhythmguard/blob/main/docs/DEVTO_CONTINUATION_2026-02-21.md)
|
|
663
691
|
|
|
664
692
|
## Used by and Community Examples
|
|
665
693
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stylelint-plugin-rhythmguard",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Token governance for CSS and Tailwind — enforce spacing scales, require design tokens, catch arbitrary values",
|
|
5
5
|
"bin": {
|
|
6
|
-
"rhythmguard": "
|
|
6
|
+
"rhythmguard": "src/cli/index.js"
|
|
7
7
|
},
|
|
8
8
|
"keywords": [
|
|
9
9
|
"stylelint",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
},
|
|
100
100
|
"repository": {
|
|
101
101
|
"type": "git",
|
|
102
|
-
"url": "
|
|
102
|
+
"url": "https://github.com/PetriLahdelma/stylelint-plugin-rhythmguard"
|
|
103
103
|
},
|
|
104
104
|
"homepage": "https://github.com/petrilahdelma/stylelint-plugin-rhythmguard#readme",
|
|
105
105
|
"bugs": {
|