c3b-lint 0.0.8 → 0.0.9
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/check/css-tokens.js +3 -2
- package/package.json +1 -1
package/check/css-tokens.js
CHANGED
|
@@ -89,8 +89,9 @@ export function checkCssTokens(report) {
|
|
|
89
89
|
// spacing property (a 24px icon is not --spacing-lg, a 16px font size is not --spacing-md)
|
|
90
90
|
const exact = normalise(value);
|
|
91
91
|
const lengthLike = /^-?\d/.test(exact);
|
|
92
|
-
// zero and
|
|
93
|
-
|
|
92
|
+
// zero, keywords and a var() reference are not "the token's value" even when a token (an alias
|
|
93
|
+
// like --color-icon-border: var(--color-border)) happens to hold them
|
|
94
|
+
const trivial = /^(0|0px|none|auto|inherit|initial|transparent|currentcolor)$/.test(exact) || /var\(/.test(exact);
|
|
94
95
|
if (byValue.has(exact) && !trivial && !decl.prop.startsWith('--') && (!lengthLike || SPACING_PROPERTIES.test(decl.prop))) {
|
|
95
96
|
report.error(`${ file }:${ where.line }`, `${ decl.value } duplicates ${ byValue.get(exact) } — use var(${ byValue.get(exact) })`);
|
|
96
97
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c3b-lint",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Lints a co:lab project against the rules a tool can check: ESLint, Stylelint, the 500-line limit and the shared .editorconfig; --init writes the config files.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"type": "module",
|