ci(client): run theme:lint as a per-file ratchet with the missing token rules

theme:lint only reported a total and exited 0, skipped whole files by name and
never ran in CI. It now counts per file under src/ against
scripts/theme-baseline.json, which only shrinks, like lint:rtl: the colour
literals, arbitrary colour classes and numeric font sizes it already saw, plus
palette classes (bg-gray-100, text-indigo-600, bg-white), raw text sizes
(text-sm, text-[13px]) instead of the type tiers, z-index literals above z-50
instead of a step of the layering scale, and reads of the dark_mode setting.
The file exemptions are gone; the map, PDF and brand files carry their count in
the baseline instead. theme-lint-disable markers stay valid in a comment and
are counted against scripts/theme-disable-baseline.json, like rtl-lint-disable
in lint:rtl; a new one raises its file's entry by hand, where review sees it.
The comment handling lint:rtl already had moves into scripts/lib/source.mjs so
both read source the same way.
The check runs in the client-quality job.
This commit is contained in:
Maurice
2026-10-10 12:51:00 +02:00
parent f51a64017d
commit 242756708e
14 changed files with 876 additions and 121 deletions
+7 -1
View File
@@ -60,7 +60,7 @@ their current position until the file gets converted.
(+ `ring-accent`) — never `bg-slate-900` / `bg-black` / `bg-indigo-*`. This
is what lets a user's accent reach new surfaces automatically.
3. **Semantic text size** uses the tier utilities `text-title/subtitle/body/caption`
— never an inline `fontSize: <px>`, never raw `text-sm`/`text-xs` to *mean* a tier.
— never an inline `fontSize: <px>`, never raw `text-sm`/`text-xs` or arbitrary `text-[13px]` to *mean* a tier.
4. **Translucent/blurred** surfaces consume an alpha/glass token
(`--bg-elevated`, `--tooltip-bg`, `--glass-*`) or a `backdrop-blur` utility,
so transparency-off can neutralize them centrally — never inline `rgba()`
@@ -78,3 +78,9 @@ Genuinely dynamic values (data-driven colors like `cat.color`, computed
geometry/transforms/sizes), and the surfaces CSS variables can't reach: injected
map popup/marker HTML, Mapbox/MapLibre paint, and the standalone `@react-pdf`
documents. Mark intentional exceptions with a `theme-lint-disable` line comment.
The markers are counted per file against `client/scripts/theme-disable-baseline.json`,
like `rtl-lint-disable` in `lint:rtl`, so an exception is a decision a reviewer
sees rather than a way around the check. `--update` only lowers that file: a new
marker for a surface the tokens really cannot reach is added by raising (or
adding) its file's entry by hand in the same change, where review can see it.