stylelint-plugin-rhythmguard 3.4.0 → 3.5.0
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 +11 -0
- package/package.json +1 -1
- package/src/audit/config.js +6 -0
- package/src/core/token-packages.json +36 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,17 @@ The format follows Keep a Changelog principles and semantic versioning.
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [3.5.0] - 2026-09-08
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- `audit.tokenSources` entries in `.rhythmguardrc.json` and typed sources passed to the API keep their `tokenPattern`. Both normalisers dropped it, so a per-source pattern was silently ignored by the audit while the same key worked for the package allowlist.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- Token-package discovery reads five more packages, each named by its maintainers in the audit issues: `bootstrap` (`$spacer`, `$spacers`; Bootstrap-derived systems such as AdminLTE inherit it), `@patternfly/patternfly`, `@mittwald/flow-design-tokens` (`--size-px--*` and `--size-rem--*`, one ladder in two units), `govuk-frontend` and `nhsuk-frontend`. A contract test checks every allowlist entry.
|
|
18
|
+
- The State of Spacing edition marks rows whose scale lives in a dependency package the benchmark's sparse checkout cannot see, and rows whose maintainers said there is no spacing scale by design; neither is counted.
|
|
19
|
+
|
|
9
20
|
## [3.4.0] - 2026-09-06
|
|
10
21
|
|
|
11
22
|
### Fixed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stylelint-plugin-rhythmguard",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "Nobody chose 13px. Catches off-scale spacing in CSS and Tailwind class strings and snaps it to your scale or tokens. Stylelint rules, an ESLint companion, and an audit CLI.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"rhythmguard": "src/cli/index.js"
|
package/src/audit/config.js
CHANGED
|
@@ -141,6 +141,7 @@ function normalizeCliTokenSources(sources, format) {
|
|
|
141
141
|
baseDir: source.baseDir || process.cwd(),
|
|
142
142
|
format: source.format || format,
|
|
143
143
|
path: source.path || source.file,
|
|
144
|
+
...(typeof source.tokenPattern === 'string' && source.tokenPattern ? { tokenPattern: source.tokenPattern } : {}),
|
|
144
145
|
};
|
|
145
146
|
}
|
|
146
147
|
return {
|
|
@@ -177,10 +178,15 @@ function normalizeConfigTokenSources(sources, baseDir) {
|
|
|
177
178
|
throw new Error('Invalid Rhythmguard config: token source objects must include a path.');
|
|
178
179
|
}
|
|
179
180
|
|
|
181
|
+
if (source.tokenPattern !== undefined && (typeof source.tokenPattern !== 'string' || source.tokenPattern.trim().length === 0)) {
|
|
182
|
+
throw new Error('Invalid Rhythmguard config: token source tokenPattern must be a non-empty string.');
|
|
183
|
+
}
|
|
184
|
+
|
|
180
185
|
return {
|
|
181
186
|
baseDir,
|
|
182
187
|
format: normalizeTokenSourceFormat(source.format || 'auto'),
|
|
183
188
|
path: source.path,
|
|
189
|
+
...(source.tokenPattern ? { tokenPattern: source.tokenPattern } : {}),
|
|
184
190
|
};
|
|
185
191
|
});
|
|
186
192
|
}
|
|
@@ -50,6 +50,42 @@
|
|
|
50
50
|
"scss/generated/_spacing.scss"
|
|
51
51
|
],
|
|
52
52
|
"note": "$spacing-01..13 in rem, Sass variables; Carbon's styles package forwards them from here"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "bootstrap",
|
|
56
|
+
"files": [
|
|
57
|
+
"scss/_variables.scss"
|
|
58
|
+
],
|
|
59
|
+
"note": "$spacer and the $spacers map; Bootstrap-derived systems (AdminLTE, CoreUI, Tabler) inherit it from here"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "@patternfly/patternfly",
|
|
63
|
+
"files": [
|
|
64
|
+
"base/patternfly-variables.css"
|
|
65
|
+
],
|
|
66
|
+
"note": "--pf-t--global--spacer--100..800 in rem"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "@mittwald/flow-design-tokens",
|
|
70
|
+
"files": [
|
|
71
|
+
"dist/css/base.css"
|
|
72
|
+
],
|
|
73
|
+
"tokenPattern": "^--size-(?:px|rem)--",
|
|
74
|
+
"note": "one size scale in two units, --size-px--* and --size-rem--*, same steps"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "govuk-frontend",
|
|
78
|
+
"files": [
|
|
79
|
+
"dist/govuk/settings/_spacing.scss"
|
|
80
|
+
],
|
|
81
|
+
"note": "$govuk-spacing-points map, 5px steps"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "nhsuk-frontend",
|
|
85
|
+
"files": [
|
|
86
|
+
"dist/nhsuk/core/settings/_spacing.scss"
|
|
87
|
+
],
|
|
88
|
+
"note": "$nhsuk-spacing-points map"
|
|
53
89
|
}
|
|
54
90
|
]
|
|
55
91
|
}
|