@avi2dg/checks 0.45.0 → 0.45.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 CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  Every release of `@avi2dg/checks`, newest first, written by the release from its conventional commits.
4
4
 
5
+ ## 0.45.1
6
+
7
+ Released 2026-10-19.
8
+
9
+ ### Fixes
10
+
11
+ - **quality:** pass @property in the Baseline CSS gate at every target [#169](https://github.com/avi2d/checks/pull/169)
12
+
5
13
  ## 0.45.0
6
14
 
7
15
  Released 2026-10-18.
@@ -39,6 +39,16 @@ function tokenFiles(tokens) {
39
39
  return tokens;
40
40
  throw new TypeError(REFUSED_TOKENS);
41
41
  }
42
+ var BASELINE_RULE = "plugin/use-baseline";
43
+ function passProperty(entry) {
44
+ if (entry === null || entry === undefined)
45
+ return entry;
46
+ const [primary, options = {}] = Array.isArray(entry) ? entry : [entry];
47
+ const ignored = Reflect.get(options, "ignoreAtRules") ?? [];
48
+ if (!Array.isArray(ignored))
49
+ return entry;
50
+ return [primary, { ...options, ignoreAtRules: ["property", ...ignored] }];
51
+ }
42
52
  function designTokens(files) {
43
53
  if (files.length === 0)
44
54
  return { rules: {}, overrides: [] };
@@ -48,17 +58,18 @@ function designTokens(files) {
48
58
  function defineConfig({ baseline, tokens, rules, overrides = [], ...rest }) {
49
59
  const available = baselineTarget(baseline);
50
60
  const tokenRules = designTokens(tokenFiles(tokens));
61
+ const merged = {
62
+ ...CONVENTION_CHANGES,
63
+ ...SELECTOR_COMPLEXITY,
64
+ [BASELINE_RULE]: [true, { available }],
65
+ ...tokenRules.rules,
66
+ ...rules
67
+ };
51
68
  return {
52
69
  ...rest,
53
70
  extends: [peer("stylelint-config-standard")],
54
71
  plugins: [peer("stylelint-plugin-use-baseline")],
55
- rules: {
56
- ...CONVENTION_CHANGES,
57
- ...SELECTOR_COMPLEXITY,
58
- "plugin/use-baseline": [true, { available }],
59
- ...tokenRules.rules,
60
- ...rules
61
- },
72
+ rules: { ...merged, [BASELINE_RULE]: passProperty(merged[BASELINE_RULE]) },
62
73
  overrides: [
63
74
  { files: [...MARKUP], customSyntax: peer("postcss-html") },
64
75
  { files: [...HTML_AND_ASTRO], rules: { "declaration-block-single-line-max-declarations": null } },
@@ -38,7 +38,7 @@ A control that needs selection off sets it on its own selector, such as `.drag-h
38
38
  | G2 conventions | `stylelint-config-standard`, which extends G1 with the stylelint team's notation and spacing rules | on |
39
39
  | G3 selector complexity | `selector-max-specificity` at `0,3,2` and `selector-max-compound-selectors` at 3 | on |
40
40
  | G4 design tokens | `color-no-hex`, `color-named: "never"`, `function-disallowed-list` over `rgb`, `rgba`, `hsl`, `hsla`, `hwb`, `lab`, `lch`, `oklab`, `oklch` and `color`, and `font-size` only as one `var(--…)` with no fallback, or `inherit` | off until `tokens` names the token files, and off in those files |
41
- | G5 Baseline target | `plugin/use-baseline` from `stylelint-plugin-use-baseline`, which judges each property, value, function, at-rule, selector and unit against the Baseline data, and passes a property inside an `@supports` block | on, at the target `baseline` sets |
41
+ | G5 Baseline target | `plugin/use-baseline` from `stylelint-plugin-use-baseline`, which judges each property, value, function, at-rule, selector and unit against the Baseline data, and passes a property inside an `@supports` block. It passes `@property` at every target, since a browser without `@property` treats the declaration as an unregistered custom property | on, at the target `baseline` sets |
42
42
 
43
43
  The builder changes three of the shared config's rules:
44
44
 
@@ -112,6 +112,8 @@ An accepted exception lives there rather than in a comment, such as a property t
112
112
  rules: { "plugin/use-baseline": [true, { available: "widely", ignoreProperties: { "user-select": ["none"] } }] },
113
113
  ```
114
114
 
115
+ `@property` needs no such exception, since the kit passes it at every target, and adds it to the `ignoreAtRules` of a `plugin/use-baseline` entry the repository sets.
116
+
115
117
  The builder owns `extends` and `plugins`.
116
118
  It resolves the shared config, the plugin and `postcss-html` beside the kit, so they need not sit under the directory the gate runs in.
117
119
  stylelint cannot load `stylelint.config.ts` itself under TypeScript 7, so a bare `stylelint --fix` finds no config, and the gate's `--fix` stands in for it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avi2dg/checks",
3
- "version": "0.45.0",
3
+ "version": "0.45.1",
4
4
  "description": "Deterministic checks shared across a set of TypeScript repositories",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -60,6 +60,17 @@ function tokenFiles(tokens: unknown): readonly string[] {
60
60
  throw new TypeError(REFUSED_TOKENS);
61
61
  }
62
62
 
63
+ const BASELINE_RULE = "plugin/use-baseline";
64
+
65
+ // A repository's Baseline entry replaces the kit's option object whole, so the @property pass goes into whichever entry lands.
66
+ function passProperty(entry: Rules[string]): unknown {
67
+ if (entry === null || entry === undefined) return entry;
68
+ const [primary, options = {}] = Array.isArray(entry) ? entry : [entry];
69
+ const ignored: unknown = Reflect.get(options, "ignoreAtRules") ?? [];
70
+ if (!Array.isArray(ignored)) return entry;
71
+ return [primary, { ...options, ignoreAtRules: ["property", ...ignored] }];
72
+ }
73
+
63
74
  function designTokens(files: readonly string[]): Required<Pick<Config, "rules" | "overrides">> {
64
75
  if (files.length === 0) return { rules: {}, overrides: [] };
65
76
  const off = Object.fromEntries(Object.keys(DESIGN_TOKENS).map((rule) => [rule, null]));
@@ -70,17 +81,18 @@ function designTokens(files: readonly string[]): Required<Pick<Config, "rules" |
70
81
  export function defineConfig({ baseline, tokens, rules, overrides = [], ...rest }: ChecksStylelintConfig): Config {
71
82
  const available = baselineTarget(baseline);
72
83
  const tokenRules = designTokens(tokenFiles(tokens));
84
+ const merged: Rules = {
85
+ ...CONVENTION_CHANGES,
86
+ ...SELECTOR_COMPLEXITY,
87
+ [BASELINE_RULE]: [true, { available }],
88
+ ...tokenRules.rules,
89
+ ...rules,
90
+ };
73
91
  return {
74
92
  ...rest,
75
93
  extends: [peer("stylelint-config-standard")],
76
94
  plugins: [peer("stylelint-plugin-use-baseline")],
77
- rules: {
78
- ...CONVENTION_CHANGES,
79
- ...SELECTOR_COMPLEXITY,
80
- "plugin/use-baseline": [true, { available }],
81
- ...tokenRules.rules,
82
- ...rules,
83
- },
95
+ rules: { ...merged, [BASELINE_RULE]: passProperty(merged[BASELINE_RULE]) },
84
96
  overrides: [
85
97
  { files: [...MARKUP], customSyntax: peer("postcss-html") },
86
98
  { files: [...HTML_AND_ASTRO], rules: { "declaration-block-single-line-max-declarations": null } },