feat 🥁: add prefer-theme-tokens rule
Some checks failed
CI / Build (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Test (push) Has been cancelled

- Enforce theme tokens over hard-coded values in vanilla-extract styles (colors, spacing, font sizes, border radius/widths, shadows, z-index, opacity, font weights, transitions)
- Provide token suggestions from configured theme contracts; optional auto-fix for unambiguous replacements
This commit is contained in:
Ante Budimir 2025-11-13 21:26:44 +02:00
parent d5eae5dfc8
commit 1d88c12e3d
16 changed files with 3201 additions and 21 deletions

View file

@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.15.0] - 2025-11-14
- Add new rule `prefer-theme-tokens`that requires theme tokens instead of hard-coded values in vanilla-extract styles
- Detects hard-coded values across colors, spacing, font sizes, border radius/widths, shadows, z-index, opacity, font weights, and transitions
- Provides suggestions from configured theme contracts; optional auto-fix for unambiguous replacements
- Supports nested objects, media queries, selectors, and (optionally) template literals/helper calls
- Configurable via `themeContracts`, category toggles, `allowedValues`, `allowedProperties`, `autoFix`, `remBase`, `checkHelperFunctions` (see README for details)
## [1.14.0] - 2025-11-09
- Add new rule `prefer-logical-properties` that enforces logical CSS properties over physical directional properties